A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
AttributeObjectTest Class Reference

Class used to check attributes. More...

+ Inheritance diagram for AttributeObjectTest:
+ Collaboration diagram for AttributeObjectTest:

Public Types

enum  Test_e { TEST_A , TEST_B , TEST_C }
 Test enumerator. More...
 
enum class  Test_ec { TEST_D , TEST_E , TEST_F }
 Test enumerator. More...
 

Public Member Functions

 AttributeObjectTest ()
 
 ~AttributeObjectTest () override
 
void AddToMap1 (uint32_t i)
 Adds an object to the first map.
 
void AddToUnorderedMap (uint64_t i)
 Adds an object to the unordered map.
 
void AddToVector1 ()
 Add an object to the first vector.
 
void AddToVector2 ()
 Add an object to the second vector.
 
void InvokeCb (double a, int b, float c)
 Invoke the m_cb callback.
 
void InvokeCbValue (int8_t a)
 Invoke the m_cbValue callback.
 
void RemoveFromUnorderedMap (uint64_t i)
 Remove an object from the first map.
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID.
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 

Private Types

typedef void(* NumericTracedCallback) (double, int, float)
 Traced callbacks for (double, int, float) values.
 

Private Member Functions

Test_e DoGetEnum () const
 Get the m_enumSetGet value.
 
Test_ec DoGetEnumClass () const
 Get the m_enumClassSetGet value.
 
int16_t DoGetInt16 () const
 Get the m_int16SetGet value.
 
int8_t DoGetIntSrc () const
 Get the m_intSrc2 value.
 
bool DoGetTestA () const
 Get the m_boolTestA value.
 
Ptr< DerivedDoGetVector (std::size_t i) const
 Get the i-th item of m_vector2.
 
std::size_t DoGetVectorN () const
 Get the length of m_vector2.
 
bool DoSetEnum (Test_e v)
 Set the m_enumSetGet value.
 
bool DoSetEnumClass (Test_ec v)
 Set the m_enumClassSetGet value.
 
void DoSetInt16 (int16_t v)
 Set the m_int16SetGet value.
 
bool DoSetIntSrc (int8_t v)
 Set the m_intSrc2 value.
 
void DoSetTestA (bool v)
 Set the m_boolTestA value.
 

Private Attributes

TracedValue< bool > m_boolSrc
 bool Traced value.
 
bool m_boolTest
 Boolean test.
 
bool m_boolTestA
 Boolean test A.
 
bool m_boolTestDeprecated
 Boolean test deprecated.
 
TracedCallback< double, int, float > m_cb
 TracedCallback (double, int, float).
 
Callback< void, int8_tm_cbValue
 Callback accepting an integer.
 
TracedValue< doublem_doubleSrc
 double Traced value.
 
Test_e m_enum
 Enum.
 
Test_ec m_enumclass
 Enum class.
 
Test_ec m_enumClassSetGet
 Enum class set-get.
 
Test_e m_enumSetGet
 Enum set-get.
 
TracedValue< Test_em_enumSrc
 enum Traced value.
 
float m_float
 float.
 
int16_t m_int16
 16-bit integer.
 
int16_t m_int16SetGet
 16-bit integer set-get.
 
int16_t m_int16WithBounds
 16-bit integer with bounds.
 
TracedValue< int8_tm_intSrc1
 First int8_t Traced value.
 
TracedValue< int8_tm_intSrc2
 Second int8_t Traced value.
 
std::map< uint32_t, Ptr< Derived > > m_map1
 Map of uint32_t, derived objects.
 
Ptr< Derivedm_ptr
 Pointer to Derived class.
 
Ptr< Derivedm_ptrInitialized
 Pointer to Derived class.
 
Ptr< Derivedm_ptrInitialized2
 Pointer to Derived class.
 
Ptr< RandomVariableStreamm_random
 Random number generator.
 
Time m_timeWithBounds
 Time with bounds.
 
uint8_t m_uint8
 8-bit integer.
 
TracedValue< uint8_t > m_uintSrc
 uint8_t Traced value.
 
