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. More...
Modules | |
Attribute Implementation | |
These are the internal implementation functions for the Attribute system. | |
Files | |
file | attribute-helper.h |
Attribute helper (ATTRIBUTE_ )macros definition. | |
Macros | |
#define | ATTRIBUTE_ACCESSOR_DEFINE(type) |
Define the attribute accessor functions MakeTypeAccessor for class type. More... | |
#define | ATTRIBUTE_CHECKER_DEFINE(type) |
Declare the AttributeChecker class typeChecker and the MaketypeChecker function for class type. More... | |
#define | ATTRIBUTE_CHECKER_IMPLEMENT(type) |
Define the MaketypeChecker function for class type. More... | |
#define | ATTRIBUTE_CHECKER_IMPLEMENT_WITH_NAME(type, name) |
Define the MaketypeChecker function for class type. More... | |
#define | ATTRIBUTE_CONVERTER_DEFINE(type) |
Define the conversion operators class type and Attribute instances. More... | |
#define | ATTRIBUTE_HELPER_CPP(type) |
Define the attribute value, accessor and checkers for class type More... | |
#define | ATTRIBUTE_HELPER_HEADER(type) |
Declare the attribute value, accessor and checkers for class type More... | |
#define | ATTRIBUTE_VALUE_DEFINE(name) ATTRIBUTE_VALUE_DEFINE_WITH_NAME(name, name) |
Declare the attribute value class nameValue for the class name More... | |
#define | ATTRIBUTE_VALUE_DEFINE_WITH_NAME(type, name) |
Declare the attribute value class nameValue for underlying class type. More... | |
#define | ATTRIBUTE_VALUE_IMPLEMENT(type) ATTRIBUTE_VALUE_IMPLEMENT_WITH_NAME(type, type) |
Define the class methods belonging to attribute value class typeValue for class type. More... | |
#define | ATTRIBUTE_VALUE_IMPLEMENT_WITH_NAME(type, name) |
Define the class methods belonging to the attribute value class nameValue of the underlying class type. More... | |
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:
The simple macros are implemented in terms of the complex macros and should generally be preferred over the complex macros.
#define ATTRIBUTE_ACCESSOR_DEFINE | ( | type | ) |
Define the attribute accessor functions MakeTypeAccessor
for class type.
[in] | type | The name of the class |
This macro defines and generates the code for the implementation of the MakeTypeAccessor
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 174 of file attribute-helper.h.
#define ATTRIBUTE_CHECKER_DEFINE | ( | type | ) |
Declare the AttributeChecker class typeChecker and the MaketypeChecker
function for class type.
[in] | type | The name of the class |
This macro declares the typeChecker class and the associated MaketypeChecker
function.
(Note that the typeChecker class needs no implementation since it just inherits all its implementation from AttributeChecker.)
Typically invoked in the class header file.
Definition at line 272 of file attribute-helper.h.
#define ATTRIBUTE_CHECKER_IMPLEMENT | ( | type | ) |
Define the MaketypeChecker
function for class type.
[in] | type | The name of the class |
This macro implements the MaketypeChecker
function.
Typically invoked in the source file..
Definition at line 361 of file attribute-helper.h.
#define ATTRIBUTE_CHECKER_IMPLEMENT_WITH_NAME | ( | type, | |
name | |||
) |
Define the MaketypeChecker
function for class type.
[in] | type | The name of the class. |
[in] | name | The string name of the underlying type. |
This macro implements the MaketypeChecker
function for class type.
Typically invoked in the source file..
Definition at line 380 of file attribute-helper.h.
#define ATTRIBUTE_CONVERTER_DEFINE | ( | type | ) |
Define the conversion operators class type and Attribute instances.
[in] | type | The name of the class |
This macro defines the conversion operators for class type
to and from instances of typeAttribute
. Typically invoked in the class header file.
Definition at line 254 of file attribute-helper.h.
#define ATTRIBUTE_HELPER_CPP | ( | type | ) |
Define the attribute value, accessor and checkers for class type
[in] | type | The name of the class |
This macro implements
MaketypeChecker
function,for class type.
This macro should be invoked from the class implementation file.
Definition at line 429 of file attribute-helper.h.
#define ATTRIBUTE_HELPER_HEADER | ( | type | ) |
Declare the attribute value, accessor and checkers for class type
[in] | type | The name of the class |
This macro declares:
MaketypeAccessor
,MaketypeChecker
function,for class type.
This macro should be invoked outside of the class declaration in its public header.
Definition at line 407 of file attribute-helper.h.
#define ATTRIBUTE_VALUE_DEFINE | ( | name | ) | ATTRIBUTE_VALUE_DEFINE_WITH_NAME(name, name) |
Declare the attribute value class nameValue for the class name
[in] | name | The name of the class. |
This macro declares the class nameValue
associated to class name
. This macro is typically invoked in the class header file.
Definition at line 237 of file attribute-helper.h.
#define ATTRIBUTE_VALUE_DEFINE_WITH_NAME | ( | type, | |
name | |||
) |
Declare the attribute value class nameValue for underlying class type.
[in] | type | The underlying type name token |
[in] | name | The token to use in defining the accessor name. |
This macro declares the class typeValue
associated with class type
. This macro is typically invoked in the class header file.
This can be used directly for things like plain old data, such as std::string
, to create the attribute value class StringValue, as in ATTRIBUTE_VALUE_DEFINE_WITH_NAME(std::string, String);
Definition at line 203 of file attribute-helper.h.
#define ATTRIBUTE_VALUE_IMPLEMENT | ( | type | ) | ATTRIBUTE_VALUE_IMPLEMENT_WITH_NAME(type, type) |
Define the class methods belonging to attribute value class typeValue for class type.
[in] | type | The name of the class. |
This macro implements the typeValue class methods (including the typeValue%::SerializeToString and typeValue%::DeserializeFromString methods).
Typically invoked in the source file.
Definition at line 348 of file attribute-helper.h.
#define ATTRIBUTE_VALUE_IMPLEMENT_WITH_NAME | ( | type, | |
name | |||
) |
Define the class methods belonging to the attribute value class nameValue of the underlying class type.
[in] | type | The underlying type name |
[in] | name | The token to use in defining the accessor name. |
This macro implements the typeValue class methods (including the typeValue%::SerializeToString and typeValue%::DeserializeFromString methods).
Typically invoked in the source file
Definition at line 294 of file attribute-helper.h.