179 explicit TypeId (
const char * name);
225 std::string
GetName (
void)
const;
239 std::size_t
GetSize (
void)
const;
318 template <typename T>
356 template <typename T>
383 const AttributeValue &initialValue,
384 Ptr<const AttributeAccessor> accessor,
385 Ptr<const AttributeChecker> checker,
386 SupportLevel supportLevel = SUPPORTED,
387 const std::string &supportMsg = "");
397 Ptr<const AttributeValue> initialValue);
424 const AttributeValue &initialValue,
425 Ptr<const AttributeAccessor> accessor,
426 Ptr<const AttributeChecker> checker,
427 SupportLevel supportLevel = SUPPORTED,
428 const std::string &supportMsg = "");
454 Ptr<const TraceSourceAccessor> accessor,
455 std::string callback,
456 SupportLevel supportLevel = SUPPORTED,
457 const std::string &supportMsg = "");
507 uint16_t
GetUid (void) const;
520 void
SetUid (uint16_t uid);
528 inline
TypeId (const TypeId &o);
534 inline
TypeId &operator = (const TypeId &o);
544 friend inline bool operator == (TypeId a, TypeId b);
545 friend inline bool operator != (TypeId a, TypeId b);
546 friend bool operator < (TypeId a, TypeId b);
553 explicit TypeId (uint16_t tid);
559 void DoAddConstructor (Callback<ObjectBase *> callback);
573 std::ostream & operator << (std::ostream &os, TypeId tid);
581 std::istream & operator >> (std::istream &is, TypeId &tid);
590 inline bool operator == (TypeId a, TypeId b);
591 inline bool operator != (TypeId a, TypeId b);
592 bool operator < (TypeId a, TypeId b);
595 ATTRIBUTE_HELPER_HEADER (TypeId);
604 TypeId::TypeId (const TypeId &o)
607 TypeId &TypeId::operator = (const TypeId &o)
614 inline bool operator == (TypeId a, TypeId b)
616 return a.m_tid == b.m_tid;
619 inline bool operator != (TypeId a, TypeId b)
621 return a.m_tid != b.m_tid;
629 template <typename T>
631 TypeId::SetParent (void)
633 return SetParent (T::GetTypeId ());
636 template <typename T>
638 TypeId::AddConstructor (void)
642 static ObjectBase * Create ()
644 ObjectBase * base = new T ();
648 Callback<ObjectBase *> cb = MakeCallback (&Maker::Create);
649 DoAddConstructor (cb);
ns3::MakeAccessorHelper declarations and template implementations.
Attribute helper (ATTRIBUTE_ )macros definition.
ns3::AttributeValue, ns3::AttributeAccessor and ns3::AttributeChecker declarations.
Declaration of the various callback functions.
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
bool IsChildOf(TypeId other) const
Check if this TypeId is a child of another.
TypeId AddConstructor(void)
Record in this TypeId the fact that the default constructor is accessible.
bool SetAttributeInitialValue(std::size_t i, Ptr< const AttributeValue > initialValue)
Set the initial value of an Attribute.
std::size_t GetTraceSourceN(void) const
Get the number of Trace sources.
TypeId SetParent(void)
Set the parent TypeId.
static TypeId LookupByName(std::string name)
Get a TypeId by name.
std::size_t GetAttributeN(void) const
Get the number of attributes.
TypeId SetSize(std::size_t size)
Set the size of this type.
bool HasParent(void) const
Check if this TypeId has a parent.
TypeId AddTraceSource(std::string name, std::string help, Ptr< const TraceSourceAccessor > accessor, std::string callback, SupportLevel supportLevel=SUPPORTED, const std::string &supportMsg="")
Record a new TraceSource.
struct TypeId::TraceSourceInformation GetTraceSource(std::size_t i) const
Get the trace source by index.
AttributeFlag
Flags describing when a given attribute can be read or written.
@ ATTR_GET
The attribute can be read.
@ ATTR_SGC
The attribute can be read, and written at any time.
@ ATTR_SET
The attribute can be written.
@ ATTR_CONSTRUCT
The attribute can be written at construction-time.
static bool LookupByHashFailSafe(hash_t hash, TypeId *tid)
Get a TypeId by hash.
static uint16_t GetRegisteredN(void)
Get the number of registered TypeIds.
uint16_t GetUid(void) const
Get the internal id of this TypeId.
hash_t GetHash(void) const
Get the hash.
Callback< ObjectBase * > GetConstructor(void) const
Get the constructor callback.
std::string GetAttributeFullName(std::size_t i) const
Get the Attribute name by index.
struct TypeId::AttributeInformation GetAttribute(std::size_t i) const
Get Attribute information by index.
std::string GetGroupName(void) const
Get the group name.
void SetUid(uint16_t uid)
Set the internal id of this TypeId.
TypeId SetGroupName(std::string groupName)
Set the group name.
static TypeId LookupByHash(hash_t hash)
Get a TypeId by hash.
static TypeId GetRegistered(uint16_t i)
Get a TypeId by index.
bool HasConstructor(void) const
Check if this TypeId has a constructor.
Ptr< const TraceSourceAccessor > LookupTraceSourceByName(std::string name) const
Find a TraceSource by name.
TypeId HideFromDocumentation(void)
Hide this TypeId from documentation.
bool MustHideFromDocumentation(void) const
Check if this TypeId should not be listed in documentation.
uint32_t hash_t
Type of hash values.
TypeId()
Default constructor.
TypeId GetParent(void) const
Get the parent of this TypeId.
std::string GetName(void) const
Get the name.
std::size_t GetSize(void) const
Get the size of this object.
bool LookupAttributeByName(std::string name, struct AttributeInformation *info) const
Find an Attribute by name, retrieving the associated AttributeInformation.
static bool LookupByNameFailSafe(std::string name, TypeId *tid)
Get a TypeId by name.
SupportLevel
The level of support or deprecation for attributes or trace sources.
@ SUPPORTED
Attribute or trace source is currently used.
@ OBSOLETE
Attribute or trace source is not used anymore; simulation fails.
@ DEPRECATED
Attribute or trace source is deprecated; user is warned.
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.
NS_DEPRECATED macro definition.
ns3::Hasher, ns3::Hash32() and ns3::Hash64() function declarations.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::TraceSourceAccessor and ns3::MakeTraceSourceAccessor declarations.