std::unordered_map< uint64_t, Ptr< Derived > > m_unorderedMap
 Unordered map of uint64_t, derived objects.
 
TracedValue< ValueClassTestm_valueSrc
 ValueClassTest Traced value.
 
std::vector< Ptr< Derived > > m_vector1
 First vector of derived objects.
 
std::vector< Ptr< Derived > > m_vector2
 Second vector of derived objects.
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
 
virtual void DoDispose ()
 Destructor implementation.
 
virtual void DoInitialize ()
 Initialize() implementation.
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.
 

Detailed Description

Class used to check attributes.

Definition at line 138 of file attribute-test-suite.cc.

Member Typedef Documentation

◆ NumericTracedCallback

typedef void(* AttributeObjectTest::NumericTracedCallback) (double, int, float)
private

Traced callbacks for (double, int, float) values.

Definition at line 557 of file attribute-test-suite.cc.

Member Enumeration Documentation

◆ Test_e

Test enumerator.

Enumerator
TEST_A 

Test value A.

TEST_B 

Test value B.

TEST_C 

Test value C.

Definition at line 142 of file attribute-test-suite.cc.

◆ Test_ec

enum class AttributeObjectTest::Test_ec
strong

Test enumerator.

Enumerator
TEST_D 

Test value D.

TEST_E 

Test value E.

TEST_F 

Test value F.

Definition at line 150 of file attribute-test-suite.cc.

Constructor & Destructor Documentation

◆ AttributeObjectTest()

AttributeObjectTest::AttributeObjectTest ( )
inline

Definition at line 348 of file attribute-test-suite.cc.

◆ ~AttributeObjectTest()

AttributeObjectTest::~AttributeObjectTest ( )
inlineoverride

Definition at line 352 of file attribute-test-suite.cc.

Member Function Documentation

◆ AddToMap1()

void AttributeObjectTest::AddToMap1 ( uint32_t i)
inline

Adds an object to the first map.

Parameters
iThe index to assign to the object.

Definition at line 372 of file attribute-test-suite.cc.

References ns3::CreateObject(), and m_map1.

+ Here is the call graph for this function:

◆ AddToUnorderedMap()

void AttributeObjectTest::AddToUnorderedMap ( uint64_t i)
inline

Adds an object to the unordered map.

Parameters
iThe index to assign to the object.

Definition at line 381 of file attribute-test-suite.cc.

References ns3::CreateObject(), and m_unorderedMap.

+ Here is the call graph for this function:

◆ AddToVector1()

void AttributeObjectTest::AddToVector1 ( )
inline

Add an object to the first vector.

Definition at line 357 of file attribute-test-suite.cc.

References ns3::CreateObject(), and m_vector1.

+ Here is the call graph for this function:

◆ AddToVector2()

void AttributeObjectTest::AddToVector2 ( )
inline

Add an object to the second vector.

Definition at line 363 of file attribute-test-suite.cc.

References ns3::CreateObject(), and m_vector2.

+ Here is the call graph for this function:

◆ DoGetEnum()

Test_e AttributeObjectTest::DoGetEnum ( ) const
inlineprivate

Get the m_enumSetGet value.

Returns
the value of m_enumSetGet.

Definition at line 509 of file attribute-test-suite.cc.

References m_enumSetGet.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ DoGetEnumClass()

Test_ec AttributeObjectTest::DoGetEnumClass ( ) const
inlineprivate

Get the m_enumClassSetGet value.

Returns
the value of m_enumSetGet.

Definition at line 529 of file attribute-test-suite.cc.

References m_enumClassSetGet.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ DoGetInt16()

int16_t AttributeObjectTest::DoGetInt16 ( ) const
inlineprivate

Get the m_int16SetGet value.

Returns
the value of m_int16SetGet.

Definition at line 441 of file attribute-test-suite.cc.

References m_int16SetGet.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ DoGetIntSrc()

int8_t AttributeObjectTest::DoGetIntSrc ( ) const
inlineprivate

Get the m_intSrc2 value.

Returns
the value of m_intSrc2.

Definition at line 489 of file attribute-test-suite.cc.

