A Discrete-Event Network Simulator
API
ns3::Object::AggregateIterator Class Reference

Iterate over the Objects aggregated to an ns3::Object. More...

#include "object.h"

+ Collaboration diagram for ns3::Object::AggregateIterator:

Public Member Functions

 AggregateIterator ()
 Default constructor, which has no Object. More...
 
bool HasNext () const
 Check if there are more Aggregates to iterate over. More...
 
Ptr< const ObjectNext ()
 Get the next Aggregated Object. More...
 

Private Member Functions

 AggregateIterator (Ptr< const Object > object)
 Construct from an Object. More...
 

Private Attributes

uint32_t m_current
 Current position in parent's aggregates. More...
 
Ptr< const Objectm_object
 Parent Object. More...
 

Friends

class Object
 Object needs access. More...
 

Detailed Description

Iterate over the Objects aggregated to an ns3::Object.

This iterator does not allow you to iterate over the parent Object used to call Object::GetAggregateIterator.

Note
This is a java-style iterator.

Definition at line 105 of file object.h.

Constructor & Destructor Documentation

◆ AggregateIterator() [1/2]

ns3::Object::AggregateIterator::AggregateIterator ( )

Default constructor, which has no Object.

Definition at line 51 of file object.cc.

References NS_LOG_FUNCTION.

◆ AggregateIterator() [2/2]

ns3::Object::AggregateIterator::AggregateIterator ( Ptr< const Object object)
private

Construct from an Object.

This is private, with Object as friend, so only Objects can create useful AggregateIterators.

Parameters
[in]objectThe Object whose Aggregates should be iterated over.

Definition at line 74 of file object.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ HasNext()

bool ns3::Object::AggregateIterator::HasNext ( ) const

Check if there are more Aggregates to iterate over.

Returns
true if Next() can be called and return a non-null pointer, false otherwise.

Definition at line 59 of file object.cc.

References NS_LOG_FUNCTION.

Referenced by ns3::AttributeIterator::DoIterate().

+ Here is the caller graph for this function:

◆ Next()

Ptr< const Object > ns3::Object::AggregateIterator::Next ( )

Get the next Aggregated Object.

Returns
The next aggregated Object.

Definition at line 66 of file object.cc.

References ns3::Object::Aggregates::buffer, ns3::Object::m_aggregates, and NS_LOG_FUNCTION.

Referenced by ns3::AttributeIterator::DoIterate().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ Object

friend class Object
friend

Object needs access.

Definition at line 128 of file object.h.

Member Data Documentation

◆ m_current

uint32_t ns3::Object::AggregateIterator::m_current
private

Current position in parent's aggregates.

Definition at line 139 of file object.h.

◆ m_object

Ptr<const Object> ns3::Object::AggregateIterator::m_object
private

Parent Object.

Definition at line 138 of file object.h.


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