Iterator to iterate on the values of attributes of an ns3::Object. More...
#include "attribute-iterator.h"
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 | |
Iterator to iterate on the values of attributes of an ns3::Object.
Definition at line 36 of file attribute-iterator.h.
ns3::AttributeIterator::AttributeIterator | ( | ) |
Definition at line 33 of file attribute-iterator.cc.
|
virtual |
Definition at line 37 of file attribute-iterator.cc.
|
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().
|
privatevirtual |
End the visit to the array item.
Reimplemented in ns3::ModelCreator.
Definition at line 136 of file attribute-iterator.cc.
Referenced by EndVisitArrayItem().
|
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().
|
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().
Perform the iteration.
object | the object visited |
Definition at line 217 of file attribute-iterator.cc.
References ns3::TypeId::AttributeInformation::accessor, ns3::TypeId::ATTR_GET, ns3::TypeId::ATTR_SET, ns3::ObjectPtrContainerValue::Begin(), ns3::TypeId::AttributeInformation::checker, DoIterate(), ns3::ObjectPtrContainerValue::End(), EndVisitArrayAttribute(), EndVisitArrayItem(), EndVisitObject(), EndVisitPointerAttribute(), ns3::TypeId::AttributeInformation::flags, ns3::PointerValue::Get(), ns3::TypeId::GetAttribute(), ns3::TypeId::GetAttributeN(), ns3::TypeId::GetName(), ns3::TypeId::GetParent(), ns3::Object::AggregateIterator::HasNext(), ns3::TypeId::HasParent(), IsExamined(), m_examined, ns3::TypeId::AttributeInformation::name, ns3::Object::AggregateIterator::Next(), NS_LOG_DEBUG, ns3::PeekPointer(), StartVisitArrayAttribute(), StartVisitArrayItem(), StartVisitObject(), StartVisitPointerAttribute(), and VisitAttribute().
Referenced by DoIterate(), and Iterate().
|
privatevirtual |
Visit the attribute of type ns3::ObjectVectorValue, with the provided name, found on the object pointed to by the first argument.
object | the object on which the attribute of type ObjectVectorValue resides | |
name | the attribute name provided | |
[in] | vector | the ObjectPtrContainerValue corresponding to the named attribute |
Reimplemented in ns3::ModelCreator.
Definition at line 117 of file attribute-iterator.cc.
Referenced by StartVisitArrayAttribute().
|
privatevirtual |
Start to visit the object found in the input array at the provided index.
vector | the array | |
index | the index into the array | |
[in] | item | the array item to visit |
Reimplemented in ns3::ModelCreator.
Definition at line 129 of file attribute-iterator.cc.
Referenced by StartVisitArrayItem().
This method is called to start the process of visiting the input object.
object | the object visited |
Reimplemented in ns3::ModelCreator.
Definition at line 95 of file attribute-iterator.cc.
Referenced by StartVisitObject().
|
privatevirtual |
Visit the attribute of type ns3::PointerValue, with the provided name, found on the object pointed to by the first argument.
object | the object on which the attribute of type PointerValue resides | |
name | the attribute name provided | |
[in] | value | Ptr 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().
|
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.
object | the object visited |
name | the attribute name |
Implemented in ns3::ModelCreator.
Referenced by VisitAttribute().
|
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().
|
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().
|
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().
|
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().
|
protected |
Get the current attribute path.
Definition at line 84 of file attribute-iterator.cc.
References m_currentPath.
|
private |
Get current attribute path.
attr | the current attribute string |
Definition at line 69 of file attribute-iterator.cc.
References m_currentPath.
Check if this object has already been examined.
object | the object to check |
Definition at line 56 of file attribute-iterator.cc.
References m_examined.
Referenced by DoIterate().
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().
|
private |
Visit the attribute of type ns3::ObjectVectorValue, with the provided name, found on the object pointed to by the first argument.
object | the object on which the attribute of type ObjectVectorValue resides | |
name | the attribute name provided | |
[in] | vector | the ObjectPtrContainerValue corresponding to the named attribute |
Definition at line 181 of file attribute-iterator.cc.
References DoStartVisitArrayAttribute(), and m_currentPath.
Referenced by DoIterate().
|
private |
Start to visit the object found in the input array at the provided index.
vector | the array | |
index | the index into the array | |
[in] | item | the array item to visit |
Definition at line 197 of file attribute-iterator.cc.
References DoStartVisitArrayItem(), and m_currentPath.
Referenced by DoIterate().
Start to visit an object to visit its attributes.
object | the current object |
Definition at line 149 of file attribute-iterator.cc.
References DoStartVisitObject(), and m_currentPath.
Referenced by DoIterate(), and Iterate().
|
private |
Visit the attribute of type ns3::PointerValue, with the provided name, found on the object pointed to by the first argument.
object | the object on which the attribute of type PointerValue resides | |
name | the attribute name provided | |
[in] | value | Ptr 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().
Visit attribute to perform a config store operation on it.
object | the current object |
name | the attribute name |
Definition at line 141 of file attribute-iterator.cc.
References DoVisitAttribute(), and m_currentPath.
Referenced by DoIterate().
|
private |
current attribute path
Definition at line 198 of file attribute-iterator.h.
Referenced by EndVisitArrayAttribute(), EndVisitArrayItem(), EndVisitObject(), EndVisitPointerAttribute(), GetCurrentPath(), Iterate(), StartVisitArrayAttribute(), StartVisitArrayItem(), StartVisitObject(), StartVisitPointerAttribute(), and VisitAttribute().
list of attributes examined
Definition at line 197 of file attribute-iterator.h.
Referenced by DoIterate(), IsExamined(), and Iterate().