A Discrete-Event Network Simulator
API
Attribute Implementation

These are the internal implementation functions for the Attribute system. More...

+ Collaboration diagram for Attribute Implementation:

Files

file  attribute-accessor-helper.h
 ns3::MakeAccessorHelper declarations and template implementations.
 
file  type-name.cc
 ns3::TypeNameGet() function implementations.
 
file  type-name.h
 ns3::TypeNameGet() function declarations.
 

Classes

class  ns3::AccessorHelper< T, U >
 Basic functionality for accessing class attributes via class data members, or get functor/set methods. More...
 
struct  ns3::AccessorTrait< T >
 The non-const and non-reference type equivalent to T. More...
 

Functions

template<typename V , typename T , typename U >
Ptr< const AttributeAccessor > ns3::DoMakeAccessorHelperOne (U T::*memberVariable)
 MakeAccessorHelper implementation for a class data member. More...
 
template<typename V , typename T , typename U >
Ptr< const AttributeAccessor > ns3::DoMakeAccessorHelperOne (U(T::*getter)(void) const)
 MakeAccessorHelper implementation for a class get functor method. More...
 
template<typename V , typename T , typename U >
Ptr< const AttributeAccessor > ns3::DoMakeAccessorHelperOne (void(T::*setter)(U))
 MakeAccessorHelper implementation for a class set method returning void. More...
 
template<typename W , typename T , typename U , typename V >
Ptr< const AttributeAccessor > ns3::DoMakeAccessorHelperTwo (void(T::*setter)(U), V(T::*getter)(void) const)
 MakeAccessorHelper implementation with a class get functor method and a class set method returning void. More...
 
template<typename W , typename T , typename U , typename V >
Ptr< const AttributeAccessor > ns3::DoMakeAccessorHelperTwo (V(T::*getter)(void) const, void(T::*setter)(U))
 MakeAccessorHelper implementation with a class get functor method and a class set method returning void. More...
 
template<typename W , typename T , typename U , typename V >
Ptr< const AttributeAccessor > ns3::DoMakeAccessorHelperTwo (bool(T::*setter)(U), V(T::*getter)(void) const)
 MakeAccessorHelper implementation with a class get functor method and a class set method returning bool. More...
 
template<typename W , typename T , typename U , typename V >
Ptr< const AttributeAccessor > ns3::DoMakeAccessorHelperTwo (V(T::*getter)(void) const, bool(T::*setter)(U))
 MakeAccessorHelper implementation with a class get functor method and a class set method returning bool. More...
 
template<typename V , typename T1 >
Ptr< const AttributeAccessor > ns3::MakeAccessorHelper (T1 a1)
 Create an AttributeAccessor for a class data member, or a lone class get functor or set method. More...
 
template<typename V , typename T1 , typename T2 >
Ptr< const AttributeAccessor > ns3::MakeAccessorHelper (T1 a1, T2 a2)
 Create an AttributeAccessor using a pair of get functor and set methods from a class. More...
 
template<typename T , typename BASE >
Ptr< AttributeChecker > ns3::MakeSimpleAttributeChecker (std::string name, std::string underlying)
 A simple string-based attribute checker. More...
 
template<typename T >
std::string ns3::TypeNameGet (void)
 Type name strings for numeric AttributeValue types. More...
 
template<>
std::string ns3::TypeNameGet< int8_t > (void)
 ns3::TypeNameGet(void) specializaton. More...
 
template<>
std::string ns3::TypeNameGet< int16_t > (void)
 ns3::TypeNameGet(void) specializaton. More...
 
template<>
std::string ns3::TypeNameGet< int32_t > (void)
 ns3::TypeNameGet(void) specializaton. More...
 
template<>
std::string ns3::TypeNameGet< int64_t > (void)
 ns3::TypeNameGet(void) specializaton. More...
 
template<>
std::string ns3::TypeNameGet< uint8_t > (void)
 ns3::TypeNameGet(void) specializaton. More...
 
template<>
std::string ns3::TypeNameGet< uint16_t > (void)
 ns3::TypeNameGet(void) specializaton. More...
 
template<>
std::string ns3::TypeNameGet< uint32_t > (void)
 ns3::TypeNameGet(void) specializaton. More...
 
template<>
std::string ns3::TypeNameGet< uint64_t > (void)
 ns3::TypeNameGet(void) specializaton. More...
 
template<>
std::string ns3::TypeNameGet< float > (void)
 ns3::TypeNameGet(void) specializaton. More...
 
template<>
std::string ns3::TypeNameGet< double > (void)
 ns3::TypeNameGet(void) specializaton. More...
 

Detailed Description

These are the internal implementation functions for the Attribute system.

Module code shouldn't need to call these directly. Instead, see Attribute Helper.

There are three versions of DoMakeAccessorHelperOne:

There are two pairs of DoMakeAccessorHelperTwo (four total):

Function Documentation

template<typename V , typename T , typename U >
Ptr<const AttributeAccessor> ns3::DoMakeAccessorHelperOne ( U T::*  memberVariable)
inline

