A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::AttributeIterator Class Referenceabstract

Iterator to iterate on the values of attributes of an ns3::Object. More...

#include "attribute-iterator.h"

+ Inheritance diagram for ns3::AttributeIterator:
+ Collaboration diagram for ns3::AttributeIterator:

Public Member Functions

 AttributeIterator ()
 
virtual ~AttributeIterator ()
 
void Iterate ()
 Start the process of iterating all objects from the root namespace object.
 

Protected Member Functions

std::string GetCurrentPath () const
 Get the current attribute path.
 

Private Member Functions

virtual void DoEndVisitArrayAttribute ()
 End the visit to the attribute of type ns3::ObjectVectorValue.
 
virtual void DoEndVisitArrayItem ()
 End the visit to the array item.
 
virtual void DoEndVisitObject ()
 This method is called to end the process of visiting the currently visited object.
 
virtual void DoEndVisitPointerAttribute ()
 End the visit to the attribute of type ns3::PointerValue.
 
void DoIterate (Ptr< Object > object)
 Perform the iteration.
 
virtual void DoStartVisitArrayAttribute (Ptr< Object > object, std::string name, const ObjectPtrContainerValue &vector)
 Visit the attribute of type ns3::ObjectVectorValue, with the provided name, found on the object pointed to by the first argument.
 
virtual void DoStartVisitArrayItem (const ObjectPtrContainerValue &vector, uint32_t index, Ptr< Object > item)
 Start to visit the object found in the input array at the provided index.
 
virtual void DoStartVisitObject (Ptr< Object > object)
 This method is called to start the process of visiting the input object.
 
virtual void DoStartVisitPointerAttribute (Ptr< Object > object, std::string name, Ptr< Object > value)
 Visit the attribute of type ns3::PointerValue, with the provided name, found on the object pointed to by the first argument.
 
virtual void DoVisitAttribute (Ptr< Object > object, std::string name)=0
 This method visits and performs a config-store action (such as saving to a text file) on the attribute values corresponding to the input object pointer and attribute name.
 
void EndVisitArrayAttribute ()
 End the visit to the attribute of type ns3::ObjectVectorValue.
 
void EndVisitArrayItem ()
 End the visit to the array item.
 
void EndVisitObject ()
 End the visit to the object.
 
void EndVisitPointerAttribute ()
 End the visit to the attribute of type ns3::PointerValue.
 
std::string GetCurrentPath (std::string attr) const
 Get current attribute path.
 
bool IsExamined (Ptr< const Object > object)
 Check if this object has already been examined.
 
void StartVisitArrayAttribute (Ptr< Object > object, std::string name, const ObjectPtrContainerValue &vector)
 Visit the attribute of type ns3::ObjectVectorValue, with the provided name, found on the object pointed to by the first argument.
 
void StartVisitArrayItem (const ObjectPtrContainerValue &vector, uint32_t index, Ptr< Object > item)
 Start to visit the object found in the input array at the provided index.
 
void StartVisitObject (Ptr< Object > object)
 Start to visit an object to visit its attributes.
 
void StartVisitPointerAttribute (Ptr< Object > object, std::string name, Ptr< Object > value)
 Visit the attribute of type ns3::PointerValue, with the provided name, found on the object pointed to by the first argument.
 
void VisitAttribute (Ptr< Object > object, std::string name)
 Visit attribute to perform a config store operation on it.
 

Private Attributes

std::vector< std::string > m_currentPath
 current attribute path
 
std::vector< Ptr< Object > > m_examined
 list of attributes examined
 

Detailed Description

Iterator to iterate on the values of attributes of an ns3::Object.

Note
This class is used internally by ConfigStore and GtkConfigStore.

Definition at line 36 of file attribute-iterator.h.

Constructor & Destructor Documentation

◆ AttributeIterator()

ns3::AttributeIterator::AttributeIterator ( )

Definition at line 33 of file attribute-iterator.cc.

◆ ~AttributeIterator()

ns3::AttributeIterator::~AttributeIterator ( )
virtual

Definition at line 37 of file attribute-iterator.cc.

Member Function Documentation

◆ DoEndVisitArrayAttribute()

void ns3::AttributeIterator::DoEndVisitArrayAttribute ( )
privatevirtual

End the visit to the attribute of type ns3::ObjectVectorValue.

Reimplemented in ns3::ModelCreator.

Definition at line 124 of file attribute-iterator.cc.

Referenced by EndVisitArrayAttribute().

+ Here is the caller graph for this function:

◆ DoEndVisitArrayItem()

void ns3::AttributeIterator::DoEndVisitArrayItem ( )
privatevirtual

