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 (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... | |
Iterator to iterate on the values of attributes of an ns3::Object.
Definition at line 35 of file attribute-iterator.h.
ns3::AttributeIterator::AttributeIterator | ( | ) |
Definition at line 32 of file attribute-iterator.cc.
|
virtual |
Definition at line 36 of file attribute-iterator.cc.
|
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().
|
privatevirtual |
End the visit to the array item.
Reimplemented in ns3::ModelCreator.
Definition at line 123 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 99 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 107 of file attribute-iterator.cc.
Referenced by EndVisitPointerAttribute().
Perform the iteration.
object | the object visited |
Definition at line 193 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, ns3::ObjectPtrContainerValue::End(), EndVisitArrayAttribute(), EndVisitArrayItem(), EndVisitObject(), EndVisitPointerAttribute(), ns3::TypeId::AttributeInformation::flags, ns3::PointerValue::Get(), ns3::TypeId::GetAttribute(), ns3::TypeId::GetAttributeN(), ns3::Object::GetInstanceTypeId(), 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 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 111 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 119 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 103 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 168 of file attribute-iterator.cc.
References DoEndVisitArrayAttribute(), and m_currentPath.
Referenced by DoIterate().
|
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().
|
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().
|
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().
|
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 55 of file attribute-iterator.cc.
References m_examined.
Referenced by DoIterate().
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().
|
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 162 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 175 of file attribute-iterator.cc.
References DoStartVisitArrayItem(), ns3::Object::GetInstanceTypeId(), ns3::TypeId::GetName(), and m_currentPath.
Referenced by DoIterate().
Start to visit an object to visit its attributes.
object | the 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().
|
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 148 of file attribute-iterator.cc.
References DoStartVisitPointerAttribute(), ns3::Object::GetInstanceTypeId(), ns3::TypeId::GetName(), 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 128 of file attribute-iterator.cc.
References DoVisitAttribute(), and m_currentPath.
Referenced by DoIterate().
|
private |
current attribute path
Definition at line 188 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 187 of file attribute-iterator.h.
Referenced by DoIterate(), IsExamined(), and Iterate().