References m_intSrc2.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ DoGetTestA()

bool AttributeObjectTest::DoGetTestA ( ) const
inlineprivate

Get the m_boolTestA value.

Returns
the value of m_boolTestA.

Definition at line 432 of file attribute-test-suite.cc.

References m_boolTestA.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ DoGetVector()

Ptr< Derived > AttributeObjectTest::DoGetVector ( std::size_t i) const
inlineprivate

Get the i-th item of m_vector2.

Parameters
iThe index of the element to get.
Returns
i-th item of m_vector2.

Definition at line 469 of file attribute-test-suite.cc.

References m_vector2.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ DoGetVectorN()

std::size_t AttributeObjectTest::DoGetVectorN ( ) const
inlineprivate

Get the length of m_vector2.

Returns
the vector size.

Definition at line 459 of file attribute-test-suite.cc.

References m_vector2.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ DoSetEnum()

bool AttributeObjectTest::DoSetEnum ( Test_e v)
inlineprivate

Set the m_enumSetGet value.

Parameters
vThe value to set.
Returns
true.

Definition at line 499 of file attribute-test-suite.cc.

References m_enumSetGet.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ DoSetEnumClass()

bool AttributeObjectTest::DoSetEnumClass ( Test_ec v)
inlineprivate

Set the m_enumClassSetGet value.

Parameters
vThe value to set.
Returns
true.

Definition at line 519 of file attribute-test-suite.cc.

References m_enumClassSetGet.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ DoSetInt16()

void AttributeObjectTest::DoSetInt16 ( int16_t v)
inlineprivate

Set the m_int16SetGet value.

Parameters
vThe value to set.

Definition at line 450 of file attribute-test-suite.cc.

References m_int16SetGet.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ DoSetIntSrc()

bool AttributeObjectTest::DoSetIntSrc ( int8_t v)
inlineprivate

Set the m_intSrc2 value.

Parameters
vThe value to set.
Returns
true.

Definition at line 479 of file attribute-test-suite.cc.

References m_intSrc2.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ DoSetTestA()

void AttributeObjectTest::DoSetTestA ( bool v)
inlineprivate

Set the m_boolTestA value.

Parameters
vThe value to set.

Definition at line 423 of file attribute-test-suite.cc.

References m_boolTestA.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ GetTypeId()

static TypeId AttributeObjectTest::GetTypeId ( )
inlinestatic

Get the type ID.

Returns
The object TypeId.

Definition at line 161 of file attribute-test-suite.cc.

References ns3::TypeId::AddConstructor(), ns3::TypeId::DEPRECATED, DoGetEnum(), DoGetEnumClass(), DoGetInt16(), DoGetIntSrc(), DoGetTestA(), DoGetVector(), DoGetVectorN(), DoSetEnum(), DoSetEnumClass(), DoSetInt16(), DoSetIntSrc(), DoSetTestA(), m_boolSrc, m_boolTest, m_boolTestDeprecated, m_cb, m_cbValue, m_doubleSrc, m_enum, m_enumclass, m_enumSrc, m_float, m_int16, m_int16WithBounds, m_intSrc1, m_map1, m_ptr, m_ptrInitialized, m_ptrInitialized2, m_random, m_timeWithBounds, m_uint8, m_uintSrc, m_unorderedMap, m_valueSrc, m_vector1, ns3::MakeBooleanAccessor(), ns3::MakeBooleanChecker(), ns3::MakeCallbackAccessor(), ns3::MakeCallbackChecker(), ns3::MakeDoubleAccessor(), ns3::MakeDoubleChecker(), ns3::MakeEnumAccessor(), ns3::MakeEnumChecker(), ns3::MakeIntegerAccessor(), ns3::MakeIntegerChecker(), ns3::MakeObjectMapAccessor(), ns3::MakeObjectMapChecker(), ns3::MakeObjectVectorAccessor(), ns3::MakeObjectVectorChecker(), ns3::MakePointerAccessor(), ns3::MakePointerChecker(), ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MakeTraceSourceAccessor(), ns3::MakeUintegerAccessor(), ns3::MakeUintegerChecker(), ns3::MakeValueClassTestAccessor(), ns3::MakeValueClassTestChecker(), ns3::Seconds(), TEST_A, TEST_B, TEST_C, TEST_D, TEST_E, and TEST_F.

