52 (m_uniAggrIter != m_object->m_unidirectionalAggregates.end());
65 else if (m_uniAggrIter != m_object->m_unidirectionalAggregates.end())
67 auto object = *m_uniAggrIter;
137 m_initialized(false),
165 while (cur != tid && cur != objectTid)
182 return const_cast<Object*
>(current);
189 TypeId cur = uniItem->GetInstanceTypeId();
190 while (cur != tid && cur != objectTid)
231 if (!uniItem->m_initialized)
233 uniItem->DoInitialize();
234 uniItem->m_initialized =
true;
275 if (!uniItem->m_disposed && uniItem->GetReferenceCount() == 1)
277 uniItem->DoDispose();
278 uniItem->m_disposed =
true;
292 aggregates->
buffer[j] = tmp;
310 aggregates->n = total;
313 std::memcpy(&aggregates->buffer[0],
326 "Multiple aggregation of objects of type "
342 Object* current = aggregates->buffer[i];
383 "Multiple aggregation of objects of type "
396 std::list<Object*> aggregates;
401 for (
auto& item : aggregates)
403 item->NotifyNewAggregate();
464 bool nonZeroRefCount =
false;
471 nonZeroRefCount =
true;
475 return nonZeroRefCount;
NS_ASSERT() and NS_ASSERT_MSG() macro definitions.
ns3::AttributeValue, ns3::AttributeAccessor and ns3::AttributeChecker declarations.
List of Attribute name, value and checker triples used to construct Objects.
Iterate over the Objects aggregated to an ns3::Object.
std::vector< Ptr< Object > >::const_iterator m_uniAggrIter
Iterator to the unidirectional aggregates.
Ptr< const Object > Next()
Get the next Aggregated Object.
AggregateIterator()
Default constructor, which has no Object.
bool HasNext() const
Check if there are more Aggregates to iterate over.
Anchor the ns-3 type and attribute system.
void ConstructSelf(const AttributeConstructionList &attributes)
Complete construction of ObjectBase; invoked by derived classes.
A base class which provides memory management and object aggregation.
Aggregates * m_aggregates
A pointer to an array of 'aggregates'.
void UnidirectionalAggregateObject(Ptr< Object > other)
Aggregate an Object to another Object.
void Initialize()
Invoke DoInitialize on all Objects aggregated to this one.
void UpdateSortedArray(Aggregates *aggregates, uint32_t i) const
Keep the list of aggregates in most-recently-used order.
void Construct(const AttributeConstructionList &attributes)
Initialize all member variables registered as Attributes of this TypeId.
bool Check() const
Verify that this Object is still live, by checking it's reference count.
Ptr< Object > DoGetObject(TypeId tid) const
Find an Object of TypeId tid in the aggregates of this Object.
friend class AggregateIterator
Friends.
bool m_disposed
Set to true when the DoDispose() method of the Object has run, false otherwise.
std::vector< Ptr< Object > > m_unidirectionalAggregates
An array of unidirectional aggregates, i.e., objects that are aggregated to the current object,...
virtual void NotifyNewAggregate()
Notify all Objects aggregated to this one of a new Object being aggregated.
bool CheckLoose() const
Check if any aggregated Objects have non-zero reference counts.
~Object() override
Destructor.
AggregateIterator GetAggregateIterator() const
Get an iterator to the Objects aggregated to this one.
virtual void DoInitialize()
Initialize() implementation.
void SetTypeId(TypeId tid)
Set the TypeId of this Object.
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
static TypeId GetTypeId()
Register this type.
void Dispose()
Dispose of this Object.
TypeId m_tid
Identifies the type of this Object instance.
virtual void DoDispose()
Destructor implementation.
bool IsInitialized() const
Check if the object has been initialized.
uint32_t m_getObjectCount
The number of times the Object was accessed with a call to GetObject().
void DoDelete()
Attempt to delete this Object.
bool m_initialized
Set to true once the DoInitialize() method has run, false otherwise.
Smart pointer class similar to boost::intrusive_ptr.
uint32_t GetReferenceCount() const
a unique identifier for an interface.
TypeId GetParent() const
Get the parent of this TypeId.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
U * PeekPointer(const Ptr< U > &p)
ns3::ObjectFactory class declaration.
ns3::Object class declaration, which is the root of the Object hierarchy and Aggregation.
ns3::StringValue attribute value declarations.
The list of Objects aggregated to this one.
uint32_t n
The number of entries in buffer.
Object * buffer[1]
The array of Objects.