176 explicit TypeId (
const char * name);
222 std::string
GetName (
void)
const;
236 std::size_t
GetSize (
void)
const;
315 template <typename T>
353 template <typename T>
380 const AttributeValue &initialValue,
381 Ptr<const AttributeAccessor> accessor,
382 Ptr<const AttributeChecker> checker,
383 SupportLevel supportLevel = SUPPORTED,
384 const std::string &supportMsg = "");
394 Ptr<const AttributeValue> initialValue);
421 const AttributeValue &initialValue,
422 Ptr<const AttributeAccessor> accessor,
423 Ptr<const AttributeChecker> checker,
424 SupportLevel supportLevel = SUPPORTED,
425 const std::string &supportMsg = "");
441 Ptr<const TraceSourceAccessor> accessor);
467 Ptr<const TraceSourceAccessor> accessor,
468 std::string callback,
469 SupportLevel supportLevel = SUPPORTED,
470 const std::string &supportMsg = "");
520 uint16_t
GetUid (void) const;
533 void
SetUid (uint16_t uid);
541 inline
TypeId (const TypeId &o);
547 inline
TypeId &operator = (const TypeId &o);
557 friend inline bool operator == (TypeId a, TypeId b);
558 friend inline bool operator != (TypeId a, TypeId b);
559 friend bool operator < (TypeId a, TypeId b);
566 explicit TypeId (uint16_t tid);
572 void DoAddConstructor (Callback<ObjectBase *> callback);
586 std::ostream & operator << (std::ostream &os, TypeId tid);
594 std::istream & operator >> (std::istream &is, TypeId &tid);
603 inline bool operator == (TypeId a, TypeId b);
604 inline bool operator != (TypeId a, TypeId b);
605 bool operator < (TypeId a, TypeId b);
608 ATTRIBUTE_HELPER_HEADER (TypeId);
617 TypeId::TypeId (const TypeId &o)
620 TypeId &TypeId::operator = (const TypeId &o)
628 inline bool operator == (TypeId a, TypeId b)
630 return a.m_tid == b.m_tid;
633 inline bool operator != (TypeId a, TypeId b)
635 return a.m_tid != b.m_tid;
643 template <typename T>
645 TypeId::SetParent (void)
647 return SetParent (T::GetTypeId ());
650 template <typename T>
652 TypeId::AddConstructor (void)
655 static ObjectBase * Create () {
656 ObjectBase * base = new T ();
660 Callback<ObjectBase *> cb = MakeCallback (&Maker::Create);
661 DoAddConstructor (cb);
bool IsChildOf(TypeId other) const
Check if this TypeId is a child of another.
uint32_t hash_t
Type of hash values.
Callback< ObjectBase * > GetConstructor(void) const
Get the constructor callback.
std::string GetName(void) const
Get the name.
hash_t GetHash(void) const
Get the hash.
TypeId AddAttribute(std::string name, std::string help, const AttributeValue &initialValue, Ptr< const AttributeAccessor > accessor, Ptr< const AttributeChecker > checker, SupportLevel supportLevel=SUPPORTED, const std::string &supportMsg="")
Record in this TypeId the fact that a new attribute exists.
Smart pointer class similar to boost::intrusive_ptr.
Ptr< const TraceSourceAccessor > LookupTraceSourceByName(std::string name) const
Find a TraceSource by name.
TypeId AddConstructor(void)
Record in this TypeId the fact that the default constructor is accessible.
bool HasConstructor(void) const
Check if this TypeId has a constructor.
TypeId SetParent(void)
Set the parent TypeId.
static TypeId LookupByHash(hash_t hash)
Get a TypeId by hash.
static TypeId GetRegistered(uint16_t i)
Get a TypeId by index.
static bool LookupByNameFailSafe(std::string name, TypeId *tid)
Get a TypeId by name.
The attribute can be written at construction-time.
NS_DEPRECATED macro definition.
bool LookupAttributeByName(std::string name, struct AttributeInformation *info) const
Find an Attribute by name, retrieving the associated AttributeInformation.
bool HasParent(void) const
Check if this TypeId has a parent.
ns3::Hasher, ns3::Hash32() and ns3::Hash64() function declarations.
The attribute can be read, and written at any time.
std::size_t GetTraceSourceN(void) const
Get the number of Trace sources.
bool SetAttributeInitialValue(std::size_t i, Ptr< const AttributeValue > initialValue)
Set the initial value of an Attribute.
TypeId GetParent(void) const
Get the parent of this TypeId.
static bool LookupByHashFailSafe(hash_t hash, TypeId *tid)
Get a TypeId by hash.
The attribute can be read.
Declaration of the various callback functions.
ns3::AttributeValue, ns3::AttributeAccessor and ns3::AttributeChecker declarations.
TypeId()
Default constructor.
bool MustHideFromDocumentation(void) const
Check if this TypeId should not be listed in documentation.
struct TypeId::TraceSourceInformation GetTraceSource(std::size_t i) const
Get the trace source by index.
TypeId SetGroupName(std::string groupName)
Set the group name.
uint16_t GetUid(void) const
Get the internal id of this TypeId.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::TraceSourceAccessor and ns3::MakeTraceSourceAccessor declarations.
std::string GetGroupName(void) const
Get the group name.
std::size_t GetSize(void) const
Get the size of this object.
The attribute can be written.
std::string GetAttributeFullName(std::size_t i) const
Get the Attribute name by index.
AttributeFlag
Flags describing when a given attribute can be read or written.
Attribute or trace source is currently used.
void SetUid(uint16_t uid)
Set the internal id of this TypeId.
Attribute helper (ATTRIBUTE_ )macros definition.
NS_DEPRECATED TypeId AddTraceSource(std::string name, std::string help, Ptr< const TraceSourceAccessor > accessor)
Record a new TraceSource.
Attribute or trace source is not used anymore; simulation fails.
#define NS_DEPRECATED
Mark a function as deprecated.
std::size_t GetAttributeN(void) const
Get the number of attributes.
struct TypeId::AttributeInformation GetAttribute(std::size_t i) const
Get Attribute information by index.
TypeId SetSize(std::size_t size)
Set the size of this type.
ns3::MakeAccessorHelper declarations and template implementations.
Attribute or trace source is deprecated; user is warned.
SupportLevel
The level of support or deprecation for attributes or trace sources.
static uint16_t GetRegisteredN(void)
Get the number of registered TypeIds.
a unique identifier for an interface.
TypeId HideFromDocumentation(void)
Hide this TypeId from documentation.
static TypeId LookupByName(std::string name)
Get a TypeId by name.