|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
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>
159 template <
typename... Ts>
179 template <
typename... Ts>
180 Ptr<const AttributeChecker>
195 Ptr<const AttributeChecker>
202 template <
typename T1>
205 return MakeAccessorHelper<EnumValue> (a1);
208 template <
typename T1,
typename T2>
211 return MakeAccessorHelper<EnumValue> (a1, a2);
int GetValue(const std::string name) const
Get the enum value by name.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual std::string SerializeToString(Ptr< const AttributeChecker > checker) const
Ptr< const AttributeChecker > MakeEnumChecker(int v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.
void Set(int value)
Set the value.
Hold a value for an Attribute.
virtual std::string GetUnderlyingTypeInformation(void) const
Hold variables of type enum.
int m_value
The stored integer value.
virtual bool Check(const AttributeValue &value) const
bool GetAccessor(T &value) const
Access the Enum value as type T.
Smart pointer class similar to boost::intrusive_ptr.
std::string GetName(int value) const
Get the enum symbol name by value.
virtual bool HasUnderlyingTypeInformation(void) const
void Add(int value, std::string name)
Add a new value.
Represent the type of an attribute.
virtual std::string GetValueTypeName(void) const
virtual bool DeserializeFromString(std::string value, Ptr< const AttributeChecker > checker)
virtual bool Copy(const AttributeValue &src, AttributeValue &dst) const
Copy the source to the destination.
ns3::AttributeValue, ns3::AttributeAccessor and ns3::AttributeChecker declarations.
ns3::MakeAccessorHelper declarations and template implementations.
void AddDefault(int value, std::string name)
Add a default value.
ValueSet m_valueSet
The stored Enum values and symbol names.
std::pair< int, std::string > Value
Type for the pair value, name.
virtual Ptr< AttributeValue > Copy(void) const
AttributeChecker implementation for EnumValue.
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
virtual Ptr< AttributeValue > Create(void) const
std::list< Value > ValueSet
Type of container for storing Enum values and symbol names.