A Discrete-Event Network Simulator
API
ns3::ObjectPtrContainerAccessor Class Referenceabstract

AttributeAccessor implementation for ObjectPtrContainerValue. More...

#include "object-ptr-container.h"

+ Inheritance diagram for ns3::ObjectPtrContainerAccessor:
+ Collaboration diagram for ns3::ObjectPtrContainerAccessor:

Public Member Functions

bool Get (const ObjectBase *object, AttributeValue &value) const override
 
bool HasGetter () const override
 
bool HasSetter () const override
 
bool Set (ObjectBase *object, const AttributeValue &value) const override
 
- Public Member Functions inherited from ns3::AttributeAccessor
 AttributeAccessor ()
 
virtual ~AttributeAccessor ()
 
- 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...
 
SimpleRefCountoperator= (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 Ptr< ObjectDoGet (const ObjectBase *object, std::size_t i, std::size_t *index) const =0
 Get an instance from the container, identified by index. More...
 
virtual bool DoGetN (const ObjectBase *object, std::size_t *n) const =0
 Get the number of instances in the container. More...
 

Detailed Description

AttributeAccessor implementation for ObjectPtrContainerValue.

Definition at line 228 of file object-ptr-container.h.

Member Function Documentation

◆ DoGet()

virtual Ptr<Object> ns3::ObjectPtrContainerAccessor::DoGet ( const ObjectBase object,
std::size_t  i,
std::size_t *  index 
) const
privatepure virtual

Get an instance from the container, identified by index.

Parameters
[in]objectThe container object.
[in]iThe desired instance index.
[out]indexThe index retrieved.
Returns
The index requested.

Referenced by Get().

+ Here is the caller graph for this function:

◆ DoGetN()

virtual bool ns3::ObjectPtrContainerAccessor::DoGetN ( const ObjectBase object,
std::size_t *  n 
) const
privatepure virtual

Get the number of instances in the container.

Parameters
[in]objectThe container object.
[out]nThe number of instances in the container.
Returns
true if the value could be obtained successfully.

Referenced by Get().

+ Here is the caller graph for this function:

◆ Get()

bool ns3::ObjectPtrContainerAccessor::Get ( const ObjectBase object,
AttributeValue attribute 
) const
overridevirtual
Parameters
[in,out]objectThe object instance to get the value from
[out]attributeA pointer to where the value should be set.
Returns
true if the value could be read successfully, and stored in the input value, false otherwise.

This method expects that the caller has checked that the input value is valid with AttributeChecker::Check.

Implements ns3::AttributeAccessor.

Definition at line 115 of file object-ptr-container.cc.

References DoGet(), DoGetN(), ns3::ObjectPtrContainerValue::m_objects, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ HasGetter()

bool ns3::ObjectPtrContainerAccessor::HasGetter ( ) const
overridevirtual
Returns
true if this accessor supports the Get operation, false otherwise.

Implements ns3::AttributeAccessor.

Definition at line 140 of file object-ptr-container.cc.

References NS_LOG_FUNCTION.

◆ HasSetter()

bool ns3::ObjectPtrContainerAccessor::HasSetter ( ) const
overridevirtual
Returns
true if this accessor supports the Set operation, false otherwise.

Implements ns3::AttributeAccessor.

Definition at line 147 of file object-ptr-container.cc.

References NS_LOG_FUNCTION.

◆ Set()

bool ns3::ObjectPtrContainerAccessor::Set ( ObjectBase object,
const AttributeValue value 
) const
overridevirtual
Parameters
[in,out]objectThe object instance to set the value in
[in]valueThe value to set
Returns
true if the value could be set successfully, false otherwise.

This method expects that the caller has checked that the input value is valid with AttributeChecker::Check.

Implements ns3::AttributeAccessor.

Definition at line 107 of file object-ptr-container.cc.

References NS_LOG_FUNCTION.


The documentation for this class was generated from the following files: