A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Attribute Helper

Macros

#define ATTRIBUTE_ACCESSOR_DEFINE(type)
 
#define ATTRIBUTE_CHECKER_DEFINE(type)
 
#define ATTRIBUTE_CHECKER_IMPLEMENT(type)
 
#define ATTRIBUTE_CONVERTER_DEFINE(type)
 
#define ATTRIBUTE_HELPER_CPP(type)
 
#define ATTRIBUTE_HELPER_HEADER(type)
 
#define ATTRIBUTE_VALUE_DEFINE(type)   ATTRIBUTE_VALUE_DEFINE_WITH_NAME (type,type)
 
#define ATTRIBUTE_VALUE_IMPLEMENT(type)   ATTRIBUTE_VALUE_IMPLEMENT_WITH_NAME (type,type)
 

Functions

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

Detailed Description

All these macros can be used to generate automatically the code for subclasses of AttributeValue, AttributeAccessor, and, AttributeChecker, which can be used to give attribute powers to a normal class. i.e., the user class can then effectively be made an attribute.

There are two kinds of helper macros: 1) The simple macros. 2) The more complex macros.

The simple macros are implemented in terms of the complex macros and should generally be preferred over the complex macros:

Macro Definition Documentation

#define ATTRIBUTE_ACCESSOR_DEFINE (   type)
Value:
template <typename T1> \
Ptr<const AttributeAccessor> Make ## type ## Accessor (T1 a1) \
{ \
return MakeAccessorHelper<type ## Value> (a1); \
} \
template <typename T1, typename T2> \
Ptr<const AttributeAccessor> Make ## type ## Accessor (T1 a1, T2 a2) \
{ \
return MakeAccessorHelper<type ## Value> (a1, a2); \
}
Parameters
typethe name of the class

This macro defines and generates the code for the implementation of the MakeXXXAccessor template functions. This macro is typically invoked in a class header to allow users of this class to view and use the template functions defined here. This macro is implemented through the helper templates functions ns3::MakeAccessorHelper<>.

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

#define ATTRIBUTE_CHECKER_DEFINE (   type)
Value:
class type ## Checker : public AttributeChecker {}; \
Ptr<const AttributeChecker> Make ## type ## Checker (void); \
Parameters
typethe name of the class

This macro defines the XXXChecker class and the associated MakeXXXChecker function. Typically invoked from xxx.h.

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

#define ATTRIBUTE_CHECKER_IMPLEMENT (   type)
Value:
Ptr<const AttributeChecker> Make ## type ## Checker (void) \
{ \
return MakeSimpleAttributeChecker<type ## Value,type ## Checker> (# type "Value", # type); \
} \
Parameters
typethe name of the class

This macro implements the MakeXXXChecker function. Typically invoked from xxx.cc.

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

#define ATTRIBUTE_CONVERTER_DEFINE (   type)
Parameters
typethe name of the class

This macro defines the conversion operators for class XXX to and from instances of type Attribute. Typically invoked from xxx.h.

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

#define ATTRIBUTE_HELPER_CPP (   type)
Value:
#define ATTRIBUTE_VALUE_IMPLEMENT(type)
#define ATTRIBUTE_CHECKER_IMPLEMENT(type)
Parameters
typethe name of the class

This macro should be invoked from the class implementation file.

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

#define ATTRIBUTE_HELPER_HEADER (   type)
Value:
#define ATTRIBUTE_CHECKER_DEFINE(type)
#define ATTRIBUTE_VALUE_DEFINE(type)
#define ATTRIBUTE_ACCESSOR_DEFINE(type)
Parameters
typethe name of the class

This macro should be invoked outside of the class declaration in its public header.

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

#define ATTRIBUTE_VALUE_DEFINE (   type)    ATTRIBUTE_VALUE_DEFINE_WITH_NAME (type,type)
Parameters
typethe name of the class.

This macro defines the class XXXValue associated to class XXX. This macro is typically invoked in a class header.

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

#define ATTRIBUTE_VALUE_IMPLEMENT (   type)    ATTRIBUTE_VALUE_IMPLEMENT_WITH_NAME (type,type)
Parameters
typethe name of the class.

This macro implements the XXXValue class (including the XXXValue::SerializeToString and XXXValue::DeserializeFromString methods). Typically invoked from xxx.cc.

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