MakeAccessorHelper implementation for a class data member.

Template Parameters
V[explicit] The specific AttributeValue type to use to represent the Attribute.
T[deduced] The class holding the data member.
U[deduced] The type of the data member.
Parameters
[in]memberVariableThe address of the data member.
Returns
The AttributeAccessor.

Definition at line 255 of file attribute-accessor-helper.h.

template<typename V , typename T , typename U >
Ptr<const AttributeAccessor> ns3::DoMakeAccessorHelperOne ( U(T::*)(void) const  getter)
inline

MakeAccessorHelper implementation for a class get functor method.

Template Parameters
V[explicit] The specific AttributeValue type to use to represent the Attribute.
T[deduced] The class holding the get functor method.
U[deduced] The return type of the get functor method.
Parameters
[in]getterThe address of the class get functor method.
Returns
The AttributeAccessor.

Definition at line 312 of file attribute-accessor-helper.h.

References ns3::AccessorHelper< T, U >::Set().

+ Here is the call graph for this function:

template<typename V , typename T , typename U >
Ptr<const AttributeAccessor> ns3::DoMakeAccessorHelperOne ( void(T::*)(U)  setter)
inline

MakeAccessorHelper implementation for a class set method returning void.

Template Parameters
V[explicit] The specific AttributeValue type to use to represent the Attribute.
T[deduced] The class holding the set method.
U[deduced] The argument type of the set method.
Parameters
[in]setterThe address of the class set method, returning void.
Returns
The AttributeAccessor.

Definition at line 362 of file attribute-accessor-helper.h.

template<typename W , typename T , typename U , typename V >
Ptr<const AttributeAccessor> ns3::DoMakeAccessorHelperTwo ( void(T::*)(U)  setter,
V(T::*)(void) const  getter 
)
inline

MakeAccessorHelper implementation with a class get functor method and a class set method returning void.

The two versions of this function differ only in argument order.

Template Parameters
W[explicit] The specific AttributeValue type to use to represent the Attribute.
T[deduced] The class holding the functor methods.
U[deduced] The argument type of the set method.
V[deduced] The return type of the get functor method.
Parameters
[in]setterThe address of the class set method, returning void.
[in]getterThe address of the class get functor method.
Returns
The AttributeAccessor.

Definition at line 422 of file attribute-accessor-helper.h.

References ns3::AccessorHelper< T, U >::Set().

+ Here is the call graph for this function:

template<typename W , typename T , typename U , typename V >
Ptr<const AttributeAccessor> ns3::DoMakeAccessorHelperTwo ( V(T::*)(void) const  getter,
void(T::*)(U)  setter 
)
inline

MakeAccessorHelper implementation with a class get functor method and a class set method returning void.

The two versions of this function differ only in argument order.

Template Parameters
W[explicit] The specific AttributeValue type to use to represent the Attribute.
T[deduced] The class holding the functor methods.
U[deduced] The argument type of the set method.
V[deduced] The return type of the get functor method.
Parameters
[in]setterThe address of the class set method, returning void.
[in]getterThe address of the class get functor method.
Returns
The AttributeAccessor.

Definition at line 478 of file attribute-accessor-helper.h.

template<typename W , typename T , typename U , typename V >
Ptr<const AttributeAccessor> ns3::DoMakeAccessorHelperTwo ( bool(T::*)(U)  setter,
V(T::*)(void) const  getter 
)
inline

MakeAccessorHelper implementation with a class get functor method and a class set method returning bool.

The two versions of this function differ only in argument order.

Template Parameters
W[explicit] The specific AttributeValue type to use to represent the Attribute.
T[deduced] The class holding the functor methods.
U[deduced] The argument type of the set method.
V[deduced] The return type of the get functor method.
Parameters
[in]setterThe address of the class set method, returning bool.
[in]getterThe address of the class get functor method.
Returns
The AttributeAccessor.

Definition at line 505 of file attribute-accessor-helper.h.

References ns3::AccessorHelper< T, U >::Set().

+ Here is the call graph for this function:

template<typename W , typename T , typename U , typename V >
Ptr<const AttributeAccessor> ns3::DoMakeAccessorHelperTwo ( V(T::*)(void) const  getter,
bool(T::*)(U)  setter 
)
inline

MakeAccessorHelper implementation with a class get functor method and a class set method returning bool.

The two versions of this function differ only in argument order.

Template Parameters
W[explicit] The specific AttributeValue type to use to represent the Attribute.
T[deduced] The class holding the functor methods.
U[deduced] The argument type of the set method.
V[deduced] The return type of the get functor method.
Parameters
[in]setterThe address of the class set method, returning bool.
[in]getterThe address of the class get functor method.
Returns
The AttributeAccessor.

Definition at line 561 of file attribute-accessor-helper.h.

template<typename V , typename T1 >
Ptr< const AttributeAccessor > ns3::MakeAccessorHelper ( T1  a1)
inline

Create an AttributeAccessor for a class data member, or a lone class get functor or set method.

The get functor method should have a signature like

typedef U (T::*getter)(void) const

where T is the class and U is the type of the return value.

