ns3::TypeId Class Reference
a unique identifier for an interface.
More...
#include <type-id.h>
List of all members.
|
Classes |
struct | AttributeInfo |
| store together a set of attribute properties. More...
|
Public Types |
enum | AttributeFlag { ATTR_GET = 1<<0,
ATTR_SET = 1<<1,
ATTR_CONSTRUCT = 1<<2
} |
Public Member Functions |
| TypeId (const char *name) |
TypeId | GetParent (void) const |
bool | IsChildOf (TypeId other) const |
std::string | GetGroupName (void) const |
std::string | GetName (void) const |
bool | HasConstructor (void) const |
uint32_t | GetAttributeN (void) const |
std::string | GetAttributeName (uint32_t i) const |
std::string | GetAttributeHelp (uint32_t i) const |
std::string | GetAttributeFullName (uint32_t i) const |
Ptr< const AttributeValue > | GetAttributeInitialValue (uint32_t i) const |
uint32_t | GetAttributeFlags (uint32_t i) const |
Ptr< const AttributeChecker > | GetAttributeChecker (uint32_t i) const |
Ptr< const AttributeAccessor > | GetAttributeAccessor (uint32_t i) const |
Callback< ObjectBase * > | GetConstructor (void) const |
bool | MustHideFromDocumentation (void) const |
uint32_t | GetTraceSourceN (void) const |
std::string | GetTraceSourceName (uint32_t i) const |
std::string | GetTraceSourceHelp (uint32_t i) const |
Ptr< const TraceSourceAccessor > | GetTraceSourceAccessor (uint32_t i) const |
TypeId | SetParent (TypeId tid) |
template<typename T > |
TypeId | SetParent (void) |
TypeId | SetGroupName (std::string groupName) |
template<typename T > |
TypeId | AddConstructor (void) |
TypeId | AddAttribute (std::string name, std::string help, const AttributeValue &initialValue, Ptr< const AttributeAccessor > accessor, Ptr< const AttributeChecker > checker) |
TypeId | AddAttribute (std::string name, std::string help, uint32_t flags, const AttributeValue &initialValue, Ptr< const AttributeAccessor > accessor, Ptr< const AttributeChecker > checker) |
TypeId | AddTraceSource (std::string name, std::string help, Ptr< const TraceSourceAccessor > accessor) |
bool | LookupAttributeByName (std::string name, struct AttributeInfo *info) const |
Ptr< const TraceSourceAccessor > | LookupTraceSourceByName (std::string name) const |
uint16_t | GetUid (void) const |
void | SetUid (uint16_t tid) |
Static Public Member Functions |
static TypeId | LookupByName (std::string name) |
static bool | LookupByNameFailSafe (std::string name, TypeId *tid) |
static uint32_t | GetRegisteredN (void) |
static TypeId | GetRegistered (uint32_t i) |
static bool | LookupAttributeByFullName (std::string fullName, struct AttributeInfo *info) |
Detailed Description
a unique identifier for an interface.
This class records a lot of meta-information about a subclass of the Object base class:
- the base class of the subclass
- the set of accessible constructors in the subclass
- the set of 'attributes' accessible in the subclass
Member Enumeration Documentation
Flags describing when a given attribute can be read or written
- Enumerator:
-
ATTR_GET |
The attribute can be read |
ATTR_SET |
The attribute can be written |
ATTR_CONSTRUCT |
The attribute can be written at construction-time |
Constructor & Destructor Documentation
ns3::TypeId::TypeId |
( |
const char * |
name |
) |
[explicit] |
- Parameters:
-
| name | the name of the interface to construct. |
No two instances can share the same name. The name is expected to be the full c++ typename of associated c++ object.
Member Function Documentation
- Parameters:
-
| name | the name of the new attribute |
| help | some help text which describes the purpose of this attribute |
| flags | flags which describe how this attribute can be read and/or written. |
| initialValue | the initial value for this attribute. |
| accessor | an instance of the associated AttributeAccessor subclass. |
| checker | an instance of the associated AttributeChecker subclass. |
- Returns:
- this TypeId instance
Record in this
TypeId the fact that a new attribute exists.
- Parameters:
-
| name | the name of the new attribute |
| help | some help text which describes the purpose of this attribute. |
| initialValue | the initial value for this attribute. |
| accessor | an instance of the associated AttributeAccessor subclass. |
| checker | an instance of the associated AttributeChecker subclass. |
- Returns:
- this TypeId instance
Record in this
TypeId the fact that a new attribute exists.
template<typename T >
TypeId ns3::TypeId::AddConstructor |
( |
void |
|
) |
[inline] |
- Parameters:
-
| name | the name of the new trace source |
| help | some help text which describes the purpose of this trace source. |
| accessor | a pointer to a TraceSourceAccessor which can be used to connect/disconnect sinks to this trace source. |
- Returns:
- this TypeId instance.
- Parameters:
-
| i | index into attribute array. |
- Returns:
- the accessor associated to the requested attribute.
- Parameters:
-
| i | index into attribute array. |
- Returns:
- the checker associated to the requested attribute.
uint32_t ns3::TypeId::GetAttributeFlags |
( |
uint32_t |
i |
) |
const |
- Parameters:
-
| i | index into attribute array. |
- Returns:
- the flags associated to the requested attribute.
std::string ns3::TypeId::GetAttributeFullName |
( |
uint32_t |
i |
) |
const |
- Parameters:
-
| i | index into attribute array |
- Returns:
- the full name associated to the attribute whose index is i.
std::string ns3::TypeId::GetAttributeHelp |
( |
uint32_t |
i |
) |
const |
- Parameters:
-
| i | index into attribute array. |
- Returns:
- the help text associated to the attribute whose index is i.
- Parameters:
-
| i | index into attribute array. |
- Returns:
- the value with which the associated attribute is initialized.
uint32_t ns3::TypeId::GetAttributeN |
( |
void |
|
) |
const |
- Returns:
- the number of attributes associated to this TypeId
std::string ns3::TypeId::GetAttributeName |
( |
uint32_t |
i |
) |
const |
- Parameters:
-
| i | index into attribute array |
- Returns:
- the name associated to the attribute whose index is i.
- Returns:
- a callback which can be used to instanciate an object of this type.
std::string ns3::TypeId::GetGroupName |
( |
void |
|
) |
const |
- Returns:
- the name of the group associated to this TypeId.
std::string ns3::TypeId::GetName |
( |
void |
|
) |
const |
- Returns:
- the name of this interface.
TypeId ns3::TypeId::GetParent |
( |
void |
|
) |
const |
- Returns:
- the parent of this TypeId
This method cannot fail. It will return itself if this
TypeId has no parent. i.e., it is at the top of the
TypeId hierarchy. Currently, this is the case for the
TypeId associated to the
Object class only.
static TypeId ns3::TypeId::GetRegistered |
( |
uint32_t |
i |
) |
[static] |
- Parameters:
-
- Returns:
- the TypeId instance whose index is i.
static uint32_t ns3::TypeId::GetRegisteredN |
( |
void |
|
) |
[static] |
- Returns:
- the number of TypeId instances registered.
- Parameters:
-
| i | index into trace source array. |
- Returns:
- the accessor used to get access to the requested trace source.
std::string ns3::TypeId::GetTraceSourceHelp |
( |
uint32_t |
i |
) |
const |
- Parameters:
-
| i | index into trace source array. |
- Returns:
- the help text of the requested trace source.
uint32_t ns3::TypeId::GetTraceSourceN |
( |
void |
|
) |
const |
- Returns:
- the number of trace sources defined in this TypeId.
std::string ns3::TypeId::GetTraceSourceName |
( |
uint32_t |
i |
) |
const |
- Parameters:
-
| i | index into trace source array. |
- Returns:
- the name of the requested trace source.
uint16_t ns3::TypeId::GetUid |
( |
void |
|
) |
const |
- Returns:
- the internal integer which uniquely identifies this TypeId.
This is really an internal method which users are not expected to use.
bool ns3::TypeId::HasConstructor |
( |
void |
|
) |
const |
- Returns:
- true if this TypeId has a constructor
bool ns3::TypeId::IsChildOf |
( |
TypeId |
other |
) |
const |
- Parameters:
-
- Returns:
- true if the input TypeId is really a parent of this TypeId, false otherwise.
Calling this method is roughly similar to calling dynamic_cast except that you do not need object instances: you can do the check with
TypeId instances instead.
static bool ns3::TypeId::LookupAttributeByFullName |
( |
std::string |
fullName, |
|
|
struct AttributeInfo * |
info | |
|
) |
| | [static] |
- Parameters:
-
| fullName | the full name of the requested attribute |
| info | a pointer to the TypeId::AttributeInfo data structure where the result value of this method will be stored. |
- Returns:
- the Accessor associated to the requested attribute
bool ns3::TypeId::LookupAttributeByName |
( |
std::string |
name, |
|
|
struct AttributeInfo * |
info | |
|
) |
| | const |
- Parameters:
-
| name | the name of the requested attribute |
| info | a pointer to the TypeId::AttributeInfo data structure where the result value of this method will be stored. |
- Returns:
- true if the requested attribute could be found, false otherwise.
static TypeId ns3::TypeId::LookupByName |
( |
std::string |
name |
) |
[static] |
- Parameters:
-
| name | the name of the requested TypeId |
- Returns:
- the unique id associated with the requested name.
This method cannot fail: it will crash if the input name is not a valid
TypeId name.
static bool ns3::TypeId::LookupByNameFailSafe |
( |
std::string |
name, |
|
|
TypeId * |
tid | |
|
) |
| | [static] |
- Parameters:
-
| name | the name of the requested TypeId |
| tid | a pointer to the TypeId instance where the result of this function should be stored. |
- Returns:
- true if the requested name was found, false otherwise.
- Parameters:
-
| name | the name of the requested trace source |
- Returns:
- the trace source accessor which can be used to connect and disconnect trace sinks with the requested trace source on an object instance.
If no matching trace source is found, this method returns zero.
bool ns3::TypeId::MustHideFromDocumentation |
( |
void |
|
) |
const |
- Returns:
- true if this TypeId should be hidden from the user, false otherwise.
TypeId ns3::TypeId::SetGroupName |
( |
std::string |
groupName |
) |
|
- Parameters:
-
| groupName | the name of the group this TypeId belongs to. |
- Returns:
- this TypeId instance.
The group name is purely an advisory information used to group together types according to a user-specific grouping scheme.
template<typename T >
TypeId ns3::TypeId::SetParent |
( |
void |
|
) |
[inline] |
- Parameters:
-
| tid | the TypeId of the base class. |
- Returns:
- this TypeId instance.
Record in this
TypeId which
TypeId is the
TypeId of the base class of the subclass.
void ns3::TypeId::SetUid |
( |
uint16_t |
tid |
) |
|
- Parameters:
-
| tid | the internal integer which uniquely identifies this TypeId. |
This method is even more internal than
TypeId::GetUid. Use at your own risk and don't be surprised that it eats raw babies on full-moon nights.
The documentation for this class was generated from the following file: