#include "enum.h"
Public Member Functions | |
EnumChecker () | |
void | Add (T value, std::string name) |
Add a new value. | |
void | AddDefault (T value, std::string name) |
Add a default value. | |
bool | Check (const AttributeValue &value) const override |
bool | Copy (const AttributeValue &src, AttributeValue &dst) const override |
Copy the source to the destination. | |
Ptr< AttributeValue > | Create () const override |
std::string | GetName (T value) const |
Get the enum symbol name by value. | |
std::string | GetUnderlyingTypeInformation () const override |
T | GetValue (const std::string name) const |
Get the enum value by name. | |
std::string | GetValueTypeName () const override |
bool | HasUnderlyingTypeInformation () const override |
Public Member Functions inherited from ns3::AttributeChecker | |
AttributeChecker () | |
virtual | ~AttributeChecker () |
Ptr< AttributeValue > | CreateValidValue (const AttributeValue &value) const |
Create a valid value from the argument value, or reinterpret the argument as a string. | |
Public Member Functions inherited from ns3::SimpleRefCount< AttributeChecker > | |
SimpleRefCount () | |
Default constructor. | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. | |
void | Ref () const |
Increment the reference count. | |
void | Unref () const |
Decrement the reference count. | |
Private Types | |
using | Value = std::pair<T, std::string> |
Type for the pair value, name. | |
using | ValueSet = std::list<Value> |
Type of container for storing Enum values and symbol names. | |
Private Attributes | |
ValueSet | m_valueSet |
The stored Enum values and symbol names. | |
|
private |
|
private |
ns3::EnumChecker< T >::EnumChecker | ( | ) |
void ns3::EnumChecker< T >::Add | ( | T | value, |
std::string | name ) |
void ns3::EnumChecker< T >::AddDefault | ( | T | value, |
std::string | name ) |
|
overridevirtual |
[in] | value | A pointer to the value to check |
Implements ns3::AttributeChecker.
Definition at line 316 of file enum.h.
References ns3::EnumValue< T >::Get().
|
overridevirtual |
Copy the source to the destination.
[in] | source | Source AttributeValue |
[out] | destination | Destination AttributeValue |
Implements ns3::AttributeChecker.
|
overridevirtual |
This method is typically used to create a temporary variable prior to calling Attribute::DeserializeFromString.
Implements ns3::AttributeChecker.
Definition at line 360 of file enum.h.
References ns3::Create().
std::string ns3::EnumChecker< T >::GetName | ( | T | value | ) | const |
Get the enum symbol name by value.
[in] | value | The value. |
Definition at line 274 of file enum.h.
References NS_ASSERT_MSG.
|
overridevirtual |
Implements ns3::AttributeChecker.
T ns3::EnumChecker< T >::GetValue | ( | const std::string | name | ) | const |
Get the enum value by name.
[in] | name | Then enum symbol name. |
Definition at line 288 of file enum.h.
References NS_ASSERT_MSG.
|
overridevirtual |
A typical return value here is FooValue where Foo is the name of the type being wrapped.
Implements ns3::AttributeChecker.
Definition at line 332 of file enum.h.
References ns3::Demangle().
|
overridevirtual |
If this method returns false, the return value of the GetUnderlyingTypeInformation method cannot be relied upon.
Implements ns3::AttributeChecker.
|
private |