+ Here is the call graph for this function:

◆ InvokeCb()

void AttributeObjectTest::InvokeCb ( double a,
int b,
float c )
inline

Invoke the m_cb callback.

Parameters
aThe first argument of the callback.
bThe second argument of the callback.
cThe third argument of the callback.

Definition at line 401 of file attribute-test-suite.cc.

References m_cb.

◆ InvokeCbValue()

void AttributeObjectTest::InvokeCbValue ( int8_t a)
inline

Invoke the m_cbValue callback.

Parameters
aThe argument of the callback.

Definition at line 410 of file attribute-test-suite.cc.

References ns3::Callback< R, UArgs >::IsNull(), and m_cbValue.

+ Here is the call graph for this function:

◆ RemoveFromUnorderedMap()

void AttributeObjectTest::RemoveFromUnorderedMap ( uint64_t i)
inline

Remove an object from the first map.

Parameters
iThe index to assign to the object.

Definition at line 390 of file attribute-test-suite.cc.

References m_unorderedMap.

Member Data Documentation

◆ m_boolSrc

TracedValue<bool> AttributeObjectTest::m_boolSrc
private

bool Traced value.

Definition at line 566 of file attribute-test-suite.cc.

Referenced by GetTypeId().

◆ m_boolTest

bool AttributeObjectTest::m_boolTest
private

Boolean test.

Definition at line 535 of file attribute-test-suite.cc.

Referenced by GetTypeId().

◆ m_boolTestA

bool AttributeObjectTest::m_boolTestA
private

Boolean test A.

Definition at line 534 of file attribute-test-suite.cc.

Referenced by DoGetTestA(), and DoSetTestA().

◆ m_boolTestDeprecated

bool AttributeObjectTest::m_boolTestDeprecated
private

Boolean test deprecated.

Definition at line 536 of file attribute-test-suite.cc.

Referenced by GetTypeId().

◆ m_cb

TracedCallback<double, int, float> AttributeObjectTest::m_cb
private

TracedCallback (double, int, float).

Definition at line 558 of file attribute-test-suite.cc.

Referenced by GetTypeId(), and InvokeCb().

◆ m_cbValue

Callback<void, int8_t> AttributeObjectTest::m_cbValue
private

Callback accepting an integer.

Definition at line 552 of file attribute-test-suite.cc.

Referenced by GetTypeId(), and InvokeCbValue().

◆ m_doubleSrc

TracedValue<double> AttributeObjectTest::m_doubleSrc
private

double Traced value.

Definition at line 565 of file attribute-test-suite.cc.

Referenced by GetTypeId().

◆ m_enum

Test_e AttributeObjectTest::m_enum
private

Enum.

Definition at line 542 of file attribute-test-suite.cc.

Referenced by GetTypeId().

◆ m_enumclass

Test_ec AttributeObjectTest::m_enumclass
private

Enum class.

Definition at line 544 of file attribute-test-suite.cc.

Referenced by GetTypeId().

◆ m_enumClassSetGet

Test_ec AttributeObjectTest::m_enumClassSetGet
private

Enum class set-get.

Definition at line 545 of file attribute-test-suite.cc.

Referenced by DoGetEnumClass(), and DoSetEnumClass().

◆ m_enumSetGet

Test_e AttributeObjectTest::m_enumSetGet
private

Enum set-get.

Definition at line 543 of file attribute-test-suite.cc.

Referenced by DoGetEnum(), and DoSetEnum().

◆ m_enumSrc

TracedValue<Test_e> AttributeObjectTest::m_enumSrc
private

enum Traced value.

Definition at line 564 of file attribute-test-suite.cc.

Referenced by GetTypeId().

◆ m_float

float AttributeObjectTest::m_float
private

float.

Definition at line 541 of file attribute-test-suite.cc.

