a unique identifier for an interface. More...
#include <type-id.h>
Classes | |
struct | AttributeInformation |
struct | TraceSourceInformation |
Public Types | |
enum | AttributeFlag { ATTR_GET = 1<<0, ATTR_SET = 1<<1, ATTR_CONSTRUCT = 1<<2, ATTR_SGC = ATTR_GET | ATTR_SET | ATTR_CONSTRUCT } |
Public Member Functions | |
TypeId (const char *name) | |
TypeId (const TypeId &o) | |
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) |
template<typename T > | |
TypeId | AddConstructor (void) |
TypeId | AddTraceSource (std::string name, std::string help, Ptr< const TraceSourceAccessor > accessor) |
struct TypeId::AttributeInformation | GetAttribute (uint32_t i) const |
std::string | GetAttributeFullName (uint32_t i) const |
uint32_t | GetAttributeN (void) const |
Callback< ObjectBase * > | GetConstructor (void) const |
std::string | GetGroupName (void) const |
std::string | GetName (void) const |
TypeId | GetParent (void) const |
struct TypeId::TraceSourceInformation | GetTraceSource (uint32_t i) const |
uint32_t | GetTraceSourceN (void) const |
uint16_t | GetUid (void) const |
bool | HasConstructor (void) const |
bool | HasParent (void) const |
TypeId | HideFromDocumentation (void) |
bool | IsChildOf (TypeId other) const |
bool | LookupAttributeByName (std::string name, struct AttributeInformation *info) const |
Ptr< const TraceSourceAccessor > | LookupTraceSourceByName (std::string name) const |
bool | MustHideFromDocumentation (void) const |
TypeId & | operator= (const TypeId &o) |
bool | SetAttributeInitialValue (uint32_t i, Ptr< const AttributeValue > initialValue) |
TypeId | SetGroupName (std::string groupName) |
TypeId | SetParent (TypeId tid) |
template<typename T > | |
TypeId | SetParent (void) |
void | SetUid (uint16_t tid) |
Static Public Member Functions | |
static TypeId | GetRegistered (uint32_t i) |
static uint32_t | GetRegisteredN (void) |
static TypeId | LookupByName (std::string name) |
static bool | LookupByNameFailSafe (std::string name, TypeId *tid) |
Private Member Functions | |
TypeId (uint16_t tid) | |
void | DoAddConstructor (Callback< ObjectBase * > callback) |
Private Attributes | |
uint16_t | m_tid |
Friends | |
class | AttributeList |
bool | operator!= (TypeId a, TypeId b) |
bool | operator< (TypeId a, TypeId b) |
bool | operator== (TypeId a, TypeId b) |
a unique identifier for an interface.
This class records a lot of meta-information about a subclass of the Object base class:
|
explicit |
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.
Definition at line 400 of file type-id.cc.
References NS_ASSERT, and NS_LOG_FUNCTION.
TypeId ns3::TypeId::AddAttribute | ( | std::string | name, |
std::string | help, | ||
const AttributeValue & | initialValue, | ||
Ptr< const AttributeAccessor > | accessor, | ||
Ptr< const AttributeChecker > | checker | ||
) |
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. |
Record in this TypeId the fact that a new attribute exists.
Definition at line 541 of file type-id.cc.
References ATTR_SGC, ns3::AttributeValue::Copy(), and NS_LOG_FUNCTION.
Referenced by ns3::Ns3NscStack::GetInstanceTypeId().
TypeId ns3::TypeId::AddAttribute | ( | std::string | name, |
std::string | help, | ||
uint32_t | flags, | ||
const AttributeValue & | initialValue, | ||
Ptr< const AttributeAccessor > | accessor, | ||
Ptr< const AttributeChecker > | checker | ||
) |
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. |
Record in this TypeId the fact that a new attribute exists.
Definition at line 553 of file type-id.cc.
References ns3::AttributeValue::Copy(), and NS_LOG_FUNCTION.
TypeId ns3::TypeId::AddConstructor | ( | void | ) |
Record in this TypeId the fact that the default constructor is accessible.
Definition at line 388 of file type-id.h.
References ns3::MakeCallback().
Referenced by ns3::Ipv6ExtensionHeader::GetTypeId(), ns3::Ipv6OptionHeader::GetTypeId(), ns3::dsr::DsrOptionHeader::GetTypeId(), ns3::dsr::DsrFsHeader::GetTypeId(), ns3::dsr::DsrOptionPad1Header::GetTypeId(), ns3::Ipv6OptionPad1Header::GetTypeId(), ns3::dsr::DsrOptionPadnHeader::GetTypeId(), ns3::Ipv6OptionPadnHeader::GetTypeId(), ns3::Ipv6ExtensionHopByHopHeader::GetTypeId(), ns3::Ipv6OptionJumbogramHeader::GetTypeId(), ns3::dsr::DsrOptionRreqHeader::GetTypeId(), ns3::Ipv6ExtensionDestinationHeader::GetTypeId(), ns3::dsr::DsrRoutingHeader::GetTypeId(), ns3::Ipv6ExtensionFragmentHeader::GetTypeId(), ns3::Ipv6OptionRouterAlertHeader::GetTypeId(), ns3::Ipv6ExtensionRoutingHeader::GetTypeId(), ns3::dsr::DsrOptionRrepHeader::GetTypeId(), ns3::Ipv6ExtensionLooseRoutingHeader::GetTypeId(), ns3::dsr::DsrOptionSRHeader::GetTypeId(), ns3::Ipv6ExtensionESPHeader::GetTypeId(), ns3::Ipv6ExtensionAHHeader::GetTypeId(), ns3::dsr::DsrOptionRerrHeader::GetTypeId(), ns3::dsr::DsrOptionRerrUnreachHeader::GetTypeId(), ns3::dsr::DsrOptionRerrUnsupportHeader::GetTypeId(), ns3::dsr::DsrOptionAckReqHeader::GetTypeId(), and ns3::dsr::DsrOptionAckHeader::GetTypeId().
TypeId ns3::TypeId::AddTraceSource | ( | std::string | name, |
std::string | help, | ||
Ptr< const TraceSourceAccessor > | accessor | ||
) |
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. |
Definition at line 626 of file type-id.cc.
References NS_LOG_FUNCTION.
struct TypeId::AttributeInformation ns3::TypeId::GetAttribute | ( | uint32_t | i | ) | const |
i | index into attribute array |
Definition at line 599 of file type-id.cc.
References NS_LOG_FUNCTION.
Referenced by ns3::cell_tooltip_callback(), ns3::cell_tooltip_callback_config_default(), ns3::ObjectBase::ConstructSelf(), StaticInformation::DoGather(), GetAttributeFullName(), ns3::AttributeDefaultIterator::Iterate(), LookupAttributeByName(), ns3::Config::Reset(), and ns3::Config::SetDefaultFailSafe().
std::string ns3::TypeId::GetAttributeFullName | ( | uint32_t | i | ) | const |
i | index into attribute array |
Definition at line 605 of file type-id.cc.
References GetAttribute(), GetName(), and NS_LOG_FUNCTION.
Referenced by ns3::cell_edited_callback_config_default(), and ns3::ObjectBase::ConstructSelf().
uint32_t ns3::TypeId::GetAttributeN | ( | void | ) | const |
Definition at line 592 of file type-id.cc.
References NS_LOG_FUNCTION.
Referenced by ns3::cell_tooltip_callback(), ns3::ObjectBase::ConstructSelf(), StaticInformation::DoGather(), ns3::AttributeDefaultIterator::Iterate(), LookupAttributeByName(), ns3::Packet::Print(), ns3::Config::Reset(), and ns3::Config::SetDefaultFailSafe().
Callback< ObjectBase * > ns3::TypeId::GetConstructor | ( | void | ) | const |
Definition at line 576 of file type-id.cc.
References NS_LOG_FUNCTION.
Referenced by ns3::ObjectFactory::Create(), ns3::Packet::Print(), ns3::Packet::PrintByteTags(), and ns3::Packet::PrintPacketTags().
std::string ns3::TypeId::GetGroupName | ( | void | ) | const |
Definition at line 510 of file type-id.cc.
References NS_LOG_FUNCTION.
std::string ns3::TypeId::GetName | ( | void | ) | const |
Definition at line 518 of file type-id.cc.
References NS_LOG_FUNCTION.
Referenced by ns3::Object::AggregateObject(), ns3::cell_data_function_col_0(), ns3::cell_data_function_col_0_config_default(), ns3::cell_tooltip_callback(), ns3::cell_tooltip_callback_config_default(), ns3::ObjectBase::ConstructSelf(), StaticInformation::DoGather(), ns3::LteHelper::EnableLogComponents(), GetAttributeFullName(), ns3::MobilityHelper::GetMobilityModelType(), ns3::internal::APointerChecker< T >::GetUnderlyingTypeInformation(), ns3::MobilityHelper::Install(), ns3::AttributeDefaultIterator::Iterate(), ns3::Packet::Print(), ns3::Packet::PrintByteTags(), ns3::ObjectFactory::Set(), and ns3::ObjectFactory::SetTypeId().
TypeId ns3::TypeId::GetParent | ( | void | ) | const |
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.
Definition at line 485 of file type-id.cc.
References NS_LOG_FUNCTION.
Referenced by ns3::cell_tooltip_callback(), ns3::ObjectBase::ConstructSelf(), IsChildOf(), LookupAttributeByName(), and LookupTraceSourceByName().
|
static |
i | index |
Definition at line 442 of file type-id.cc.
References NS_LOG_FUNCTION.
Referenced by StaticInformation::DoGather(), ns3::AttributeDefaultIterator::Iterate(), and ns3::Config::Reset().
|
static |
Definition at line 436 of file type-id.cc.
References NS_LOG_FUNCTION_NOARGS.
Referenced by StaticInformation::DoGather(), ns3::AttributeDefaultIterator::Iterate(), and ns3::Config::Reset().
struct TypeId::TraceSourceInformation ns3::TypeId::GetTraceSource | ( | uint32_t | i | ) | const |
i | index into trace source array. |
Definition at line 619 of file type-id.cc.
References NS_LOG_FUNCTION.
Referenced by LookupTraceSourceByName().
uint32_t ns3::TypeId::GetTraceSourceN | ( | void | ) | const |
Definition at line 613 of file type-id.cc.
References NS_LOG_FUNCTION.
Referenced by LookupTraceSourceByName().
uint16_t ns3::TypeId::GetUid | ( | void | ) | const |
This is really an internal method which users are not expected to use.
Definition at line 666 of file type-id.cc.
References NS_LOG_FUNCTION.
Referenced by ns3::ByteTagList::Add().
bool ns3::TypeId::HasConstructor | ( | void | ) | const |
Definition at line 526 of file type-id.cc.
References NS_LOG_FUNCTION.
Referenced by ns3::Packet::Print(), and ns3::Packet::PrintPacketTags().
bool ns3::TypeId::IsChildOf | ( | TypeId | other | ) | const |
other | a parent TypeId |
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.
Definition at line 499 of file type-id.cc.
References GetParent(), and NS_LOG_FUNCTION.
Referenced by StaticInformation::DoGather().
bool ns3::TypeId::LookupAttributeByName | ( | std::string | name, |
struct AttributeInformation * | info | ||
) | const |
name | the name of the requested attribute |
info | a pointer to the TypeId::AttributeInformation data structure where the result value of this method will be stored. |
Definition at line 449 of file type-id.cc.
References GetAttribute(), GetAttributeN(), GetParent(), and NS_LOG_FUNCTION.
Referenced by ns3::ObjectFactory::Set().
|
static |
name | the name of the requested TypeId |
This method cannot fail: it will crash if the input name is not a valid TypeId name.
Definition at line 415 of file type-id.cc.
References NS_ASSERT_MSG, and NS_LOG_FUNCTION.
Referenced by ns3::EpcHelper::AddEnb(), ns3::EpcX2::AddX2Interface(), ns3::EpcHelper::EpcHelper(), StaticInformation::RecordAggregationInfo(), ns3::ObjectFactory::SetTypeId(), ns3::V4Ping::StartApplication(), ns3::UdpEchoServer::StartApplication(), ns3::UdpClient::StartApplication(), ns3::UdpServer::StartApplication(), ns3::EpsBearerTagUdpClient::StartApplication(), ns3::Ping6::StartApplication(), ns3::Radvd::StartApplication(), ns3::UdpTraceClient::StartApplication(), ns3::UdpEchoClient::StartApplication(), and ns3::ModelTypeidCreator::StartVisitTypeId().
|
static |
name | the name of the requested TypeId |
tid | a pointer to the TypeId instance where the result of this function should be stored. |
Definition at line 423 of file type-id.cc.
References NS_LOG_FUNCTION.
Referenced by ns3::Ns3NscStack::GetInstanceTypeId(), and ns3::Config::SetDefaultFailSafe().
Ptr< const TraceSourceAccessor > ns3::TypeId::LookupTraceSourceByName | ( | std::string | name | ) | const |
name | the name of the requested trace source |
If no matching trace source is found, this method returns zero.
Definition at line 645 of file type-id.cc.
References GetParent(), GetTraceSource(), GetTraceSourceN(), and NS_LOG_FUNCTION.
Referenced by ns3::ObjectBase::TraceConnect(), ns3::ObjectBase::TraceConnectWithoutContext(), ns3::ObjectBase::TraceDisconnect(), and ns3::ObjectBase::TraceDisconnectWithoutContext().
bool ns3::TypeId::MustHideFromDocumentation | ( | void | ) | const |
Definition at line 584 of file type-id.cc.
References NS_LOG_FUNCTION.
Referenced by ns3::AttributeDefaultIterator::Iterate().
bool ns3::TypeId::SetAttributeInitialValue | ( | uint32_t | i, |
Ptr< const AttributeValue > | initialValue | ||
) |
i | the attribute to manipulate |
initialValue | the new initial value to use for this attribute. |
Definition at line 566 of file type-id.cc.
References NS_LOG_FUNCTION.
Referenced by ns3::Config::Reset(), and ns3::Config::SetDefaultFailSafe().
TypeId ns3::TypeId::SetGroupName | ( | std::string | groupName | ) |
groupName | the name of the group this TypeId belongs to. |
The group name is purely an advisory information used to group together types according to a user-specific grouping scheme.
Definition at line 478 of file type-id.cc.
References NS_LOG_FUNCTION.
tid | the TypeId of the base class. |
Record in this TypeId which TypeId is the TypeId of the base class of the subclass.
Definition at line 471 of file type-id.cc.
References NS_LOG_FUNCTION.
Referenced by ns3::Ns3NscStack::GetInstanceTypeId(), ns3::Dot11sStack::GetTypeId(), ns3::PacketBurst::GetTypeId(), ns3::Ipv6ExtensionDemux::GetTypeId(), ns3::Ipv6OptionDemux::GetTypeId(), ns3::dot11s::PeerLink::GetTypeId(), ns3::MeshL2RoutingProtocol::GetTypeId(), ns3::Icmpv6L4Protocol::GetTypeId(), ns3::Ping6::GetTypeId(), ns3::Ipv6Option::GetTypeId(), ns3::MeshPointDevice::GetTypeId(), ns3::Radvd::GetTypeId(), ns3::Ipv6Extension::GetTypeId(), ns3::Ipv6ListRouting::GetTypeId(), ns3::NdiscCache::GetTypeId(), ns3::Ipv6Interface::GetTypeId(), ns3::MeshWifiInterfaceMac::GetTypeId(), ns3::Ipv4NixVectorRouting::GetTypeId(), ns3::MacStatsCalculator::GetTypeId(), ns3::Ipv6StaticRouting::GetTypeId(), ns3::Ipv6Header::GetTypeId(), ns3::PhyRxStatsCalculator::GetTypeId(), ns3::Ipv6L3Protocol::GetTypeId(), ns3::PhyTxStatsCalculator::GetTypeId(), ns3::PhyStatsCalculator::GetTypeId(), ns3::Ipv6RawSocketFactory::GetTypeId(), ns3::Ipv6RawSocketImpl::GetTypeId(), ns3::dsr::GraReply::GetTypeId(), ns3::dsr::DsrOptions::GetTypeId(), ns3::RadioBearerStatsCalculator::GetTypeId(), ns3::dsr::DsrRouting::GetTypeId(), ns3::Ipv6OptionPad1::GetTypeId(), ns3::Icmpv6Header::GetTypeId(), ns3::dsr::RreqTable::GetTypeId(), ns3::Ipv6OptionPadn::GetTypeId(), ns3::Ipv6ExtensionHopByHop::GetTypeId(), ns3::dsr::PassiveBuffer::GetTypeId(), ns3::Ipv6OptionJumbogram::GetTypeId(), ns3::Ipv6ExtensionDestination::GetTypeId(), ns3::Icmpv6OptionHeader::GetTypeId(), ns3::dsr::DsrOptionPad1::GetTypeId(), ns3::Ipv6OptionRouterAlert::GetTypeId(), ns3::Ipv6ExtensionFragment::GetTypeId(), ns3::dsr::DsrOptionPadn::GetTypeId(), ns3::dsr::RouteCache::GetTypeId(), ns3::dsr::DsrOptionRreq::GetTypeId(), ns3::Icmpv6NS::GetTypeId(), ns3::dsr::DsrOptionRrep::GetTypeId(), ns3::Ipv6ExtensionRouting::GetTypeId(), ns3::Icmpv6NA::GetTypeId(), ns3::dsr::DsrOptionSR::GetTypeId(), ns3::Ipv6ExtensionRoutingDemux::GetTypeId(), ns3::dsr::DsrOptionRerr::GetTypeId(), ns3::Ipv6ExtensionLooseRouting::GetTypeId(), ns3::GlobalRouter::GetTypeId(), ns3::Icmpv6RA::GetTypeId(), ns3::dsr::DsrOptionAckReq::GetTypeId(), ns3::Ipv6ExtensionESP::GetTypeId(), ns3::dsr::DsrOptionAck::GetTypeId(), ns3::Ipv6ExtensionAH::GetTypeId(), ns3::AnimByteTag::GetTypeId(), ns3::Icmpv6RS::GetTypeId(), ns3::Icmpv6Redirection::GetTypeId(), ns3::Icmpv6Echo::GetTypeId(), ns3::Icmpv6DestinationUnreachable::GetTypeId(), ns3::Icmpv6TooBig::GetTypeId(), ns3::Icmpv6TimeExceeded::GetTypeId(), ns3::Icmpv6ParameterError::GetTypeId(), ns3::Icmpv6OptionMtu::GetTypeId(), ns3::Icmpv6OptionPrefixInformation::GetTypeId(), ns3::Icmpv6OptionLinkLayerAddress::GetTypeId(), and ns3::Icmpv6OptionRedirected::GetTypeId().
TypeId ns3::TypeId::SetParent | ( | void | ) |
void ns3::TypeId::SetUid | ( | uint16_t | tid | ) |
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.
Definition at line 672 of file type-id.cc.
References NS_LOG_FUNCTION.