Hold a value for an Attribute. More...
#include <attribute.h>
Public Member Functions | |
virtual Ptr< AttributeValue > | Copy (void) const =0 |
virtual std::string | SerializeToString (Ptr< const AttributeChecker > checker) const =0 |
virtual bool | DeserializeFromString (std::string value, Ptr< const AttributeChecker > checker)=0 |
Hold a value for an Attribute.
Instances of this class should always be wrapped into an Attribute object. Most subclasses of this base class are implemented by the ATTRIBUTE_HELPER_* macros.
virtual Ptr<AttributeValue> ns3::AttributeValue::Copy | ( | void | ) | const [pure virtual] |
Implemented in ns3::EmptyAttributeValue, ns3::BooleanValue, ns3::DoubleValue, ns3::EnumValue, ns3::IntegerValue, ns3::ObjectVectorValue, ns3::PointerValue, ns3::RandomVariableValue, ns3::StringValue, ns3::UintegerValue, and ns3::TimeValue.
virtual bool ns3::AttributeValue::DeserializeFromString | ( | std::string | value, | |
Ptr< const AttributeChecker > | checker | |||
) | [pure virtual] |
value | a string representation of the value | |
checker | a pointer to the checker associated to the attribute. |
Upon return of this function, this AttributeValue instance contains the deserialized value. In most cases, this method will not make any use of the checker argument. However, in a very limited set of cases, the checker argument is needed to perform proper serialization. A nice example of code which needs it is the EnumValue::SerializeToString code.
Implemented in ns3::EmptyAttributeValue, ns3::BooleanValue, ns3::DoubleValue, ns3::EnumValue, ns3::IntegerValue, ns3::ObjectVectorValue, ns3::PointerValue, ns3::RandomVariableValue, ns3::StringValue, ns3::UintegerValue, and ns3::TimeValue.
virtual std::string ns3::AttributeValue::SerializeToString | ( | Ptr< const AttributeChecker > | checker | ) | const [pure virtual] |
checker | the checker associated to the attribute |
In most cases, this method will not make any use of the checker argument. However, in a very limited set of cases, the checker argument is needed to perform proper serialization. A nice example of code which needs it is the EnumValue::SerializeToString code.
Implemented in ns3::EmptyAttributeValue, ns3::BooleanValue, ns3::DoubleValue, ns3::EnumValue, ns3::IntegerValue, ns3::ObjectVectorValue, ns3::PointerValue, ns3::RandomVariableValue, ns3::StringValue, ns3::UintegerValue, and ns3::TimeValue.