Contains the DtDEC_ATTRIBUTE macros.
More...
Go to the source code of this file.
Macros |
| #define | DtDEC_ATTRIBUTE(T, N, n) |
| | A Macro to define an attribute; as well as make an accessor and mutator for that attribute.
|
| #define | DtDEC_ATTRIBUTE_OVERLOAD(Type, Name, name, Attribute) |
| | A Macro to define an overload accessor and mutator for an existing attribute.
|
Detailed Description
Contains the DtDEC_ATTRIBUTE macros.
Macro Definition Documentation
| #define DtDEC_ATTRIBUTE |
( |
|
T, |
|
|
|
N, |
|
|
|
n |
|
) |
| |
Value:public : \
void set##N(const T& val) { my##N = val;}\
const T& n() const { return my##N;} \
T& n() { return my##N;} \
protected: \
T my##N;
A Macro to define an attribute; as well as make an accessor and mutator for that attribute.
- Note
- All class members following this macro are set to protected.
- Example
Is equivalent to:
- Example
public:
void setIndex( const int& value )
{
myIndex = value;
}
const int& index() const
{
return myIndex;
}
int& index()
{
return myIndex;
}
protected:
int myIndex;
| #define DtDEC_ATTRIBUTE_OVERLOAD |
( |
|
Type, |
|
|
|
Name, |
|
|
|
name, |
|
|
|
Attribute |
|
) |
| |
Value:public : \
void set##Name( const Type& value ) \
{ \
my##Attribute = value; \
} \
const Type& name() const \
{ \
return my##Attribute; \
} \
Type& name() \
{ \
return my##Attribute; \
} \
protected: \
enum{}
A Macro to define an overload accessor and mutator for an existing attribute.
- Note
- Do not use the overloaded attribute /e name for calculations of message encoding, decoding, or size.
-
All class members following this macro are set to protected.
- Example
Is equivalent to:
- Example
public:
void setElement( const int& value )
{
myIndex = value;
}
const int& element() const
{
return myIndex;
}
int& element()
{
return myIndex;
}
protected: