183 explicit TypeId(
const std::string& name);
321 template <typename T>
359 template <typename T>
386 const AttributeValue& initialValue,
387 Ptr<const AttributeAccessor> accessor,
388 Ptr<const AttributeChecker> checker,
389 SupportLevel supportLevel = SUPPORTED,
390 const std::string& supportMsg = "");
426 const AttributeValue& initialValue,
427 Ptr<const AttributeAccessor> accessor,
428 Ptr<const AttributeChecker> checker,
429 SupportLevel supportLevel = SUPPORTED,
430 const std::string& supportMsg = "");
456 Ptr<const TraceSourceAccessor> accessor,
457 std::string callback,
458 SupportLevel supportLevel = SUPPORTED,
459 const std::string& supportMsg = "");
501 struct TraceSourceInformation* info) const;
524 void
SetUid(uint16_t uid);
532 inline
TypeId(const TypeId& o);
538 inline
TypeId& operator=(const TypeId& o);
548 friend inline bool operator==(TypeId a, TypeId b);
549 friend inline bool operator!=(TypeId a, TypeId b);
550 friend bool operator<(TypeId a, TypeId b);
557 explicit TypeId(uint16_t tid);
563 void DoAddConstructor(Callback<ObjectBase*> callback);
577std::ostream& operator<<(std::ostream& os, TypeId tid);
585std::istream& operator>>(std::istream& is, TypeId& tid);
594inline bool operator==(TypeId a, TypeId b);
595inline bool operator!=(TypeId a, TypeId b);
596bool operator<(TypeId a, TypeId b);
599ATTRIBUTE_HELPER_HEADER(TypeId);
611TypeId::TypeId(const TypeId& o)
617TypeId::operator=(const TypeId& o)
628operator==(TypeId a, TypeId b)
630 return a.m_tid == b.m_tid;
634operator!=(TypeId a, TypeId b)
636 return a.m_tid != b.m_tid;
647 return SetParent(T::GetTypeId());
652TypeId::AddConstructor()
656 static ObjectBase* Create()
658 ObjectBase* base = new T();
663 Callback<ObjectBase*> cb = MakeCallback(&Maker::Create);
664 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.
std::size_t GetTraceSourceN() const
Get the number of Trace sources.
bool SetAttributeInitialValue(std::size_t i, Ptr< const AttributeValue > initialValue)
Set the initial value of an Attribute.
static TypeId LookupByName(std::string name)
Get a TypeId by name.
bool HasParent() const
Check if this TypeId has a parent.
TypeId SetSize(std::size_t size)
Set the size of this type.
hash_t GetHash() const
Get the hash.
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.
bool MustHideFromDocumentation() const
Check if this TypeId should not be listed in documentation.
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.
std::string GetGroupName() const
Get the group name.
TypeId HideFromDocumentation()
Hide this TypeId from documentation.
Callback< ObjectBase * > GetConstructor() const
Get the constructor callback.
static uint16_t GetRegisteredN()
Get the number of registered TypeIds.
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.
bool HasConstructor() const
Check if this TypeId has a constructor.
std::size_t GetAttributeN() const
Get the number of attributes.
TypeId GetParent() const
Get the parent of this TypeId.
TypeId AddConstructor()
Record in this TypeId the fact that the default constructor is accessible.
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.
std::size_t GetSize() const
Get the size of this object.
Ptr< const TraceSourceAccessor > LookupTraceSourceByName(std::string name) const
Find a TraceSource by name.
uint32_t hash_t
Type of hash values.
TypeId()
Default constructor.
uint16_t GetUid() const
Get the internal id of this TypeId.
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.
std::string GetName() const
Get the name.
TypeId SetParent()
Set the parent TypeId.
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.