20#include "ns3/config.h"
22#include "ns3/object-ptr-container.h"
23#include "ns3/pointer.h"
24#include "ns3/string.h"
71 std::ostringstream oss;
86 std::ostringstream oss;
168 m_currentPath.push_back(
"$" + value->GetInstanceTypeId().GetName());
201 std::ostringstream oss;
204 m_currentPath.push_back(
"$" + item->GetInstanceTypeId().GetName());
232 if (ptrChecker !=
nullptr)
236 object->GetAttribute(info.
name, ptr);
251 if (vectorChecker !=
nullptr)
255 object->GetAttribute(info.
name, vector);
258 for (it = vector.
Begin(); it != vector.
End(); ++it)
261 NS_LOG_DEBUG(
"ObjectPtrContainer attribute item " << j);
287 bool recursiveAggregate =
false;
293 recursiveAggregate =
true;
296 if (!recursiveAggregate)
298 iter =
object->GetAggregateIterator();
void DoIterate(Ptr< Object > object)
Perform the iteration.
virtual void DoEndVisitArrayItem()
End the visit to the array item.
virtual void DoEndVisitPointerAttribute()
End the visit to the attribute of type ns3::PointerValue.
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...
std::vector< std::string > m_currentPath
current attribute path
virtual void DoEndVisitArrayAttribute()
End the visit to the attribute of type ns3::ObjectVectorValue.
std::string GetCurrentPath() const
Get the current attribute path.
void StartVisitObject(Ptr< Object > object)
Start to visit an object to visit its attributes.
void EndVisitObject()
End the visit to the object.
bool IsExamined(Ptr< const Object > object)
Check if this object has already been examined.
void VisitAttribute(Ptr< Object > object, std::string name)
Visit attribute to perform a config store operation on it.
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 point...
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 attribut...
virtual ~AttributeIterator()
void EndVisitPointerAttribute()
End the visit to the attribute of type ns3::PointerValue.
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 EndVisitArrayItem()
End the visit to the array item.
std::vector< Ptr< Object > > m_examined
list of attributes examined
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.
void EndVisitArrayAttribute()
End the visit to the attribute of type ns3::ObjectVectorValue.
virtual void DoStartVisitObject(Ptr< Object > object)
This method is called to start the process of visiting the input object.
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...
virtual void DoEndVisitObject()
This method is called to end the process of visiting the currently visited object.
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 point...
void Iterate()
Start the process of iterating all objects from the root namespace object.
Iterate over the Objects aggregated to an ns3::Object.
Ptr< const Object > Next()
Get the next Aggregated Object.
bool HasNext() const
Check if there are more Aggregates to iterate over.
A base class which provides memory management and object aggregation.
AttributeChecker implementation for ObjectPtrContainerValue.
Container for a set of ns3::Object pointers.
Iterator End() const
Get an iterator to the past-the-end Object.
Iterator Begin() const
Get an iterator to the first Object.
std::map< std::size_t, Ptr< Object > >::const_iterator Iterator
Iterator type for traversing this container.
AttributeChecker implementation for PointerValue.
Hold objects of type Ptr<T>.
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
bool HasParent() const
Check if this TypeId has a parent.
@ ATTR_GET
The attribute can be read.
@ ATTR_SET
The attribute can be written.
std::size_t GetAttributeN() const
Get the number of attributes.
TypeId GetParent() const
Get the parent of this TypeId.
TypeId::AttributeInformation GetAttribute(std::size_t i) const
Get Attribute information by index.
std::string GetName() const
Get the name.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Ptr< Object > GetRootNamespaceObject(uint32_t i)
std::size_t GetRootNamespaceObjectN()
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
U * PeekPointer(const Ptr< U > &p)