Hold variables of type enum
.
More...
#include "enum.h"
template<typename T>
class ns3::EnumValue< T >
Hold variables of type enum
.
AttributeValue implementation for Enum.
This class can be used to hold variables of any kind of enum.
This is often used with ObjectFactory and Config to bind the value of a particular enum to an Attribute or Config name. For example,
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Hold variables of type enum.
Smart pointer class similar to boost::intrusive_ptr.
@ NO_SPLIT_HORIZON
No Split Horizon.
void SetDefault(std::string name, const AttributeValue &value)
- See also
- AttributeValue
Definition at line 61 of file enum.h.
◆ EnumValue() [1/2]
◆ EnumValue() [2/2]
Constructor.
- Parameters
-
[in] | value | The Enum value to use. |
Definition at line 83 of file enum.h.
◆ Copy()
◆ DeserializeFromString()
- Parameters
-
[in] | value | A string representation of the value |
[in] | checker | A pointer to the checker associated to the attribute. |
- Returns
- true if the input string was correctly-formatted and could be successfully deserialized, false otherwise.
Upon return of this function, this AttributeValue instance contains the deserialized value. In most cases, this method will not make any use of the checker argument. However, in a very limited set of cases, the checker argument is needed to perform proper serialization. A nice example of code which needs it is the EnumValue::SerializeToString code.
Implements ns3::AttributeValue.
Definition at line 255 of file enum.h.
References NS_ASSERT, and ns3::PeekPointer().
◆ Get()
◆ GetAccessor()
Access the Enum value as type T
.
- Template Parameters
-
T | [explicit] The type to cast to. |
- Parameters
-
[out] | value | The Enum value, as type T . |
- Returns
- true.
Definition at line 104 of file enum.h.
◆ SerializeToString()
- Parameters
-
[in] | checker | The checker associated to the attribute |
- Returns
- A string representation of this value.
In most cases, this method will not make any use of the checker argument. However, in a very limited set of cases, the checker argument is needed to perform proper serialization. A nice example of code which needs it is the EnumValue::SerializeToString code.
Implements ns3::AttributeValue.
Definition at line 245 of file enum.h.
References NS_ASSERT, and ns3::PeekPointer().
◆ Set()
Set the value.
- Parameters
-
[in] | value | The value to adopt. |
Definition at line 90 of file enum.h.
◆ m_value
The stored value.
The stored Enum instance.
Definition at line 76 of file enum.h.
The documentation for this class was generated from the following files: