AttributeChecker implementation for EnumValue. More...
#include "enum.h"
Inheritance diagram for ns3::EnumChecker< T >:
Collaboration diagram for ns3::EnumChecker< T >: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. | |
AttributeChecker implementation for EnumValue.
|
private |
|
private |
| ns3::EnumChecker< T >::EnumChecker | ( | ) |
| void ns3::EnumChecker< T >::Add | ( | T | value, |
| std::string | name ) |
Add a new value.
| [in] | value | The value. |
| [in] | name | The enum symbol name. |
Definition at line 267 of file enum.h.
References m_valueSet.
| void ns3::EnumChecker< T >::AddDefault | ( | T | value, |
| std::string | name ) |
Add a default value.
| [in] | value | The value. |
| [in] | name | Then enum symbol name. |
Definition at line 260 of file enum.h.
References m_valueSet.
|
overridevirtual |
| [in] | value | A pointer to the value to check |
Implements ns3::AttributeChecker.
Definition at line 316 of file enum.h.
References Check(), ns3::EnumValue< T >::Get(), and m_valueSet.
Referenced by Check().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Copy the source to the destination.
| [in] | source | Source AttributeValue |
| [out] | destination | Destination AttributeValue |
Implements ns3::AttributeChecker.
Definition at line 367 of file enum.h.
References Copy().
Referenced by Copy().
Here is the call graph for this function:
Here is the caller graph for this function:
|
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(), and Create().
Referenced by Create().
Here is the call graph for this function:
Here is the caller graph for this function:| 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 m_valueSet, and NS_ASSERT_MSG.
|
overridevirtual |
Implements ns3::AttributeChecker.
Definition at line 346 of file enum.h.
References GetUnderlyingTypeInformation(), and m_valueSet.
Referenced by GetUnderlyingTypeInformation().
Here is the call graph for this function:
Here is the caller graph for this function:| 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 m_valueSet, and 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(), and GetValueTypeName().
Referenced by GetValueTypeName().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
If this method returns false, the return value of the GetUnderlyingTypeInformation method cannot be relied upon.
Implements ns3::AttributeChecker.
Definition at line 339 of file enum.h.
References HasUnderlyingTypeInformation().
Referenced by HasUnderlyingTypeInformation().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
The stored Enum values and symbol names.
Definition at line 154 of file enum.h.
Referenced by Add(), AddDefault(), Check(), GetName(), GetUnderlyingTypeInformation(), and GetValue().