20 #include "ns3/config.h"
22 #include "ns3/pointer.h"
23 #include "ns3/object-ptr-container.h"
24 #include "ns3/string.h"
57 for (uint32_t i = 0; i <
m_examined.size (); ++i)
71 std::ostringstream oss;
86 std::ostringstream oss;
151 m_currentPath.push_back (
"$" + value->GetInstanceTypeId ().GetName ());
177 std::ostringstream oss;
211 object->GetAttribute (info.
name, ptr);
226 if (vectorChecker != 0)
230 object->GetAttribute (info.
name, vector);
233 for (it = vector.
Begin (); it != vector.
End (); ++it)
235 uint32_t j = (*it).first;
236 NS_LOG_DEBUG (
"ObjectPtrContainer attribute item " << j);
262 bool recursiveAggregate =
false;
268 recursiveAggregate =
true;
271 if (!recursiveAggregate)
273 iter =
object->GetAggregateIterator ();
void DoIterate(Ptr< Object > object)
Perform the iteration.
virtual void DoEndVisitArrayAttribute(void)
End the visit to the attribute of type ns3::ObjectVectorValue.
virtual void DoEndVisitArrayItem(void)
End the visit to the array item.
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 DoEndVisitPointerAttribute(void)
End the visit to the attribute of type ns3::PointerValue.
void StartVisitObject(Ptr< Object > object)
Start to visit an object to visit its attributes.
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...
std::string GetCurrentPath(void) const
Get the current attribute path.
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...
void EndVisitObject(void)
End the visit to the object.
void EndVisitArrayAttribute(void)
End the visit to the attribute of type ns3::ObjectVectorValue.
virtual ~AttributeIterator()
void Iterate(void)
Start the process of iterating all objects from the root namespace object.
void EndVisitArrayItem(void)
End the visit to the array item.
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.
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.
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 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...
virtual void DoEndVisitObject(void)
This method is called to end the process of visiting the currently visited object.
void EndVisitPointerAttribute(void)
End the visit to the attribute of type ns3::PointerValue.
Iterate over the Objects aggregated to an ns3::Object.
Ptr< const Object > Next(void)
Get the next Aggregated Object.
bool HasNext(void) const
Check if there are more Aggregates to iterate over.
A base class which provides memory management and object aggregation.
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
AttributeChecker implementation for ObjectPtrContainerValue.
Container for a set of ns3::Object pointers.
Iterator Begin(void) const
Get an iterator to the first Object.
std::map< std::size_t, Ptr< Object > >::const_iterator Iterator
Iterator type for traversing this container.
Iterator End(void) const
Get an iterator to the past-the-end Object.
AttributeChecker implementation for PointerValue.
Hold objects of type Ptr<T>.
a unique identifier for an interface.
std::size_t GetAttributeN(void) const
Get the number of attributes.
bool HasParent(void) const
Check if this TypeId has a parent.
@ ATTR_GET
The attribute can be read.
@ ATTR_SET
The attribute can be written.
struct TypeId::AttributeInformation GetAttribute(std::size_t i) const
Get Attribute information by index.
TypeId GetParent(void) const
Get the parent of this TypeId.
std::string GetName(void) 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(void)
#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)