101 void Add (
int value, std::string name);
108 std::string
GetName (
int value)
const;
115 int GetValue (
const std::string name)
const;
127 typedef std::pair<int,std::string>
Value;
134 template <
typename T1>
137 template <
typename T1,
typename T2>
160 template <
typename... Ts>
165 checker->AddDefault (v, n);
181 template <
typename... Ts>
182 Ptr<const AttributeChecker>
197 Ptr<const AttributeChecker>
204 template <
typename T1>
207 return MakeAccessorHelper<EnumValue> (a1);
210 template <
typename T1,
typename T2>
213 return MakeAccessorHelper<EnumValue> (a1, a2);
ns3::MakeAccessorHelper declarations and template implementations.
ns3::AttributeValue, ns3::AttributeAccessor and ns3::AttributeChecker declarations.
Represent the type of an attribute.
Hold a value for an Attribute.
AttributeChecker implementation for EnumValue.
virtual bool Copy(const AttributeValue &src, AttributeValue &dst) const
Copy the source to the destination.
virtual Ptr< AttributeValue > Create(void) const
void Add(int value, std::string name)
Add a new value.
virtual bool Check(const AttributeValue &value) const
ValueSet m_valueSet
The stored Enum values and symbol names.
int GetValue(const std::string name) const
Get the enum value by name.
virtual std::string GetUnderlyingTypeInformation(void) const
std::pair< int, std::string > Value
Type for the pair value, name.
std::string GetName(int value) const
Get the enum symbol name by value.
virtual std::string GetValueTypeName(void) const
void AddDefault(int value, std::string name)
Add a default value.
std::list< Value > ValueSet
Type of container for storing Enum values and symbol names.
virtual bool HasUnderlyingTypeInformation(void) const
Hold variables of type enum.
bool GetAccessor(T &value) const
Access the Enum value as type T.
void Set(int value)
Set the value.
virtual std::string SerializeToString(Ptr< const AttributeChecker > checker) const
virtual bool DeserializeFromString(std::string value, Ptr< const AttributeChecker > checker)
int m_value
The stored integer value.
virtual Ptr< AttributeValue > Copy(void) const
Smart pointer class similar to boost::intrusive_ptr.
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeEnumChecker(int v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.