The set method should have one of these signatures:

typedef void (T::*setter)(U)
typedef bool (T::*setter)(U)

where T is the class and U is the type of the value to set the attribute to, which should be compatible with the specific AttributeValue type V which holds the value (or the type implied by the name Make<V>Accessor of this function.) In the case of a setter returning bool, the return value should be true if the value could be set successfully.

Template Parameters
V[explicit] (If present) The specific AttributeValue type to use to represent the Attribute. (If not present, the type V is implicit in the name of this function, as "Make<V>Accessor"
T1[deduced] The type of the class data member, or the type of the class get functor or set method.
Parameters
[in]a1The address of the data member, or the get or set method.
Returns
The AttributeAccessor

Definition at line 571 of file attribute-accessor-helper.h.

template<typename V , typename T1 , typename T2 >
Ptr< const AttributeAccessor > ns3::MakeAccessorHelper ( T1  a1,
T2  a2 
)
inline

Create an AttributeAccessor using a pair of get functor and set methods from a class.

The get functor method should have a signature like

typedef U (T::*getter)(void) const

where T is the class and U is the type of the return value.

The set method should have one of these signatures:

typedef void (T::*setter)(U)
typedef bool (T::*setter)(U)

where T is the class and U is the type of the value to set the attribute to, which should be compatible with the specific AttributeValue type V which holds the value (or the type implied by the name Make<V>Accessor of this function.) In the case of a setter returning bool, the return value should be true if the value could be set successfully.

In practice the setter and getter arguments can appear in either order, but setter first is preferred.

Template Parameters
V[explicit] (If present) The specific AttributeValue type to use to represent the Attribute. (If not present, the type V is implicit in the name of this function as "Make<V>Accessor"
T1[deduced] The type of the class data member, or the type of the class get functor or set method.
T2[deduced] The type of the getter class functor method.
Parameters
[in]a2The address of the class method to set the attribute.
[in]a1The address of the data member, or the get or set method.
Returns
The AttributeAccessor

Definition at line 579 of file attribute-accessor-helper.h.

template<typename T , typename BASE >
Ptr<AttributeChecker> ns3::MakeSimpleAttributeChecker ( std::string  name,
std::string  underlying 
)

A simple string-based attribute checker.

Template Parameters
T[explicit] The specific AttributeValue type used to represent the Attribute.
BASE[explicit] The AttributeChecker type corresponding to T.
Parameters
[in]nameThe name of the AttributeValue type, essentially the string form of T.
[in]underlyingUnderlying type name.
Returns
Ptr to AttributeChecker.

String-based AttributeChecker implementation.

Definition at line 98 of file attribute-helper.h.

References ns3::Copy(), and ns3::Create().

+ Here is the call graph for this function:

template<typename T >
std::string ns3::TypeNameGet ( void  )

Type name strings for numeric AttributeValue types.

Template Parameters
T[explicit] The numeric type.
Returns
The numeric type name as a string.

Definition at line 42 of file type-name.h.

template<>
std::string ns3::TypeNameGet< double > ( void  )

ns3::TypeNameGet(void) specializaton.

Returns
The numeric type name as a string.

Definition at line 39 of file type-name.cc.

template<>
std::string ns3::TypeNameGet< float > ( void  )

ns3::TypeNameGet(void) specializaton.

Returns
The numeric type name as a string.

Definition at line 38 of file type-name.cc.

template<>
std::string ns3::TypeNameGet< int16_t > ( void  )

ns3::TypeNameGet(void) specializaton.

Returns
The numeric type name as a string.

Definition at line 31 of file type-name.cc.

template<>
std::string ns3::TypeNameGet< int32_t > ( void  )

ns3::TypeNameGet(void) specializaton.

Returns
The numeric type name as a string.

Definition at line 32 of file type-name.cc.

template<>
std::string ns3::TypeNameGet< int64_t > ( void  )

ns3::TypeNameGet(void) specializaton.

Returns
The numeric type name as a string.

Definition at line 33 of file type-name.cc.

template<>
std::string ns3::TypeNameGet< int8_t > ( void  )

ns3::TypeNameGet(void) specializaton.

Returns
The numeric type name as a string.

Definition at line 30 of file type-name.cc.

template<>
std::string ns3::TypeNameGet< uint16_t > ( void  )

ns3::TypeNameGet(void) specializaton.

Returns
The numeric type name as a string.

Definition at line 35 of file type-name.cc.

template<>
std::string ns3::TypeNameGet< uint32_t > ( void  )

ns3::TypeNameGet(void) specializaton.

Returns
The numeric type name as a string.

Definition at line 36 of file type-name.cc.

template<>
std::string ns3::TypeNameGet< uint64_t > ( void  )

ns3::TypeNameGet(void) specializaton.

Returns
The numeric type name as a string.

Definition at line 37 of file type-name.cc.

template<>
std::string ns3::TypeNameGet< uint8_t > ( void  )

ns3::TypeNameGet(void) specializaton.

Returns
The numeric type name as a string.

Definition at line 34 of file type-name.cc.