61 return ns3::Create<EnumValue> (*this);
69 for (EnumChecker::ValueSet::const_iterator i = p->
m_valueSet.begin (); i != p->
m_valueSet.end (); i++)
77 NS_FATAL_ERROR (
"The user has set an invalid C++ value in this Enum");
87 for (EnumChecker::ValueSet::const_iterator i = p->
m_valueSet.begin (); i != p->
m_valueSet.end (); i++)
89 if (i->second == value)
107 m_valueSet.push_front (std::make_pair (value, name));
113 m_valueSet.push_back (std::make_pair (value, name));
126 if (i->first == p->
Get ())
137 return "ns3::EnumValue";
149 std::ostringstream oss;
165 return ns3::Create<EnumValue> ();
174 if (src == 0 || dst == 0)
185 int v2, std::string n2,
186 int v3, std::string n3,
187 int v4, std::string n4,
188 int v5, std::string n5,
189 int v6, std::string n6,
190 int v7, std::string n7,
191 int v8, std::string n8,
192 int v9, std::string n9,
193 int v10, std::string n10,
194 int v11, std::string n11,
195 int v12, std::string n12,
196 int v13, std::string n13,
197 int v14, std::string n14,
198 int v15, std::string n15,
199 int v16, std::string n16,
200 int v17, std::string n17,
201 int v18, std::string n18,
202 int v19, std::string n19,
203 int v20, std::string n20,
204 int v21, std::string n21,
205 int v22, std::string n22)
207 NS_LOG_FUNCTION (v1 << n1 << v2 << n2 << v3 << n3 << v4 << n4 << v5 << n5 <<
208 v6 << n6 << v7 << n7 << v8 << n8 << v9 << n9 << v10 << n10 <<
209 v11 << n11 << v12 << n12 << v13 << n13 << v14 << n14 <<
210 v15 << n15 << v16 << n16 << v17 << n17 << v18 << n18 <<
211 v19 << n19 << v20 << n20 << v21 << n21 << v22 << n22);
218 checker->
Add (v2, n2);
223 checker->
Add (v3, n3);
228 checker->
Add (v4, n4);
233 checker->
Add (v5, n5);
238 checker->
Add (v6, n6);
243 checker->
Add (v7, n7);
248 checker->
Add (v8, n8);
253 checker->
Add (v9, n9);
258 checker->
Add (v10, n10);
263 checker->
Add (v11, n11);
268 checker->
Add (v12, n12);
273 checker->
Add (v13, n13);
278 checker->
Add (v14, n14);
283 checker->
Add (v15, n15);
288 checker->
Add (v16, n16);
293 checker->
Add (v17, n17);
298 checker->
Add (v18, n18);
303 checker->
Add (v19, n19);
308 checker->
Add (v20, n20);
313 checker->
Add (v21, n21);
318 checker->
Add (v22, n22);
NS_FATAL_x macro definitions.
void AddDefault(int value, std::string name)
Add a default value.
Smart pointer class similar to boost::intrusive_ptr.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
virtual std::string GetUnderlyingTypeInformation(void) const
virtual Ptr< AttributeValue > Create(void) const
Hold a value for an Attribute.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
U * PeekPointer(const Ptr< U > &p)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
virtual bool Copy(const AttributeValue &src, AttributeValue &dst) const
Copy the source to the destination.
void Add(int value, std::string name)
Add a new value.
Hold variables of type enum.
int m_value
The stored integer value.
virtual std::string SerializeToString(Ptr< const AttributeChecker > checker) const
ns3::EnumValue attribute value declarations.
virtual bool DeserializeFromString(std::string value, Ptr< const AttributeChecker > checker)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void Set(int value)
Set the value.
virtual bool Check(const AttributeValue &value) const
AttributeChecker implementation for EnumValue.
Ptr< const AttributeChecker > MakeEnumChecker(int v1, std::string n1, int v2, std::string n2, int v3, std::string n3, int v4, std::string n4, int v5, std::string n5, int v6, std::string n6, int v7, std::string n7, int v8, std::string n8, int v9, std::string n9, int v10, std::string n10, int v11, std::string n11, int v12, std::string n12, int v13, std::string n13, int v14, std::string n14, int v15, std::string n15, int v16, std::string n16, int v17, std::string n17, int v18, std::string n18, int v19, std::string n19, int v20, std::string n20, int v21, std::string n21, int v22, std::string n22)
Make an EnumChecker pre-configured with a set of allowed values by name.
virtual std::string GetValueTypeName(void) const
ValueSet m_valueSet
The stored Enum values and symbol names.
virtual bool HasUnderlyingTypeInformation(void) const
virtual Ptr< AttributeValue > Copy(void) const