Basic functionality for accessing class attributes via class data members, or get functor/set methods. More...
#include "attribute-accessor-helper.h"
Public Member Functions | |
AccessorHelper () | |
Constructor. More... | |
bool | Get (const ObjectBase *object, AttributeValue &val) const override |
Get the value of the underlying member into the AttributeValue. More... | |
bool | Set (ObjectBase *object, const AttributeValue &val) const override |
Set the underlying member to the argument AttributeValue. More... | |
Public Member Functions inherited from ns3::AttributeAccessor | |
AttributeAccessor () | |
virtual | ~AttributeAccessor () |
virtual bool | HasGetter () const =0 |
virtual bool | HasSetter () 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... | |
Private Member Functions | |
virtual bool | DoGet (const T *object, U *v) const =0 |
Getter implementation. More... | |
virtual bool | DoSet (T *object, const U *v) const =0 |
Setter implementation. More... | |
Basic functionality for accessing class attributes via class data members, or get functor/set methods.
T | [explicit] Class of object holding the attribute. |
U | [explicit] AttributeValue type for the underlying class member which is an attribute. |
Definition at line 150 of file attribute-accessor-helper.h.
|
inline |
Constructor.
Definition at line 154 of file attribute-accessor-helper.h.
|
privatepure virtual |
Getter implementation.
[out] | object | The parent object holding the attribute. |
[out] | v | The specific AttributeValue to set. |
Referenced by ns3::AccessorHelper< T, U >::Get().
|
privatepure virtual |
Setter implementation.
[in] | object | The parent object holding the attribute. |
[in] | v | The specific AttributeValue to set. |
Referenced by ns3::AccessorHelper< T, U >::Set().
|
inlineoverridevirtual |
Get the value of the underlying member into the AttributeValue.
Handle dynamic casting from generic ObjectBase and AttributeValue up to desired object class and specific AttributeValue.
Forwards to DoGet method.
[out] | object | Generic object pointer, to upcast to T. |
[out] | val | Generic AttributeValue, to upcast to U. |
Implements ns3::AttributeAccessor.
Definition at line 197 of file attribute-accessor-helper.h.
References ns3::AccessorHelper< T, U >::DoGet().
|
inlineoverridevirtual |
Set the underlying member to the argument AttributeValue.
Handle dynamic casting from generic ObjectBase and AttributeValue up to desired object class and specific AttributeValue.
Forwards to DoSet method.
[in] | object | Generic object pointer, to upcast to T. |
[in] | val | Generic AttributeValue, to upcast to U. |
Implements ns3::AttributeAccessor.
Definition at line 170 of file attribute-accessor-helper.h.
References ns3::AccessorHelper< T, U >::DoSet().
Referenced by ns3::DoMakeAccessorHelperOne(), and ns3::DoMakeAccessorHelperTwo().