A Discrete-Event Network Simulator
API
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
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:

Public Member Functions

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

Protected Member Functions

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

Private Member Functions

virtual void DoEndVisitArrayAttribute (void)
 End the visit to the attribute of type ns3::ObjectVectorValue. More...
 
virtual void DoEndVisitArrayItem (void)
 End the visit to the array item. More...
 
virtual void DoEndVisitObject (void)
 This method is called to end the process of visiting the currently visited object. More...
 
virtual void DoEndVisitPointerAttribute (void)
 End the visit to the attribute of type ns3::PointerValue. More...
 
void DoIterate (Ptr< Object > object)
 Perform the iteration. More...
 
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. More...
 
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. More...
 
virtual void DoStartVisitObject (Ptr< Object > object)
 This method is called to start the process of visiting the input object. More...
 
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. More...
 
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. More...
 
void EndVisitArrayAttribute (void)
 End the visit to the attribute of type ns3::ObjectVectorValue. More...
 
void EndVisitArrayItem (void)
 End the visit to the array item. More...
 
void EndVisitObject (void)
 End the visit to the object. More...
 
void EndVisitPointerAttribute (void)
 End the visit to the attribute of type ns3::PointerValue. More...
 
std::string GetCurrentPath (std::string attr) const
 Get current attribute path. More...
 
bool IsExamined (Ptr< const Object > object)
 Check if this object has already been examined. More...
 
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. More...
 
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. More...
 
void StartVisitObject (Ptr< Object > object)
 Start to visit an object to visit its attributes. More...
 
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. More...
 
void VisitAttribute (Ptr< Object > object, std::string name)
 Visit attribute to perform a config store operation on it. More...
 

Private Attributes

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

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 35 of file attribute-iterator.h.

Constructor & Destructor Documentation

◆ AttributeIterator()

ns3::AttributeIterator::AttributeIterator ( )

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

◆ ~AttributeIterator()

ns3::AttributeIterator::~AttributeIterator ( )
virtual

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

Member Function Documentation

◆ DoEndVisitArrayAttribute()

void ns3::AttributeIterator::DoEndVisitArrayAttribute ( void  )
privatevirtual

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

Reimplemented in ns3::ModelCreator.

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

Referenced by EndVisitArrayAttribute().

◆ DoEndVisitArrayItem()

void ns3::AttributeIterator::DoEndVisitArrayItem ( void  )
privatevirtual

End the visit to the array item.

Reimplemented in ns3::ModelCreator.

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

Referenced by EndVisitArrayItem().

◆ DoEndVisitObject()

void ns3::AttributeIterator::DoEndVisitObject ( void  )
privatevirtual

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

Reimplemented in ns3::ModelCreator.

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

Referenced by EndVisitObject().

◆ DoEndVisitPointerAttribute()

void ns3::AttributeIterator::DoEndVisitPointerAttribute ( void  )
privatevirtual

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

Reimplemented in ns3::ModelCreator.

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

Referenced by EndVisitPointerAttribute().

◆ DoIterate()

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

◆ 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 111 of file attribute-iterator.cc.

Referenced by StartVisitArrayAttribute().

◆ 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 119 of file attribute-iterator.cc.

Referenced by StartVisitArrayItem().

◆ 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().

◆ 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 103 of file attribute-iterator.cc.

Referenced by StartVisitPointerAttribute().

◆ 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().

◆ EndVisitArrayAttribute()

void ns3::AttributeIterator::EndVisitArrayAttribute ( void  )
private

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

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

References DoEndVisitArrayAttribute(), and m_currentPath.

Referenced by DoIterate().

◆ EndVisitArrayItem()

void ns3::AttributeIterator::EndVisitArrayItem ( void  )
private

End the visit to the array item.

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

References DoEndVisitArrayItem(), and m_currentPath.

Referenced by DoIterate().

◆ EndVisitObject()

void ns3::AttributeIterator::EndVisitObject ( void  )
private

End the visit to the object.

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

References DoEndVisitObject(), and m_currentPath.

Referenced by DoIterate(), and Iterate().

◆ EndVisitPointerAttribute()

void ns3::AttributeIterator::EndVisitPointerAttribute ( void  )
private

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

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

References DoEndVisitPointerAttribute(), and m_currentPath.

Referenced by DoIterate().

◆ GetCurrentPath() [1/2]

std::string ns3::AttributeIterator::GetCurrentPath ( void  ) 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 55 of file attribute-iterator.cc.

References m_examined.

Referenced by DoIterate().

◆ Iterate()

void ns3::AttributeIterator::Iterate ( void  )

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

Definition at line 41 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().

◆ 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 162 of file attribute-iterator.cc.

References DoStartVisitArrayAttribute(), and m_currentPath.

Referenced by DoIterate().

◆ 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 175 of file attribute-iterator.cc.

References DoStartVisitArrayItem(), ns3::Object::GetInstanceTypeId(), ns3::TypeId::GetName(), and m_currentPath.

Referenced by DoIterate().

◆ 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 136 of file attribute-iterator.cc.

References DoStartVisitObject(), ns3::Object::GetInstanceTypeId(), ns3::TypeId::GetName(), and m_currentPath.

Referenced by DoIterate(), and Iterate().

◆ 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 148 of file attribute-iterator.cc.

References DoStartVisitPointerAttribute(), ns3::Object::GetInstanceTypeId(), ns3::TypeId::GetName(), and m_currentPath.

Referenced by DoIterate().

◆ 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 128 of file attribute-iterator.cc.

References DoVisitAttribute(), and m_currentPath.

Referenced by DoIterate().

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 187 of file attribute-iterator.h.

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


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