Referenced by GetTypeId().

◆ m_int16

int16_t AttributeObjectTest::m_int16
private

16-bit integer.

Definition at line 537 of file attribute-test-suite.cc.

Referenced by GetTypeId().

◆ m_int16SetGet

int16_t AttributeObjectTest::m_int16SetGet
private

16-bit integer set-get.

Definition at line 539 of file attribute-test-suite.cc.

Referenced by DoGetInt16(), and DoSetInt16().

◆ m_int16WithBounds

int16_t AttributeObjectTest::m_int16WithBounds
private

16-bit integer with bounds.

Definition at line 538 of file attribute-test-suite.cc.

Referenced by GetTypeId().

◆ m_intSrc1

TracedValue<int8_t> AttributeObjectTest::m_intSrc1
private

First int8_t Traced value.

Definition at line 553 of file attribute-test-suite.cc.

Referenced by GetTypeId().

◆ m_intSrc2

TracedValue<int8_t> AttributeObjectTest::m_intSrc2
private

Second int8_t Traced value.

Definition at line 554 of file attribute-test-suite.cc.

Referenced by DoGetIntSrc(), and DoSetIntSrc().

◆ m_map1

std::map<uint32_t, Ptr<Derived> > AttributeObjectTest::m_map1
private

Map of uint32_t, derived objects.

Definition at line 549 of file attribute-test-suite.cc.

Referenced by AddToMap1(), and GetTypeId().

◆ m_ptr

Ptr<Derived> AttributeObjectTest::m_ptr
private

Pointer to Derived class.

Definition at line 560 of file attribute-test-suite.cc.

Referenced by GetTypeId().

◆ m_ptrInitialized

Ptr<Derived> AttributeObjectTest::m_ptrInitialized
private

Pointer to Derived class.

Definition at line 561 of file attribute-test-suite.cc.

Referenced by GetTypeId().

◆ m_ptrInitialized2

Ptr<Derived> AttributeObjectTest::m_ptrInitialized2
private

Pointer to Derived class.

Definition at line 562 of file attribute-test-suite.cc.

Referenced by GetTypeId().

◆ m_random

Ptr<RandomVariableStream> AttributeObjectTest::m_random
private

Random number generator.

Definition at line 546 of file attribute-test-suite.cc.

Referenced by GetTypeId().

◆ m_timeWithBounds

Time AttributeObjectTest::m_timeWithBounds
private

Time with bounds.

Definition at line 567 of file attribute-test-suite.cc.

Referenced by GetTypeId().

◆ m_uint8

uint8_t AttributeObjectTest::m_uint8
private

8-bit integer.

Definition at line 540 of file attribute-test-suite.cc.

Referenced by GetTypeId().

◆ m_uintSrc

TracedValue<uint8_t> AttributeObjectTest::m_uintSrc
private

uint8_t Traced value.

Definition at line 563 of file attribute-test-suite.cc.

Referenced by GetTypeId().

◆ m_unorderedMap

std::unordered_map<uint64_t, Ptr<Derived> > AttributeObjectTest::m_unorderedMap
private

Unordered map of uint64_t, derived objects.

Definition at line 551 of file attribute-test-suite.cc.

Referenced by AddToUnorderedMap(), GetTypeId(), and RemoveFromUnorderedMap().

◆ m_valueSrc

TracedValue<ValueClassTest> AttributeObjectTest::m_valueSrc
private

ValueClassTest Traced value.

Definition at line 559 of file attribute-test-suite.cc.

Referenced by GetTypeId().

◆ m_vector1

std::vector<Ptr<Derived> > AttributeObjectTest::m_vector1
private

First vector of derived objects.

Definition at line 547 of file attribute-test-suite.cc.

Referenced by AddToVector1(), and GetTypeId().

◆ m_vector2

std::vector<Ptr<Derived> > AttributeObjectTest::m_vector2
private

Second vector of derived objects.

Definition at line 548 of file attribute-test-suite.cc.

Referenced by AddToVector2(), DoGetVector(), and DoGetVectorN().


The documentation for this class was generated from the following file: