60 return m_current < m_object->m_aggregates->n;
90 .SetGroupName (
"Core")
112 for (uint32_t i = 0; i < n; i++)
134 m_initialized (false),
156 for (uint32_t i = 0; i < n; i++)
160 while (cur != tid && cur != objectTid)
177 return const_cast<Object *
> (current);
196 for (uint32_t i = 0; i < n; i++)
221 for (uint32_t i = 0; i < n; i++)
241 aggregates->
buffer[j] = tmp;
259 aggregates->
n = total;
262 std::memcpy (&aggregates->
buffer[0],
267 for (uint32_t i = 0; i < other->m_aggregates->n; i++)
270 const TypeId typeId = other->m_aggregates->buffer[i]->GetInstanceTypeId ();
274 "Multiple aggregation of objects of type " <<
275 other->GetInstanceTypeId () <<
276 " on objects of type " << typeId);
287 uint32_t n = aggregates->
n;
288 for (uint32_t i = 0; i < n; i++)
299 for (uint32_t i = 0; i < a->
n; i++)
304 for (uint32_t i = 0; i < b->
n; i++)
371 uint32_t refcount = 0;
373 for (uint32_t i = 0; i < n; i++)
379 return (refcount > 0);
400 for (uint32_t i = 0; i < n; i++)
411 for (uint32_t i = 0; i < n; i++)
void Dispose(void)
Dispose of this Object.
virtual void DoInitialize(void)
Initialize() implementation.
Smart pointer class similar to boost::intrusive_ptr.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
void Construct(const AttributeConstructionList &attributes)
Initialize all member variables registered as Attributes of this TypeId.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
String attribute value declarations.
bool m_disposed
Set to true when the DoDispose() method of the Object has run, false otherwise.
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
ns3::ObjectFactory class declaration.
uint32_t m_getObjectCount
The number of times the Object was accessed with a call to GetObject().
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
U * PeekPointer(const Ptr< U > &p)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
TypeId GetParent(void) const
Get the parent of this TypeId.
bool Check(void) const
Verify that this Object is still live, by checking it's reference count.
struct Aggregates * m_aggregates
A pointer to an array of 'aggregates'.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
virtual void DoDispose(void)
Destructor implementation.
Anchor the ns-3 type and attribute system.
bool m_initialized
Set to true once the DoInitialize() method has run, false otherwise.
Object * buffer[1]
The array of Objects.
AggregateIterator GetAggregateIterator(void) const
Get an iterator to the Objects aggregated to this one.
uint32_t GetReferenceCount(void) const
Get the reference count of the object.
Ptr< const Object > Next(void)
Get the next Aggregated Object.
AggregateIterator()
Default constructor, which has no Object.
void DoDelete(void)
Attempt to delete this Object.
Definition of assertion macros NS_ASSERT() and NS_ASSERT_MSG().
ns3::AttributeValue, ns3::AttributeAccessor and ns3::AttributeChecker declarations.
List of Attribute name, value and checker triples used to construct Objects.
uint32_t n
The number of entries in buffer.
Ptr< Object > DoGetObject(TypeId tid) const
Find an Object of TypeId tid in the aggregates of this Object.
void ConstructSelf(const AttributeConstructionList &attributes)
Complete construction of ObjectBase; invoked by derived classes.
virtual TypeId GetInstanceTypeId(void) const
Implement the GetInstanceTypeId method defined in ObjectBase.
TypeId m_tid
Identifies the type of this Object instance.
void SetTypeId(TypeId tid)
Set the TypeId of this Object.
static TypeId GetTypeId(void)
Register this type.
friend class AggregateIterator
ns3::Object class declaration, which is the root of the Object hierarchy and Aggregation.
bool HasNext(void) const
Check if there are more Aggregates to iterate over.
bool CheckLoose(void) const
Check if any aggregated Objects have non-zero reference counts.
virtual ~Object()
Destructor.
void UpdateSortedArray(struct Aggregates *aggregates, uint32_t i) const
Keep the list of aggregates in most-recently-used order.
A base class which provides memory management and object aggregation.
virtual void NotifyNewAggregate(void)
Notify all Objects aggregated to this one of a new Object being aggregated.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Iterate over the Objects aggregated to an ns3::Object.
void Initialize(void)
Invoke DoInitialize on all Objects aggregated to this one.
The list of Objects aggregated to this one.