End the visit to the array item.

Reimplemented in ns3::ModelCreator.

Definition at line 136 of file attribute-iterator.cc.

Referenced by EndVisitArrayItem().

+ Here is the caller graph for this function:

◆ DoEndVisitObject()

void ns3::AttributeIterator::DoEndVisitObject ( )
privatevirtual

This method is called to end the process of visiting the currently visited object.

Reimplemented in ns3::ModelCreator.

Definition at line 100 of file attribute-iterator.cc.

Referenced by EndVisitObject().

+ Here is the caller graph for this function:

◆ DoEndVisitPointerAttribute()

void ns3::AttributeIterator::DoEndVisitPointerAttribute ( )
privatevirtual

End the visit to the attribute of type ns3::PointerValue.

Reimplemented in ns3::ModelCreator.

Definition at line 112 of file attribute-iterator.cc.

Referenced by EndVisitPointerAttribute().

+ Here is the caller graph for this function:

◆ DoIterate()

◆ DoStartVisitArrayAttribute()

void ns3::AttributeIterator::DoStartVisitArrayAttribute ( Ptr< Object object,
std::string  name,
const ObjectPtrContainerValue vector 
)
privatevirtual

Visit the attribute of type ns3::ObjectVectorValue, with the provided name, found on the object pointed to by the first argument.

Note
type name ObjectVectorValue is an alias for ObjectPtrContainerValue
Parameters
objectthe object on which the attribute of type ObjectVectorValue resides
namethe attribute name provided
[in]vectorthe ObjectPtrContainerValue corresponding to the named attribute

Reimplemented in ns3::ModelCreator.

Definition at line 117 of file attribute-iterator.cc.

Referenced by StartVisitArrayAttribute().

+ Here is the caller graph for this function:

◆ DoStartVisitArrayItem()

void ns3::AttributeIterator::DoStartVisitArrayItem ( const ObjectPtrContainerValue vector,
uint32_t  index,
Ptr< Object item 
)
privatevirtual

Start to visit the object found in the input array at the provided index.

Parameters
vectorthe array
indexthe index into the array
[in]itemthe array item to visit

Reimplemented in ns3::ModelCreator.

Definition at line 129 of file attribute-iterator.cc.

Referenced by StartVisitArrayItem().

+ Here is the caller graph for this function:

◆ DoStartVisitObject()

void ns3::AttributeIterator::DoStartVisitObject ( Ptr< Object object)
privatevirtual

This method is called to start the process of visiting the input object.

Parameters
objectthe object visited

Reimplemented in ns3::ModelCreator.

Definition at line 95 of file attribute-iterator.cc.

Referenced by StartVisitObject().

+ Here is the caller graph for this function:

◆ DoStartVisitPointerAttribute()

void ns3::AttributeIterator::DoStartVisitPointerAttribute ( Ptr< Object object,
std::string  name,
Ptr< Object value 
)
privatevirtual

Visit the attribute of type ns3::PointerValue, with the provided name, found on the object pointed to by the first argument.

Parameters
objectthe object on which the attribute of type PointerValue resides
namethe attribute name provided
[in]valuePtr to the ns3::Object pointed to by the attribute

Reimplemented in ns3::ModelCreator.

Definition at line 105 of file attribute-iterator.cc.

Referenced by StartVisitPointerAttribute().

+ Here is the caller graph for this function:

◆ DoVisitAttribute()

virtual void ns3::AttributeIterator::DoVisitAttribute ( Ptr< Object object,
std::string  name 
)
privatepure virtual

This method visits and performs a config-store action (such as saving to a text file) on the attribute values corresponding to the input object pointer and attribute name.

Parameters
objectthe object visited
namethe attribute name

Implemented in ns3::ModelCreator.

Referenced by VisitAttribute().

+ Here is the caller graph for this function:

◆ EndVisitArrayAttribute()

void ns3::AttributeIterator::EndVisitArrayAttribute ( )
private

End the visit to the attribute of type ns3::ObjectVectorValue.

Definition at line 190 of file attribute-iterator.cc.

References DoEndVisitArrayAttribute(), and m_currentPath.

Referenced by DoIterate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EndVisitArrayItem()

void ns3::AttributeIterator::EndVisitArrayItem ( )
private

End the visit to the array item.

Definition at line 209 of file attribute-iterator.cc.

References DoEndVisitArrayItem(), and m_currentPath.

Referenced by DoIterate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EndVisitObject()

void ns3::AttributeIterator::EndVisitObject ( )
private

End the visit to the object.

Definition at line 156 of file attribute-iterator.cc.

