implement the ns-3 type and attribute system More...
#include <object-base.h>
Public Member Functions | |
virtual TypeId | GetInstanceTypeId (void) const =0 |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
void | GetAttribute (std::string name, AttributeValue &value) const |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::ObjectBase. | |
Protected Member Functions | |
virtual void | NotifyConstructionCompleted (void) |
void | ConstructSelf (const AttributeList &attributes) |
implement the ns-3 type and attribute system
Every class which wants to integrate in the ns-3 type and attribute system should derive from this base class. This base class provides:
void ns3::ObjectBase::ConstructSelf | ( | const AttributeList & | attributes | ) | [protected] |
attributes | the attribute values used to initialize the member variables of this object's instance. |
Invoked from subclasses to initialize all of their attribute members. This method will typically be invoked automatically from ns3::CreateObject if your class derives from ns3::Object. If you derive from ns3::ObjectBase directly, you should make sure that you invoke this method from your most-derived constructor.
void ns3::ObjectBase::GetAttribute | ( | std::string | name, | |
AttributeValue & | value | |||
) | const |
name | the name of the attribute to read | |
value | a reference to the value where the result should be stored. |
If the input attribute name does not exist, this method crashes.
bool ns3::ObjectBase::GetAttributeFailSafe | ( | std::string | name, | |
AttributeValue & | attribute | |||
) | const |
name | the name of the attribute to read | |
attribute | the attribute where the result value should be stored |
If the input attribute name does not exist, this method crashes.
virtual TypeId ns3::ObjectBase::GetInstanceTypeId | ( | void | ) | const [pure virtual] |
This method is typically implemented by ns3::Object::GetInstanceTypeId but some classes which derive from ns3::ObjectBase directly have to implement it themselves.
Implemented in ns3::ConfigStore, ns3::FlowIdTag, ns3::FlowMonitor, ns3::Object, ns3::dot11s::MeshHeader, ns3::dot11s::HwmpTag, ns3::dot11s::PeerLinkFrameStart, ns3::flame::FlameHeader, ns3::flame::FlameTag, ns3::WifiInformationElementVector, ns3::PppHeader, ns3::AmsduSubframeHeader, ns3::MgtAssocRequestHeader, ns3::MgtAssocResponseHeader, ns3::MgtProbeRequestHeader, ns3::MgtProbeResponseHeader, ns3::WifiActionHeader, ns3::QosTag, ns3::WifiMacHeader, ns3::WifiMacTrailer, ns3::ArpHeader, ns3::Icmpv4Header, ns3::Icmpv4Echo, ns3::Icmpv4TimeExceeded, ns3::Icmpv6Header, ns3::Icmpv6OptionHeader, ns3::Icmpv6NS, ns3::Icmpv6NA, ns3::Icmpv6RA, ns3::Icmpv6RS, ns3::Icmpv6Redirection, ns3::Icmpv6Echo, ns3::Icmpv6DestinationUnreachable, ns3::Icmpv6TooBig, ns3::Icmpv6TimeExceeded, ns3::Icmpv6ParameterError, ns3::Icmpv6OptionMtu, ns3::Icmpv6OptionPrefixInformation, ns3::Icmpv6OptionLinkLayerAddress, ns3::Icmpv6OptionRedirected, ns3::Ipv6ExtensionHeader, ns3::Ipv6ExtensionFragmentHeader, ns3::Ipv6ExtensionRoutingHeader, ns3::Ipv6ExtensionLooseRoutingHeader, ns3::Ipv6ExtensionESPHeader, ns3::Ipv6ExtensionAHHeader, ns3::Ipv6OptionHeader, ns3::Ipv6OptionPad1Header, ns3::Ipv6OptionPadnHeader, ns3::Ipv6OptionJumbogramHeader, ns3::Ipv6OptionRouterAlertHeader, ns3::Ns3NscStack, ns3::TcpHeader, ns3::UdpHeader, ns3::EthernetHeader, ns3::EthernetTrailer, ns3::Ipv4Header, ns3::Ipv6Header, ns3::LlcSnapHeader, ns3::PbbPacket, ns3::SocketAddressTag, ns3::SocketIpTtlTag, ns3::SocketSetDontFragmentTag, ns3::aodv::TypeHeader, ns3::aodv::RreqHeader, ns3::aodv::RrepHeader, ns3::aodv::RrepAckHeader, ns3::aodv::RerrHeader, ns3::olsr::PacketHeader, and ns3::olsr::MessageHeader.
static TypeId ns3::ObjectBase::GetTypeId | ( | void | ) | [static] |
This method returns the TypeId associated to ns3::ObjectBase.
No Attributes defined for this type.
No TraceSources defined for this type.
Reimplemented in ns3::OnOffApplication, ns3::PacketSink, ns3::Ping6, ns3::Radvd, ns3::SeqTsHeader, ns3::UdpClient, ns3::UdpServer, ns3::UdpTraceClient, ns3::UdpEchoClient, ns3::UdpEchoServer, ns3::V4Ping, ns3::Chunk, ns3::ErrorModel, ns3::RateErrorModel, ns3::ListErrorModel, ns3::Header, ns3::NixVector, ns3::PcapWriter, ns3::Tag, ns3::Trailer, ns3::ConfigStore, ns3::FlowIdTag, ns3::FlowMonitor, ns3::Object, ns3::BridgeChannel, ns3::BridgeNetDevice, ns3::CsmaChannel, ns3::CsmaNetDevice, ns3::EmuNetDevice, ns3::dot11s::AirtimeLinkMetricCalculator, ns3::dot11s::MeshHeader, ns3::dot11s::HwmpProtocol, ns3::dot11s::HwmpRtable, ns3::dot11s::HwmpTag, ns3::dot11s::PeerLinkFrameStart, ns3::dot11s::PeerLink, ns3::dot11s::PeerManagementProtocol, ns3::flame::FlameHeader, ns3::flame::FlameTag, ns3::flame::FlameProtocol, ns3::flame::FlameRtable, ns3::MeshL2RoutingProtocol, ns3::MeshPointDevice, ns3::MeshWifiInterfaceMac, ns3::WifiInformationElementVector, ns3::PointToPointChannel, ns3::PointToPointNetDevice, ns3::PppHeader, ns3::TapBridge, ns3::VirtualNetDevice, ns3::AarfWifiManager, ns3::AarfcdWifiManager, ns3::AdhocWifiMac, ns3::AmrrWifiManager, ns3::AmsduSubframeHeader, ns3::ArfWifiManager, ns3::CaraWifiManager, ns3::ConstantRateWifiManager, ns3::DcaTxop, ns3::Dcf, ns3::EdcaTxopN, ns3::ErrorRateModel, ns3::IdealWifiManager, ns3::JakesPropagationLossModel, ns3::MgtAssocRequestHeader, ns3::MgtAssocResponseHeader, ns3::MgtProbeRequestHeader, ns3::MgtProbeResponseHeader, ns3::WifiActionHeader, ns3::MinstrelWifiManager, ns3::MsduAggregator, ns3::MsduStandardAggregator, ns3::NqapWifiMac, ns3::NqstaWifiMac, ns3::OnoeWifiManager, ns3::PropagationDelayModel, ns3::RandomPropagationDelayModel, ns3::ConstantSpeedPropagationDelayModel, ns3::PropagationLossModel, ns3::RandomPropagationLossModel, ns3::FriisPropagationLossModel, ns3::LogDistancePropagationLossModel, ns3::ThreeLogDistancePropagationLossModel, ns3::NakagamiPropagationLossModel, ns3::FixedRssLossModel, ns3::QadhocWifiMac, ns3::QapWifiMac, ns3::QosTag, ns3::QstaWifiMac, ns3::RraaWifiManager, ns3::WifiChannel, ns3::WifiMacHeader, ns3::WifiMacQueue, ns3::WifiMacTrailer, ns3::WifiMac, ns3::WifiNetDevice, ns3::WifiPhyStateHelper, ns3::WifiPhy, ns3::WifiRemoteStationManager, ns3::YansErrorRateModel, ns3::YansWifiChannel, ns3::YansWifiPhy, ns3::AthstatsWifiTraceSink, ns3::CanvasLocation, ns3::Dot11sStack, ns3::FlameStack, ns3::ArpCache, ns3::ArpHeader, ns3::ArpL3Protocol, ns3::Icmpv4L4Protocol, ns3::Icmpv4Header, ns3::Icmpv4Echo, ns3::Icmpv4DestinationUnreachable, ns3::Icmpv4TimeExceeded, ns3::Icmpv6Header, ns3::Icmpv6OptionHeader, ns3::Icmpv6NS, ns3::Icmpv6NA, ns3::Icmpv6RA, ns3::Icmpv6RS, ns3::Icmpv6Redirection, ns3::Icmpv6Echo, ns3::Icmpv6DestinationUnreachable, ns3::Icmpv6TooBig, ns3::Icmpv6TimeExceeded, ns3::Icmpv6ParameterError, ns3::Icmpv6OptionMtu, ns3::Icmpv6OptionPrefixInformation, ns3::Icmpv6OptionLinkLayerAddress, ns3::Icmpv6OptionRedirected, ns3::Icmpv6L4Protocol, ns3::Ipv4Interface, ns3::Ipv4L3Protocol, ns3::Ipv4L4Protocol, ns3::Ipv4RawSocketImpl, ns3::Ipv6ExtensionDemux, ns3::Ipv6ExtensionHeader, ns3::Ipv6ExtensionFragmentHeader, ns3::Ipv6ExtensionRoutingHeader, ns3::Ipv6ExtensionLooseRoutingHeader, ns3::Ipv6ExtensionESPHeader, ns3::Ipv6ExtensionAHHeader, ns3::Ipv6Extension, ns3::Ipv6ExtensionHopByHop, ns3::Ipv6ExtensionDestination, ns3::Ipv6ExtensionFragment, ns3::Ipv6ExtensionRouting, ns3::Ipv6ExtensionRoutingDemux, ns3::Ipv6ExtensionLooseRouting, ns3::Ipv6ExtensionESP, ns3::Ipv6ExtensionAH, ns3::Ipv6Interface, ns3::Ipv6L3Protocol, ns3::Ipv6L4Protocol, ns3::Ipv6OptionDemux, ns3::Ipv6OptionHeader, ns3::Ipv6OptionPad1Header, ns3::Ipv6OptionPadnHeader, ns3::Ipv6OptionJumbogramHeader, ns3::Ipv6OptionRouterAlertHeader, ns3::Ipv6Option, ns3::Ipv6OptionPad1, ns3::Ipv6OptionPadn, ns3::Ipv6OptionJumbogram, ns3::Ipv6OptionRouterAlert, ns3::Ipv6RawSocketImpl, ns3::LoopbackNetDevice, ns3::NdiscCache, ns3::Ns3NscStack, ns3::NscTcpL4Protocol, ns3::NscTcpSocketImpl, ns3::RttEstimator, ns3::RttMeanDeviation, ns3::TcpHeader, ns3::TcpL4Protocol, ns3::TcpSocketImpl, ns3::UdpHeader, ns3::UdpL4Protocol, ns3::UdpSocketImpl, ns3::ConstantAccelerationMobilityModel, ns3::ConstantPositionMobilityModel, ns3::ConstantVelocityMobilityModel, ns3::HierarchicalMobilityModel, ns3::MobilityModel, ns3::PositionAllocator, ns3::ListPositionAllocator, ns3::GridPositionAllocator, ns3::RandomRectanglePositionAllocator, ns3::RandomDiscPositionAllocator, ns3::UniformDiscPositionAllocator, ns3::RandomDirection2dMobilityModel, ns3::RandomWalk2dMobilityModel, ns3::RandomWaypointMobilityModel, ns3::WaypointMobilityModel, ns3::Application, ns3::Channel, ns3::DropTailQueue, ns3::EthernetHeader, ns3::EthernetTrailer, ns3::Ipv4Header, ns3::Ipv4RawSocketFactory, ns3::Ipv4RoutingProtocol, ns3::Ipv4, ns3::Ipv6Header, ns3::Ipv6RawSocketFactory, ns3::Ipv6RoutingProtocol, ns3::Ipv6, ns3::LlcSnapHeader, ns3::NetDevice, ns3::Node, ns3::PacketSocketFactory, ns3::PacketSocket, ns3::PbbPacket, ns3::Queue, ns3::SimpleChannel, ns3::SimpleNetDevice, ns3::SocketFactory, ns3::SocketAddressTag, ns3::SocketIpTtlTag, ns3::SocketSetDontFragmentTag, ns3::TcpSocketFactory, ns3::TcpSocket, ns3::UdpSocketFactory, ns3::UdpSocket, ns3::aodv::RoutingProtocol, ns3::GlobalRouter, ns3::Ipv4GlobalRouting, ns3::Ipv4ListRouting, ns3::Ipv6ListRouting, ns3::Ipv4NixVectorRouting, ns3::olsr::PacketHeader, ns3::olsr::MessageHeader, ns3::olsr::RoutingProtocol, ns3::Ipv4StaticRouting, ns3::Ipv6StaticRouting, ns3::CalendarScheduler, ns3::DefaultSimulatorImpl, ns3::HeapScheduler, ns3::ListScheduler, ns3::MapScheduler, ns3::Ns2CalendarScheduler, ns3::RealtimeSimulatorImpl, ns3::Scheduler, and ns3::Synchronizer.
virtual void ns3::ObjectBase::NotifyConstructionCompleted | ( | void | ) | [protected, virtual] |
This method is invoked once all member attributes have been initialized. Subclasses can override this method to be notified of this event but if they do this, they must chain up to their parent's NotifyConstructionCompleted method.
Reimplemented in ns3::FlowMonitor.
void ns3::ObjectBase::SetAttribute | ( | std::string | name, | |
const AttributeValue & | value | |||
) |
name | the name of the attribute to set | |
value | the name of the attribute to set |
Set a single attribute. This cannot fail: if the input is invalid, it will crash immediately.
bool ns3::ObjectBase::SetAttributeFailSafe | ( | std::string | name, | |
const AttributeValue & | value | |||
) |
name | the name of the attribute to set | |
value | the name of the attribute to set |
bool ns3::ObjectBase::TraceConnect | ( | std::string | name, | |
std::string | context, | |||
const CallbackBase & | cb | |||
) |
name | the name of the targetted trace source | |
context | the trace context associated to the callback | |
cb | the callback to connect to the trace source. |
The targetted trace source should be registered with TypeId::AddTraceSource.
bool ns3::ObjectBase::TraceConnectWithoutContext | ( | std::string | name, | |
const CallbackBase & | cb | |||
) |
name | the name of the targetted trace source | |
cb | the callback to connect to the trace source. |
The targetted trace source should be registered with TypeId::AddTraceSource.
bool ns3::ObjectBase::TraceDisconnect | ( | std::string | name, | |
std::string | context, | |||
const CallbackBase & | cb | |||
) |
name | the name of the targetted trace source | |
context | the trace context associated to the callback | |
cb | the callback to disconnect from the trace source. |
The targetted trace source should be registered with TypeId::AddTraceSource.
bool ns3::ObjectBase::TraceDisconnectWithoutContext | ( | std::string | name, | |
const CallbackBase & | cb | |||
) |
name | the name of the targetted trace source | |
cb | the callback to disconnect from the trace source. |
The targetted trace source should be registered with TypeId::AddTraceSource.