28 #include "attribute.h"
29 #include "object-base.h"
30 #include "attribute-construction-list.h"
31 #include "simple-ref-count.h"
37 class AttributeAccessor;
39 class TraceSourceAccessor;
43 inline static void Delete (
Object *
object);
66 static TypeId GetTypeId (
void);
109 template <
typename T>
115 template <
typename T>
218 template <
typename T>
220 template <
typename T>
222 template <
typename T>
223 friend Ptr<T> CompleteConstruct (T *
object);
245 bool Check (
void)
const;
246 bool CheckLoose (
void)
const;
265 void UpdateSortedArray (
struct Aggregates *aggregates, uint32_t i)
const;
311 template <
typename T>
313 template <
typename T>
321 ObjectDeleter::Delete (Object *
object)
330 template <
typename T>
336 T *result =
dynamic_cast<T *
> (
m_aggregates->buffer[0]);
345 return Ptr<T> (
static_cast<T *
> (PeekPointer (found)));
350 template <
typename T>
357 return Ptr<T> (
static_cast<T *
> (PeekPointer (found)));
366 template <
typename T>
369 Ptr<T> p =
Ptr<T> (
new T (*PeekPointer (
object)),
false);
370 NS_ASSERT (p->GetInstanceTypeId () ==
object->GetInstanceTypeId ());
374 template <
typename T>
377 Ptr<T> p = Ptr<T> (
new T (*PeekPointer (
object)),
false);
378 NS_ASSERT (p->GetInstanceTypeId () ==
object->GetInstanceTypeId ());
382 template <
typename T>
383 Ptr<T> CompleteConstruct (T *p)
385 p->SetTypeId (T::GetTypeId ());
386 p->Object::Construct (AttributeConstructionList ());
387 return Ptr<T> (p,
false);
390 template <
typename T>
391 Ptr<T> CreateObject (
void)
393 return CompleteConstruct (
new T ());
396 template <
typename T,
typename T1>
397 Ptr<T> CreateObject (T1 a1)
399 return CompleteConstruct (
new T (a1));
402 template <
typename T,
typename T1,
typename T2>
403 Ptr<T> CreateObject (T1 a1, T2 a2)
405 return CompleteConstruct (
new T (a1,a2));
408 template <
typename T,
typename T1,
typename T2,
typename T3>
409 Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3)
411 return CompleteConstruct (
new T (a1,a2,a3));
414 template <
typename T,
typename T1,
typename T2,
typename T3,
typename T4>
415 Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4)
417 return CompleteConstruct (
new T (a1,a2,a3,a4));
420 template <
typename T,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
421 Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
423 return CompleteConstruct (
new T (a1,a2,a3,a4,a5));
426 template <
typename T,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6>
427 Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
429 return CompleteConstruct (
new T (a1,a2,a3,a4,a5,a6));
432 template <
typename T,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7>
433 Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
435 return CompleteConstruct (
new T (a1,a2,a3,a4,a5,a6,a7));
smart pointer class similar to boost::intrusive_ptr
virtual TypeId GetInstanceTypeId(void) const
uint32_t m_getObjectCount
#define NS_ASSERT(condition)
struct Aggregates * m_aggregates
virtual void DoDispose(void)
Ptr< const Object > Next(void)
void SetTypeId(TypeId tid)
friend Ptr< T > CopyObject(Ptr< T > object)
void AggregateObject(Ptr< Object > other)
virtual void NotifyNewAggregate(void)
AggregateIterator GetAggregateIterator(void) const
instantiate subclasses of ns3::Object.
Ptr< T > CopyObject(Ptr< const T > object)
void Construct(const AttributeConstructionList &attributes)
a base class which provides memory management and object aggregation
Ptr< T > GetObject(void) const
A template-based reference counting class.
a unique identifier for an interface.
Iterate over the objects aggregated to an ns3::Object.
virtual void DoInitialize(void)