References DoEndVisitObject(), and m_currentPath.

Referenced by DoIterate(), and Iterate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EndVisitPointerAttribute()

void ns3::AttributeIterator::EndVisitPointerAttribute ( )
private

End the visit to the attribute of type ns3::PointerValue.

Definition at line 173 of file attribute-iterator.cc.

References DoEndVisitPointerAttribute(), and m_currentPath.

Referenced by DoIterate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetCurrentPath() [1/2]

std::string ns3::AttributeIterator::GetCurrentPath ( ) const
protected

Get the current attribute path.

Returns
the current path string

Definition at line 84 of file attribute-iterator.cc.

References m_currentPath.

◆ GetCurrentPath() [2/2]

std::string ns3::AttributeIterator::GetCurrentPath ( std::string  attr) const
private

Get current attribute path.

Parameters
attrthe current attribute string
Returns
the current path string

Definition at line 69 of file attribute-iterator.cc.

References m_currentPath.

◆ IsExamined()

bool ns3::AttributeIterator::IsExamined ( Ptr< const Object object)
private

Check if this object has already been examined.

Parameters
objectthe object to check
Returns
true if object has been examined

Definition at line 56 of file attribute-iterator.cc.

References m_examined.

Referenced by DoIterate().

+ Here is the caller graph for this function:

◆ Iterate()

void ns3::AttributeIterator::Iterate ( )

Start the process of iterating all objects from the root namespace object.

Definition at line 42 of file attribute-iterator.cc.

References DoIterate(), EndVisitObject(), ns3::Config::GetRootNamespaceObject(), ns3::Config::GetRootNamespaceObjectN(), m_currentPath, m_examined, NS_ASSERT, and StartVisitObject().

Referenced by ns3::ModelCreator::Build().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StartVisitArrayAttribute()

void ns3::AttributeIterator::StartVisitArrayAttribute ( Ptr< Object object,
std::string  name,
const ObjectPtrContainerValue vector 
)
private

Visit the attribute of type ns3::ObjectVectorValue, with the provided name, found on the object pointed to by the first argument.

Note
type name ObjectVectorValue is an alias for ObjectPtrContainerValue
Parameters
objectthe object on which the attribute of type ObjectVectorValue resides
namethe attribute name provided
[in]vectorthe ObjectPtrContainerValue corresponding to the named attribute

Definition at line 181 of file attribute-iterator.cc.

References DoStartVisitArrayAttribute(), and m_currentPath.

Referenced by DoIterate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StartVisitArrayItem()

void ns3::AttributeIterator::StartVisitArrayItem ( const ObjectPtrContainerValue vector,
uint32_t  index,
Ptr< Object item 
)
private

Start to visit the object found in the input array at the provided index.

Parameters
vectorthe array
indexthe index into the array
[in]itemthe array item to visit

Definition at line 197 of file attribute-iterator.cc.

References DoStartVisitArrayItem(), and m_currentPath.

Referenced by DoIterate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StartVisitObject()

void ns3::AttributeIterator::StartVisitObject ( Ptr< Object object)
private

Start to visit an object to visit its attributes.

Parameters
objectthe current object

Definition at line 149 of file attribute-iterator.cc.

References DoStartVisitObject(), and m_currentPath.

Referenced by DoIterate(), and Iterate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StartVisitPointerAttribute()

void ns3::AttributeIterator::StartVisitPointerAttribute ( Ptr< Object object,
std::string  name,
Ptr< Object value 
)
private

Visit the attribute of type ns3::PointerValue, with the provided name, found on the object pointed to by the first argument.

Parameters
objectthe object on which the attribute of type PointerValue resides
namethe attribute name provided
[in]valuePtr to the ns3::Object pointed to by the attribute

Definition at line 163 of file attribute-iterator.cc.

References DoStartVisitPointerAttribute(), and m_currentPath.

Referenced by DoIterate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ VisitAttribute()

void ns3::AttributeIterator::VisitAttribute ( Ptr< Object object,
std::string  name 
)
private

Visit attribute to perform a config store operation on it.

Parameters
objectthe current object
namethe attribute name

Definition at line 141 of file attribute-iterator.cc.

References DoVisitAttribute(), and m_currentPath.

Referenced by DoIterate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_currentPath

std::vector<std::string> ns3::AttributeIterator::m_currentPath
private

◆ m_examined

std::vector<Ptr<Object> > ns3::AttributeIterator::m_examined
private

list of attributes examined

Definition at line 197 of file attribute-iterator.h.

Referenced by DoIterate(), IsExamined(), and Iterate().


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