Represent the type of an attribute. More...
#include "attribute.h"
Public Member Functions | |
AttributeChecker () | |
virtual | ~AttributeChecker () |
virtual bool | Check (const AttributeValue &value) const =0 |
virtual bool | Copy (const AttributeValue &source, AttributeValue &destination) const =0 |
Copy the source to the destination. More... | |
virtual Ptr< AttributeValue > | Create () const =0 |
Ptr< AttributeValue > | CreateValidValue (const AttributeValue &value) const |
Create a valid value from the argument value, or reinterpret the argument as a string. More... | |
virtual std::string | GetUnderlyingTypeInformation () const =0 |
virtual std::string | GetValueTypeName () const =0 |
virtual bool | HasUnderlyingTypeInformation () const =0 |
Public Member Functions inherited from ns3::SimpleRefCount< AttributeChecker > | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o[[maybe_unused]]) |
Assignment operator. More... | |
void | Ref () const |
Increment the reference count. More... | |
void | Unref () const |
Decrement the reference count. More... | |
Represent the type of an attribute.
Each type of attribute has an associated unique AttributeChecker subclass. The type of the subclass can be safely used by users to infer the type of the associated attribute. i.e., we expect binding authors to use the checker associated to an attribute to detect the type of the associated attribute.
Most subclasses of this base class are implemented by the ATTRIBUTE_HELPER_HEADER and ATTRIBUTE_HELPER_CPP macros.
Definition at line 167 of file attribute.h.
ns3::AttributeChecker::AttributeChecker | ( | ) |
Definition at line 55 of file attribute.cc.
|
virtual |
Definition at line 59 of file attribute.cc.
|
pure virtual |
[in] | value | A pointer to the value to check |
Implemented in ns3::internal::TupleChecker< Args >, ns3::internal::ObjectPtrContainerChecker< T >, ns3::EnumChecker< T >, ns3::EmptyAttributeChecker, and ns3::internal::PointerChecker< T >.
Referenced by CreateValidValue().
|
pure virtual |
Copy the source to the destination.
[in] | source | Source AttributeValue |
[out] | destination | Destination AttributeValue |
Implemented in ns3::EnumChecker< T >, ns3::internal::TupleChecker< Args >, ns3::internal::PointerChecker< T >, ns3::internal::ObjectPtrContainerChecker< T >, and ns3::EmptyAttributeChecker.
|
pure virtual |
This method is typically used to create a temporary variable prior to calling Attribute::DeserializeFromString.
Implemented in ns3::internal::TupleChecker< Args >, ns3::internal::PointerChecker< T >, ns3::internal::ObjectPtrContainerChecker< T >, ns3::EnumChecker< T >, and ns3::EmptyAttributeChecker.
Referenced by CreateValidValue().
Ptr< AttributeValue > ns3::AttributeChecker::CreateValidValue | ( | const AttributeValue & | value | ) | const |
Create a valid value from the argument value, or reinterpret the argument as a string.
[in] | value | The AttributeValue to check |
Definition at line 64 of file attribute.cc.
References Check(), Create(), and NS_LOG_FUNCTION.
|
pure virtual |
Implemented in ns3::internal::TupleChecker< Args >, ns3::internal::PointerChecker< T >, ns3::internal::ObjectPtrContainerChecker< T >, ns3::EnumChecker< T >, and ns3::EmptyAttributeChecker.
|
pure virtual |
A typical return value here is FooValue where Foo is the name of the type being wrapped.
Implemented in ns3::internal::TupleChecker< Args >, ns3::internal::PointerChecker< T >, ns3::internal::ObjectPtrContainerChecker< T >, ns3::EnumChecker< T >, and ns3::EmptyAttributeChecker.
|
pure virtual |
If this method returns false, the return value of the GetUnderlyingTypeInformation method cannot be relied upon.
Implemented in ns3::internal::TupleChecker< Args >, ns3::internal::PointerChecker< T >, ns3::internal::ObjectPtrContainerChecker< T >, ns3::EnumChecker< T >, and ns3::EmptyAttributeChecker.