allow setting and getting the value of an attribute. More...
#include "attribute.h"
Public Member Functions | |
AttributeAccessor () | |
virtual | ~AttributeAccessor () |
virtual bool | Get (const ObjectBase *object, AttributeValue &attribute) const =0 |
virtual bool | HasGetter () const =0 |
virtual bool | HasSetter () const =0 |
virtual bool | Set (ObjectBase *object, const AttributeValue &value) const =0 |
Public Member Functions inherited from ns3::SimpleRefCount< AttributeAccessor > | |
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... | |
allow setting and getting the value of an attribute.
The goal of this class is to hide from the user how an attribute is actually set or get to or from a class instance. Implementations of this base class are usually provided through the MakeAccessorHelper template functions, hidden behind an ATTRIBUTE_HELPER_* macro.
Definition at line 115 of file attribute.h.
ns3::AttributeAccessor::AttributeAccessor | ( | ) |
Definition at line 47 of file attribute.cc.
|
virtual |
Definition at line 51 of file attribute.cc.
|
pure virtual |
[in,out] | object | The object instance to get the value from |
[out] | attribute | A pointer to where the value should be set. |
This method expects that the caller has checked that the input value is valid with AttributeChecker::Check.
Implemented in ns3::ObjectPtrContainerAccessor, ns3::AccessorHelper< T, U >, and ns3::EmptyAttributeAccessor.
|
pure virtual |
Implemented in ns3::ObjectPtrContainerAccessor, and ns3::EmptyAttributeAccessor.
|
pure virtual |
Implemented in ns3::ObjectPtrContainerAccessor, and ns3::EmptyAttributeAccessor.
|
pure virtual |
[in,out] | object | The object instance to set the value in |
[in] | value | The value to set |
This method expects that the caller has checked that the input value is valid with AttributeChecker::Check.
Implemented in ns3::ObjectPtrContainerAccessor, ns3::EmptyAttributeAccessor, and ns3::AccessorHelper< T, U >.