A base class which provides memory management and object aggregation. More...
#include "object.h"
Classes | |
class | AggregateIterator |
Iterate over the Objects aggregated to an ns3::Object. More... | |
struct | Aggregates |
The list of Objects aggregated to this one. More... | |
Public Member Functions | |
Object () | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose (void) |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator (void) const |
Get an iterator to the Objects aggregated to this one. More... | |
virtual TypeId | GetInstanceTypeId (void) const |
Get the most derived TypeId for this Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
void | Initialize (void) |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized (void) const |
Check if the object has been initialized. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising erros. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. More... | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. More... | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. More... | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. More... | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. More... | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Protected Member Functions | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoDispose (void) |
Destructor implementation. More... | |
virtual void | DoInitialize (void) |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate (void) |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted (void) |
Notifier called once the ObjectBase is fully constructed. More... | |
Private Member Functions | |
bool | Check (void) const |
Verify that this Object is still live, by checking it's reference count. More... | |
bool | CheckLoose (void) const |
Check if any aggregated Objects have non-zero reference counts. More... | |
void | Construct (const AttributeConstructionList &attributes) |
Initialize all member variables registered as Attributes of this TypeId. More... | |
void | DoDelete (void) |
Attempt to delete this Object. More... | |
Ptr< Object > | DoGetObject (TypeId tid) const |
Find an Object of TypeId tid in the aggregates of this Object. More... | |
void | SetTypeId (TypeId tid) |
Set the TypeId of this Object. More... | |
void | UpdateSortedArray (struct Aggregates *aggregates, uint32_t i) const |
Keep the list of aggregates in most-recently-used order. More... | |
Private Attributes | |
struct Aggregates * | m_aggregates |
A pointer to an array of 'aggregates'. More... | |
bool | m_disposed |
Set to true when the DoDispose() method of the Object has run, false otherwise. More... | |
uint32_t | m_getObjectCount |
The number of times the Object was accessed with a call to GetObject(). More... | |
bool | m_initialized |
Set to true once the DoInitialize() method has run, false otherwise. More... | |
TypeId | m_tid |
Identifies the type of this Object instance. More... | |
Friends | |
class | AggregateIterator |
template<typename T > | |
Ptr< T > | CompleteConstruct (T *object) |
Set the TypeId and construct all Attributes of an Object. More... | |
struct | ObjectDeleter |
class | ObjectFactory |
template<typename T > | |
Ptr< T > | CopyObject (Ptr< T > object) |
Copy an Object. More... | |
template<typename T > | |
Ptr< T > | CopyObject (Ptr< const T > object) |
Additional Inherited Members | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
A base class which provides memory management and object aggregation.
Introspection did not find any typical Config paths.
The memory management scheme is based on reference-counting with dispose-like functionality to break the reference cycles. The reference count is incremented and decremented with the methods Ref() and Unref(). If a reference cycle is present, the user is responsible for breaking it by calling Dispose() in a single location. This will eventually trigger the invocation of DoDispose() on itself and all its aggregates. The DoDispose() method is always automatically invoked from the Unref() method before destroying the Object, even if the user did not call Dispose() directly.
No Attributes are defined for this type.
No TraceSources are defined for this type.
Size of this type is 32 bytes (on a 64-bit architecture).
Object::Object | ( | ) |
Constructor.
Definition at line 96 of file object.cc.
References ns3::Object::Aggregates::buffer, m_aggregates, ns3::Object::Aggregates::n, and NS_LOG_FUNCTION.
|
virtual |
Destructor.
Definition at line 107 of file object.cc.
References ns3::Object::Aggregates::buffer, m_aggregates, sample-rng-plot::n, ns3::Object::Aggregates::n, and NS_LOG_FUNCTION.
|
protected |
Copy an Object.
[in] | o | the Object to copy. |
Allow subclasses to implement a copy constructor.
While it is technically possible to implement a copy constructor in a subclass, we strongly discourage you from doing so. If you really want to do it anyway, you have to understand that this copy constructor will not copy aggregated Objects, i.e, if your Object instance is already aggregated to another Object and if you invoke this copy constructor, the new Object instance will be a pristine standalone Object instance not aggregated to any other Object. It is thus your responsibility as a caller of this method to do what needs to be done (if it is needed) to ensure that the Object stays in a valid state.
Definition at line 131 of file object.cc.
References ns3::Object::Aggregates::buffer, m_aggregates, and ns3::Object::Aggregates::n.
Aggregate two Objects together.
[in] | other | The other Object pointer |
This method aggregates the two Objects together: after this method returns, it becomes possible to call GetObject() on one to get the other, and vice-versa.
This method calls the virtual method NotifyNewAggregates() to notify all aggregated Objects that they have been aggregated together.
Definition at line 252 of file object.cc.
References ns3::Object::Aggregates::buffer, CheckLoose(), DoGetObject(), m_aggregates, m_disposed, sample-rng-plot::n, ns3::Object::Aggregates::n, NotifyNewAggregate(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::PeekPointer(), and UpdateSortedArray().
Referenced by ns3::PointToPointEpcHelper::AddEnb(), ns3::EmuEpcHelper::AddEnb(), ns3::PointToPointStarHelper::BoundingBox(), ns3::PointToPointGridHelper::BoundingBox(), ns3::PointToPointDumbbellHelper::BoundingBox(), ns3::AodvHelper::Create(), ns3::Ipv4GlobalRoutingHelper::Create(), ns3::DsdvHelper::Create(), ns3::Ipv4NixVectorHelper::Create(), ns3::RipNgHelper::Create(), ns3::RipHelper::Create(), ns3::OlsrHelper::Create(), ns3::DsrHelper::Create(), ns3::InternetStackHelper::CreateAndAggregateObjectFromTypeId(), CreateDualStackNode(), TcpTestCase::CreateInternetNode(), TcpTestCase::CreateInternetNode6(), BuildingsPathlossTestCase::CreateMobilityModel(), BuildingsShadowingTestCase::CreateMobilityModel(), WifiTest::CreateOne(), InterferenceHelperSequenceTest::CreateOne(), ns3::RadioEnvironmentMapHelper::DelayedInstall(), LiIonEnergyTestCase::DoRun(), BasicEnergyHarvesterTestCase::DoRun(), Ipv6L3ProtocolTestCase::DoRun(), LrWpanCollisionTestCase::DoRun(), WaypointLazyNotifyFalse::DoRun(), AcousticModemEnergyTestCase::DoRun(), BuildingsHelperOneTestCase::DoRun(), WaypointLazyNotifyTrue::DoRun(), AcousticModemEnergyDepletionTestCase::DoRun(), DcfImmediateAccessBroadcastTestCase::DoRun(), Bug2831TestCase::DoRun(), ns3::PacketSocketHelper::Install(), ns3::BuildingsHelper::Install(), ns3::EnergyHarvesterHelper::Install(), ns3::InternetStackHelper::Install(), ns3::MobilityHelper::Install(), ns3::NscTcpL4Protocol::NotifyNewAggregate(), ns3::UdpL4Protocol::NotifyNewAggregate(), ns3::TcpL4Protocol::NotifyNewAggregate(), AnimationRemainingEnergyTestCase::PrepareNetwork(), ns3::Ipv6L3Protocol::RegisterExtensions(), ns3::Ipv6L3Protocol::RegisterOptions(), NetAnimExperiment::Run(), Experiment::Run(), TbfQueueDiscTestCase::RunTbfTest(), ns3::NscTcpL4Protocol::SetNode(), and BasicEnergyUpdateTest::StateSwitchTest().
|
private |
Verify that this Object is still live, by checking it's reference count.
true
if the reference count is non zero. Definition at line 360 of file object.cc.
References ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >::GetReferenceCount(), and NS_LOG_FUNCTION.
Referenced by SetTypeId().
|
private |
Check if any aggregated Objects have non-zero reference counts.
true
if any of our aggregates have non zero reference count.In some cases, when an event is scheduled against a subclass of Object, and if no one owns a reference directly to this Object, the Object is alive, has a refcount of zero and the method run when the event expires runs against the raw pointer, which means that we are manipulating an Object with a refcount of zero. So, instead we check the aggregate reference count.
Definition at line 374 of file object.cc.
References ns3::Object::Aggregates::buffer, ns3::SimpleRefCount< T, PARENT, DELETER >::GetReferenceCount(), m_aggregates, sample-rng-plot::n, ns3::Object::Aggregates::n, and NS_LOG_FUNCTION.
Referenced by AggregateObject(), and DoGetObject().
|
private |
Initialize all member variables registered as Attributes of this TypeId.
[in] | attributes | The attribute values used to initialize the member variables of this Object's instance. |
Invoked from ns3::ObjectFactory::Create and ns3::CreateObject only. Initialize all the member variables which were registered with the associated TypeId.
Definition at line 142 of file object.cc.
References ns3::ObjectBase::ConstructSelf(), and NS_LOG_FUNCTION.
Referenced by ns3::ObjectFactory::Create().
void Object::Dispose | ( | void | ) |
Dispose of this Object.
Run the DoDispose() methods of this Object and all the Objects aggregated to it.
After calling this method, this Object is expected to be totally unusable except for the Ref() and Unref() methods.
This method is typically used to break reference cycles.
Note: the code here is a bit tricky because we need to protect ourselves from modifications in the aggregate array while DoDispose is called. The user's DoDispose implementation could call GetObject (which could reorder the array) and it could call AggregateObject which would add an object at the end of the array. So, to be safe, we restart the iteration over the array whenever we call some user code.
Definition at line 214 of file object.cc.
References ns3::Object::Aggregates::buffer, DoDispose(), m_aggregates, m_disposed, sample-rng-plot::n, ns3::Object::Aggregates::n, and NS_LOG_FUNCTION.
Referenced by ns3::LteSimpleHelper::DoDispose(), ns3::PointToPointEpcHelper::DoDispose(), ns3::EmuEpcHelper::DoDispose(), ns3::NodeListPriv::DoDispose(), ns3::WifiNetDevice::DoDispose(), ns3::ArpL3Protocol::DoDispose(), ns3::Node::DoDispose(), ns3::RegularWifiMac::DoDispose(), ns3::ApWifiMac::DoDispose(), ns3::WaveNetDevice::DoDispose(), ns3::Icmpv6L4Protocol::DoDispose(), AmpduAggregationTest::DoRun(), Ipv6RawSocketImplTest::DoRun(), Ipv4RawSocketImplTest::DoRun(), UdpSocketImplTest::DoRun(), TwoLevelAggregationTest::DoRun(), Udp6SocketImplTest::DoRun(), ChannelAccessManagerTest::EndTest(), and InterferenceExperiment::Run().
|
private |
Attempt to delete this Object.
This method iterates over all aggregated Objects to check if they all have a zero refcount. If yes, the Object and all its aggregates are deleted. If not, nothing is done.
Definition at line 391 of file object.cc.
References ns3::Object::Aggregates::buffer, DoDispose(), ns3::SimpleRefCount< T, PARENT, DELETER >::GetReferenceCount(), m_aggregates, m_disposed, sample-rng-plot::n, ns3::Object::Aggregates::n, and NS_LOG_FUNCTION.
|
protectedvirtual |
Destructor implementation.
This method is called by Dispose() or by the Object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.
It is safe to call GetObject() from within this method.
Reimplemented in ns3::WifiPhy, ns3::Socket, ns3::GlobalRouter, ns3::WifiRemoteStationManager, ns3::MacLow, ns3::dsr::DsrRouting, ns3::LteEnbRrc, ns3::LrWpanMac, ns3::Ipv6ExtensionRoutingDemux, ns3::QosTxop, ns3::LrWpanPhy, ns3::QueueDisc, ns3::WimaxNetDevice, ns3::Ipv6L3Protocol, ns3::UanPhyGen, ns3::NdiscCache, ns3::EpcTestRrc, ns3::WifiRadioEnergyModel, ns3::Icmpv6L4Protocol, ns3::Ipv4StaticRouting, ns3::WaveNetDevice, ns3::Txop, ns3::SubscriberStationNetDevice, ns3::WimaxPhy, ns3::CsmaNetDevice, ns3::ArpCache, ns3::UanPropModel, ns3::NetDeviceQueueInterface, ns3::ApWifiMac, ns3::olsr::RoutingProtocol, ns3::Ipv6ExtensionFragment, ns3::UanMacRc, ns3::CounterCalculator< T >, ns3::CounterCalculator< uint32_t >, ns3::CounterCalculator<>, ns3::BaseStationNetDevice, ns3::UanMacRcGw, ns3::RegularWifiMac, ns3::SimpleOfdmWimaxPhy, ns3::Ipv6Interface, ns3::UanPhyDual, ns3::TcpL4Protocol, ns3::Ipv4L3Protocol, ns3::RipNg, ns3::FlowMonitor, ns3::Rip, ns3::LteTestMac, ns3::LrWpanCsmaCa, ns3::OpenFlowSwitchNetDevice, ns3::UdpL4Protocol, ns3::Ipv6StaticRouting, ns3::Ipv4GlobalRouting, ns3::PointToPointNetDevice, ns3::TapBridge, ns3::ChannelAccessManager, ns3::Node, ns3::Ipv4NixVectorRouting, ns3::Icmpv4L4Protocol, ns3::LteRlcSm, ns3::ChannelCoordinator, ns3::MeshWifiInterfaceMac, ns3::RedQueueDisc, ns3::TrafficControlLayer, ns3::AcousticModemEnergyModel, ns3::UanNetDevice, ns3::HalfDuplexIdealPhy, ns3::Ipv4Interface, ns3::EnergySource, ns3::FdNetDevice, ns3::AlohaNoackNetDevice, ns3::LteEnbRrcProtocolReal, ns3::LteTestPdcp, ns3::SpectrumWifiPhy, ns3::Ipv6RawSocketImpl, ns3::PacketSocket, ns3::UanMacCw, ns3::RvBatteryModel, ns3::ThreeGppHttpClient, ns3::DataCalculator, ns3::SixLowPanNetDevice, ns3::RealtimeSimulatorImpl, ns3::EnergyHarvesterContainer, ns3::LteSpectrumPhy, ns3::EnergySourceContainer, ns3::LrWpanNetDevice, ns3::LteEnbComponentCarrierManager, ns3::LteEnbRrcProtocolIdeal, ns3::LiIonEnergySource, ns3::VsaManager, ns3::ThreeGppHttpServer, ns3::VirtualNetDevice, ns3::NscTcpL4Protocol, ns3::WimaxConnection, ns3::DataCollector, ns3::TbfQueueDisc, ns3::Application, ns3::LteAnr, ns3::WaypointMobilityModel, anonymous_namespace{object-test-suite.cc}::DerivedB, ns3::SimpleNetDevice, ns3::LteUeRrc, ns3::UdpEchoClient, ns3::WaveformGenerator, ns3::BridgeNetDevice, ns3::UanPhyPer, ns3::LteFfrAlgorithm, ns3::UanChannel, ns3::DistributedSimulatorImpl, ns3::MultiModelSpectrumChannel, ns3::NonCommunicatingNetDevice, ns3::OnOffApplication, ns3::UdpTraceClient, ns3::LtePhy, ns3::ArpL3Protocol, ns3::SimpleDeviceEnergyModel, ns3::EpcX2, ns3::MeshPointDevice, ns3::UeManager, ns3::WifiNetDevice, ns3::LteHelper, ns3::PacketSizeMinMaxAvgTotalCalculator, ns3::SpectrumInterference, ns3::BasicEnergySource, ns3::MinMaxAvgTotalCalculator< T >, ns3::MinMaxAvgTotalCalculator< uint32_t >, ns3::MinMaxAvgTotalCalculator< double >, ns3::MinMaxAvgTotalCalculator< uint64_t >, ns3::Ipv6ListRouting, ns3::EnergyHarvester, ns3::PieQueueDisc, ns3::A2A4RsrqHandoverAlgorithm, ns3::BsmApplication, ns3::BulkSendApplication, ns3::LteFfrSimple, ns3::Radvd, ns3::NodeListPriv, ns3::SpectrumAnalyzer, ns3::FdTbfqFfMacScheduler, ns3::LteUeComponentCarrierManager, ns3::GaussMarkovMobilityModel, ns3::ChannelListPriv, ns3::flame::FlameProtocol, ns3::UanPhyCalcSinr, ns3::CqaFfMacScheduler, ns3::NullMessageSimulatorImpl, ns3::PacketSink, ns3::BasicEnergyHarvester, ns3::DhcpClient, ns3::RadioBearerStatsCalculator, ns3::LteHandoverAlgorithm, ns3::PssFfMacScheduler, EpsBearerTagUdpClient, ns3::Ipv4ListRouting, ns3::TdTbfqFfMacScheduler, ns3::Ping6, ns3::Ipv6FlowProbe, ns3::Ipv4RawSocketImpl, ns3::LteUePhy, ns3::UanMacAloha, anonymous_namespace{object-test-suite.cc}::DerivedA, ns3::A3RsrpHandoverAlgorithm, ns3::FdBetFfMacScheduler, ns3::TdBetFfMacScheduler, ns3::flame::FlameRtable, ns3::PfFfMacScheduler, ns3::Ipv6ExtensionDemux, ns3::Ipv6OptionDemux, ns3::dot11s::HwmpRtable, ns3::PacketBurst, ns3::Ipv4FlowProbe, ns3::UanTransducerHd, ns3::UdpServer, ns3::FdMtFfMacScheduler, Receiver, ns3::DefaultSimulatorImpl, ns3::ShannonSpectrumErrorModel, ns3::SpectrumPropagationLossModel, ns3::LoopbackNetDevice, TxopTest, ns3::TdMtFfMacScheduler, ns3::TtaFfMacScheduler, ns3::YansWifiPhy, ns3::SSScheduler, ns3::V4Ping, ns3::FfMacScheduler, ns3::LteEnbMac, ns3::VisualSimulatorImpl, ns3::PacketSocketClient, ns3::QueueDiscClass, ns3::EmuEpcHelper, ns3::LteEnbPhy, ns3::RrFfMacScheduler, ns3::RandomWalk2dMobilityModel, ns3::SimpleUeComponentCarrierManager, ns3::PointToPointEpcHelper, ns3::LteFrNoOpAlgorithm, ns3::dot11s::HwmpProtocol, ns3::RandomDirection2dMobilityModel, ns3::Ipv6PmtuCache, ns3::EpcHelper, ns3::DefaultChannelScheduler, ns3::DhcpServer, ns3::LteFfrEnhancedAlgorithm, ns3::UdpClient, ns3::BandwidthManager, ns3::dsdv::RoutingProtocol, ns3::CcHelper, ns3::LteEnbNetDevice, ns3::LteFfrSoftAlgorithm, ns3::LteFrSoftAlgorithm, ns3::LteFrStrictAlgorithm, ns3::LteUeNetDevice, ns3::LteUePowerControl, ns3::PacketCounterCalculator, ns3::DataOutputInterface, ns3::WifiSpectrumPhyInterface, ns3::LteFrHardAlgorithm, ns3::LteUeRrcProtocolReal, ns3::NoOpComponentCarrierManager, ns3::EpcMme, ns3::PacketSocketServer, ns3::TimeMinMaxAvgTotalCalculator, ns3::EpcEnbApplication, ns3::NoOpHandoverAlgorithm, ns3::JakesProcess, ns3::SingleModelSpectrumChannel, ns3::aodv::RoutingProtocol, ns3::LteRlc, ns3::SpectrumChannel, ns3::SsServiceFlowManager, ns3::LteFfrDistributedAlgorithm, ns3::LteUeMac, ns3::LteTestRrc, ns3::UdpSocketFactoryImpl, ns3::ComponentCarrierEnb, ns3::EpcSgwPgwApplication, ns3::LteNetDevice, ns3::LteSimpleSpectrumPhy, ns3::BsServiceFlowManager, ns3::ServiceFlowManager, ns3::NscTcpSocketFactoryImpl, ns3::LteUeRrcProtocolIdeal, ns3::RemSpectrumPhy, ns3::LteSimpleHelper, ns3::LteSimpleNetDevice, ns3::dot11s::PeerManagementProtocol, ns3::MpiReceiver, ns3::FlameStack, ns3::ComponentCarrier, ns3::LteInterference, ns3::UdpEchoServer, ns3::Dot11sStack, ns3::dot11s::PeerLink, ns3::SSLinkManager, ns3::SqliteDataOutput, ns3::BuildingListPriv, ns3::TcpSocketFactoryImpl, ns3::RadioEnvironmentMapHelper, ns3::LteTestUePhy, ns3::ConnectionManager, ns3::OmnetDataOutput, ns3::UanNoiseModel, ns3::FlowProbe, ns3::ComponentCarrierUe, ns3::BurstProfileManager, ns3::EpcUeNas, ns3::LtePdcp, ns3::LteHexGridEnbTopologyHelper, ns3::LteRlcAm, Sender, ns3::LteRlcTm, ns3::LteRlcUm, and ns3::Building.
Definition at line 346 of file object.cc.
References m_disposed, NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by Dispose(), DoDelete(), ns3::LteHexGridEnbTopologyHelper::DoDispose(), ns3::FlowProbe::DoDispose(), ns3::ComponentCarrierUe::DoDispose(), ns3::UanNoiseModel::DoDispose(), ns3::TcpSocketFactoryImpl::DoDispose(), ns3::BuildingListPriv::DoDispose(), ns3::ComponentCarrier::DoDispose(), ns3::LteInterference::DoDispose(), ns3::NscTcpSocketFactoryImpl::DoDispose(), ns3::RemSpectrumPhy::DoDispose(), ns3::LteSimpleHelper::DoDispose(), ns3::UdpSocketFactoryImpl::DoDispose(), ns3::ComponentCarrierEnb::DoDispose(), ns3::LteNetDevice::DoDispose(), ns3::LteSimpleSpectrumPhy::DoDispose(), ns3::LteUeMac::DoDispose(), ns3::aodv::RoutingProtocol::DoDispose(), ns3::dsdv::RoutingProtocol::DoDispose(), ns3::DataOutputInterface::DoDispose(), ns3::CcHelper::DoDispose(), ns3::EpcHelper::DoDispose(), ns3::DefaultChannelScheduler::DoDispose(), ns3::RandomDirection2dMobilityModel::DoDispose(), ns3::RandomWalk2dMobilityModel::DoDispose(), ns3::QueueDiscClass::DoDispose(), ns3::VisualSimulatorImpl::DoDispose(), ns3::LoopbackNetDevice::DoDispose(), ns3::ShannonSpectrumErrorModel::DoDispose(), ns3::DefaultSimulatorImpl::DoDispose(), ns3::UanTransducerHd::DoDispose(), ns3::Ipv6ExtensionDemux::DoDispose(), ns3::Ipv6OptionDemux::DoDispose(), ns3::UanMacAloha::DoDispose(), ns3::NullMessageSimulatorImpl::DoDispose(), ns3::UanPhyCalcSinr::DoDispose(), ns3::ChannelListPriv::DoDispose(), ns3::GaussMarkovMobilityModel::DoDispose(), ns3::SpectrumAnalyzer::DoDispose(), ns3::NodeListPriv::DoDispose(), ns3::SpectrumInterference::DoDispose(), ns3::LteHelper::DoDispose(), ns3::WifiNetDevice::DoDispose(), ns3::MeshPointDevice::DoDispose(), ns3::ArpL3Protocol::DoDispose(), ns3::LtePhy::DoDispose(), ns3::NonCommunicatingNetDevice::DoDispose(), ns3::DistributedSimulatorImpl::DoDispose(), ns3::UanChannel::DoDispose(), ns3::BridgeNetDevice::DoDispose(), ns3::UanPhyPer::DoDispose(), ns3::SimpleNetDevice::DoDispose(), ns3::WaypointMobilityModel::DoDispose(), ns3::Application::DoDispose(), ns3::DataCollector::DoDispose(), ns3::NscTcpL4Protocol::DoDispose(), ns3::VirtualNetDevice::DoDispose(), ns3::LrWpanNetDevice::DoDispose(), ns3::LteSpectrumPhy::DoDispose(), ns3::RealtimeSimulatorImpl::DoDispose(), ns3::SixLowPanNetDevice::DoDispose(), ns3::DataCalculator::DoDispose(), ns3::UanMacCw::DoDispose(), ns3::AlohaNoackNetDevice::DoDispose(), ns3::FdNetDevice::DoDispose(), ns3::Ipv4Interface::DoDispose(), ns3::HalfDuplexIdealPhy::DoDispose(), ns3::UanNetDevice::DoDispose(), ns3::TrafficControlLayer::DoDispose(), ns3::Icmpv4L4Protocol::DoDispose(), ns3::Node::DoDispose(), ns3::TapBridge::DoDispose(), ns3::PointToPointNetDevice::DoDispose(), ns3::Ipv4GlobalRouting::DoDispose(), ns3::Ipv6StaticRouting::DoDispose(), ns3::UdpL4Protocol::DoDispose(), ns3::Rip::DoDispose(), ns3::FlowMonitor::DoDispose(), ns3::RipNg::DoDispose(), ns3::Ipv4L3Protocol::DoDispose(), ns3::TcpL4Protocol::DoDispose(), ns3::UanPhyDual::DoDispose(), ns3::Ipv6Interface::DoDispose(), ns3::UanMacRcGw::DoDispose(), ns3::UanMacRc::DoDispose(), ns3::Ipv6ExtensionFragment::DoDispose(), ns3::olsr::RoutingProtocol::DoDispose(), ns3::NetDeviceQueueInterface::DoDispose(), ns3::UanPropModel::DoDispose(), ns3::ArpCache::DoDispose(), ns3::CsmaNetDevice::DoDispose(), ns3::WaveNetDevice::DoDispose(), ns3::Ipv4StaticRouting::DoDispose(), ns3::Icmpv6L4Protocol::DoDispose(), ns3::NdiscCache::DoDispose(), ns3::UanPhyGen::DoDispose(), ns3::Ipv6L3Protocol::DoDispose(), ns3::WimaxNetDevice::DoDispose(), ns3::QueueDisc::DoDispose(), ns3::LrWpanPhy::DoDispose(), ns3::Ipv6ExtensionRoutingDemux::DoDispose(), ns3::LrWpanMac::DoDispose(), ns3::dsr::DsrRouting::DoDispose(), and ns3::GlobalRouter::DoDispose().
Find an Object of TypeId tid in the aggregates of this Object.
[in] | tid | The TypeId we're looking for |
Definition at line 149 of file object.cc.
References ns3::Object::Aggregates::buffer, CheckLoose(), GetInstanceTypeId(), ns3::TypeId::GetParent(), GetTypeId(), m_aggregates, m_getObjectCount, sample-rng-plot::n, ns3::Object::Aggregates::n, NS_ASSERT, NS_LOG_FUNCTION, and UpdateSortedArray().
Referenced by AggregateObject(), and GetObject().
|
protectedvirtual |
Initialize() implementation.
This method is called only once by Initialize(). If the user calls Initialize() multiple times, DoInitialize() is called only the first time.
Subclasses are expected to override this method and chain up to their parent's implementation once they are done. It is safe to call GetObject() and AggregateObject() from within this method.
Reimplemented in ns3::WifiPhy, ns3::LteHelper, ns3::LrWpanMac, ns3::QosTxop, ns3::QueueDisc, ns3::WaveNetDevice, ns3::CsmaNetDevice, ns3::Txop, ns3::ApWifiMac, ns3::StaWifiMac, ns3::RegularWifiMac, ns3::ThreeGppHttpVariables, ns3::RipNg, ns3::Rip, ns3::Node, ns3::MinstrelHtWifiManager, ns3::LteEnbNetDevice, ns3::dot11s::PeerManagementProtocol, ns3::MeshWifiInterfaceMac, ns3::LteRlcSm, ns3::ChannelCoordinator, ns3::TrafficControlLayer, ns3::PointToPointNetDevice, ns3::olsr::RoutingProtocol, ns3::UanNetDevice, ns3::ChannelScheduler, ns3::SpectrumWifiPhy, ns3::aodv::RoutingProtocol, ns3::EnergyHarvesterContainer, ns3::RvBatteryModel, ns3::EnergySourceContainer, ns3::LteUeNetDevice, ns3::LrWpanNetDevice, ns3::CcHelper, ns3::ComponentCarrier, ns3::dot11s::HwmpProtocol, ns3::VsaManager, ns3::LiIonEnergySource, ns3::Application, ns3::LteAnr, ns3::SimpleNetDevice, ns3::LteUeRrc, ns3::LteSimpleHelper, ns3::ComponentCarrierEnb, ns3::WifiNetDevice, ns3::UeManager, ns3::BasicEnergySource, ns3::A2A4RsrqHandoverAlgorithm, ns3::LteFfrSimple, ns3::Ipv4ListRouting, ns3::BasicEnergyHarvester, ns3::LteUePhy, ns3::A3RsrpHandoverAlgorithm, ns3::ComponentCarrierUe, ns3::RandomWalk2dMobilityModel, ns3::EmuEpcHelper, ns3::LteEnbPhy, ns3::SimpleUeComponentCarrierManager, ns3::RandomDirection2dMobilityModel, ns3::LteFrNoOpAlgorithm, ns3::DefaultChannelScheduler, ns3::LteFfrEnhancedAlgorithm, ns3::LteSimpleNetDevice, ns3::LteFfrSoftAlgorithm, ns3::LteFrSoftAlgorithm, ns3::LteFrStrictAlgorithm, ns3::LteUePowerControl, ns3::LteFrHardAlgorithm, ns3::NoOpComponentCarrierManager, ns3::SteadyStateRandomWaypointMobilityModel, ns3::NoOpHandoverAlgorithm, Emitter, ns3::LteFfrDistributedAlgorithm, ns3::RandomWaypointMobilityModel, ns3::IdealWifiManager, ns3::TraceFadingLossModel, Emitter, Emitter, and Emitter.
Definition at line 353 of file object.cc.
References m_initialized, NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by ns3::LteEnbRrc::ConfigureCarriers(), ns3::LteFfrDistributedAlgorithm::DoInitialize(), ns3::RandomWaypointMobilityModel::DoInitialize(), ns3::NoOpHandoverAlgorithm::DoInitialize(), ns3::SteadyStateRandomWaypointMobilityModel::DoInitialize(), ns3::LteFrHardAlgorithm::DoInitialize(), ns3::NoOpComponentCarrierManager::DoInitialize(), ns3::LteFfrSoftAlgorithm::DoInitialize(), ns3::LteFrStrictAlgorithm::DoInitialize(), ns3::LteFrSoftAlgorithm::DoInitialize(), ns3::LteFfrEnhancedAlgorithm::DoInitialize(), ns3::LteFrNoOpAlgorithm::DoInitialize(), ns3::SimpleUeComponentCarrierManager::DoInitialize(), ns3::RandomDirection2dMobilityModel::DoInitialize(), ns3::EmuEpcHelper::DoInitialize(), ns3::LteEnbPhy::DoInitialize(), ns3::RandomWalk2dMobilityModel::DoInitialize(), ns3::A3RsrpHandoverAlgorithm::DoInitialize(), ns3::LteUePhy::DoInitialize(), ns3::Ipv4ListRouting::DoInitialize(), ns3::LteFfrSimple::DoInitialize(), ns3::A2A4RsrqHandoverAlgorithm::DoInitialize(), ns3::WifiNetDevice::DoInitialize(), ns3::LteSimpleHelper::DoInitialize(), ns3::SimpleNetDevice::DoInitialize(), ns3::Application::DoInitialize(), ns3::LrWpanNetDevice::DoInitialize(), ns3::aodv::RoutingProtocol::DoInitialize(), ns3::UanNetDevice::DoInitialize(), ns3::PointToPointNetDevice::DoInitialize(), ns3::TrafficControlLayer::DoInitialize(), ns3::Node::DoInitialize(), ns3::Rip::DoInitialize(), ns3::RipNg::DoInitialize(), ns3::CsmaNetDevice::DoInitialize(), ns3::WaveNetDevice::DoInitialize(), ns3::QueueDisc::DoInitialize(), ns3::LrWpanMac::DoInitialize(), ns3::LteHelper::DoInitialize(), and Initialize().
Object::AggregateIterator Object::GetAggregateIterator | ( | void | ) | const |
Get an iterator to the Objects aggregated to this one.
If no Objects are aggregated to this Object, then, the returned iterator will be empty and AggregateIterator::HasNext() will always return false
.
Definition at line 331 of file object.cc.
References AggregateIterator, and NS_LOG_FUNCTION.
|
virtual |
Get the most derived TypeId for this Object.
This method is typically implemented by ns3::Object::GetInstanceTypeId but some classes which derive from ns3::ObjectBase directly have to implement it themselves.
Implements ns3::ObjectBase.
Reimplemented in ns3::dsr::DsrOptionAck, ns3::dsr::DsrOptionAckReq, ns3::dsr::DsrOptionRerr, ns3::dsr::DsrOptionSR, ns3::dsr::DsrOptionRrep, ns3::dsr::DsrOptionRreq, ns3::TcpSocketBase, ns3::FlowMonitor, ns3::RttMeanDeviation, ns3::TcpOptionUnknown, ns3::TrafficControlLayer, ns3::TcpOptionMSS, ns3::EmuEpcHelper, ns3::PointToPointEpcHelper, anonymous_namespace{sequence-number-test-suite.cc}::SequenceNumberTestObj, ns3::TcpOptionNOP, ns3::RttEstimator, ns3::TcpOptionWinScale, ns3::TcpOptionSack, ns3::TcpOptionSackPermitted, ns3::TcpOption, ns3::TcpOptionTS, ns3::Ns3NscStack, and ns3::TcpOptionEnd.
Definition at line 79 of file object.cc.
References m_tid, and NS_LOG_FUNCTION.
Referenced by ns3::cell_data_function_col_0(), ns3::cell_tooltip_callback(), DoGetObject(), ns3::AttributeIterator::DoIterate(), GetTypicalAggregations(), ns3::AttributeIterator::StartVisitArrayItem(), ns3::AttributeIterator::StartVisitObject(), and ns3::AttributeIterator::StartVisitPointerAttribute().
|
inline |
Get a pointer to the requested aggregated Object.
Definition at line 459 of file object.h.
References ns3::Object::Aggregates::buffer, DoGetObject(), m_aggregates, and ns3::PeekPointer().
Referenced by ns3::DhcpClient::AcceptAck(), ns3::DrbActivator::ActivateDrb(), ns3::PointToPointEpcHelper::ActivateEpsBearer(), ns3::EmuEpcHelper::ActivateEpsBearer(), ns3::Ipv6Interface::AddAddress(), ns3::PointToPointEpcHelper::AddEnb(), ns3::EmuEpcHelper::AddEnb(), ns3::Ipv6L3Protocol::AddInterface(), ns3::Ipv4L3Protocol::AddInterface(), ns3::NscTcpL4Protocol::AddInterface(), ns3::GnuplotHelper::AddProbe(), ns3::FileHelper::AddProbe(), TcpTestCase::AddSimpleNetDevice(), AddSimpleNetDevice(), TcpTestCase::AddSimpleNetDevice6(), ns3::PointToPointEpcHelper::AddX2Interface(), ns3::EmuEpcHelper::AddX2Interface(), OcbWifiMacTestCase::AdvancePosition(), Experiment::ApplicationSetup(), ns3::LteUeRrc::ApplyRadioResourceConfigDedicated(), ns3::Ipv6AddressHelper::Assign(), ns3::Ipv4AddressHelper::Assign(), ns3::AodvHelper::AssignStreams(), ns3::RipHelper::AssignStreams(), ns3::RipNgHelper::AssignStreams(), ns3::OlsrHelper::AssignStreams(), ns3::InternetStackHelper::AssignStreams(), ns3::MobilityHelper::AssignStreams(), ns3::UdpSocketImpl::Bind(), ns3::UdpSocketImpl::BindToNetDevice(), ns3::PointToPointStarHelper::BoundingBox(), ns3::PointToPointGridHelper::BoundingBox(), ns3::PointToPointDumbbellHelper::BoundingBox(), ns3::GlobalRouteManagerImpl::BuildGlobalRoutingDatabase(), ns3::GlobalRouter::BuildNetworkLSAs(), ns3::LteHelper::ChannelModelInitialization(), LteX2HandoverTestCase::CheckConnected(), LteRrcConnectionEstablishmentTestCase::CheckConnected(), LteX2HandoverMeasuresTestCase::CheckConnected(), TcFlowControlTestCase::CheckDeviceQueueStopped(), ns3::GlobalRouteManagerImpl::CheckForStubNode(), Ns2MobilityHelperTest::CheckInitialPositions(), LteRrcConnectionEstablishmentTestCase::CheckNotConnected(), TcFlowControlTestCase::CheckPacketsInQueueDisc(), ns3::Ipv4RawSocketImpl::Close(), ns3::Ipv6RawSocketImpl::Close(), ns3::LrWpanNetDevice::CompleteConfig(), WaypointMobilityModelNotifyTest::CourseChangeCallback(), ns3::SpectrumWifiPhyHelper::Create(), ns3::DsrHelper::Create(), ns3::SpectrumPhyHelper::Create(), ns3::ArpL3Protocol::CreateCache(), ns3::olsr::HelloRegressionTest::CreateNodes(), ns3::olsr::TcRegressionTest::CreateNodes(), ThreeGppHttpObjectTestCase::CreateSimpleInternetNode(), ns3::Socket::CreateSocket(), ns3::TcpGeneralTest::CreateSocket(), TestCaseHelper::CreatWaveDevice(), ns3::GlobalRouteManagerImpl::DeleteGlobalRoutes(), ns3::GlobalRouter::DiscoverLSAs(), ns3::Icmpv6L4Protocol::DoDAD(), ns3::EmuEpcHelper::DoInitialize(), ns3::WifiRadioEnergyModelHelper::DoInstall(), ns3::Config::Resolver::DoResolve(), WaveformGeneratorTestCase::DoRun(), SteadyStateRandomWaypointTest::DoRun(), WifiAcMappingTest::DoRun(), ns3::LenaDeactivateBearerTestCase::DoRun(), LenaMimoTestCase::DoRun(), LenaHarqTestCase::DoRun(), LenaRrFfMacSchedulerTestCase::DoRun(), WaypointMobilityModelNotifyTest::DoRun(), LenaDataPhyErrorModelTestCase::DoRun(), LteRrcConnectionEstablishmentTestCase::DoRun(), Ipv4PacketInfoTagTest::DoRun(), LenaPfFfMacSchedulerTestCase1::DoRun(), LenaTdBetFfMacSchedulerTestCase1::DoRun(), LenaTdMtFfMacSchedulerTestCase::DoRun(), LenaTtaFfMacSchedulerTestCase::DoRun(), SixlowpanFragmentationTest::DoRun(), LenaCqaFfMacSchedulerTestCase1::DoRun(), SixlowpanHc1ImplTest::DoRun(), LenaFdBetFfMacSchedulerTestCase1::DoRun(), LenaFdMtFfMacSchedulerTestCase::DoRun(), LenaPssFfMacSchedulerTestCase1::DoRun(), LenaTdTbfqFfMacSchedulerTestCase1::DoRun(), RandomRoomPositionAllocatorTestCase::DoRun(), LteInterferenceHardFrTestCase::DoRun(), LenaFdTbfqFfMacSchedulerTestCase1::DoRun(), LteLinkAdaptationTestCase::DoRun(), Ipv6ForwardingTest::DoRun(), UdpSocketLoopbackTest::DoRun(), Ipv6RipngTest::DoRun(), Ipv4ForwardingTest::DoRun(), Ipv4RipTest::DoRun(), SixlowpanIphcImplTest::DoRun(), Ipv4StaticRoutingSlash32TestCase::DoRun(), AcousticModemEnergyTestCase::DoRun(), SpectrumIdealPhyTestCase::DoRun(), LtePathlossModelSystemTestCase::DoRun(), Ipv6RawSocketImplTest::DoRun(), LteEnbAntennaTestCase::DoRun(), Ipv4HeaderTest::DoRun(), CarrierAggregationTestCase::DoRun(), LteX2HandoverTestCase::DoRun(), LteInterferenceTestCase::DoRun(), Ipv6PacketInfoTagTest::DoRun(), Ipv4RawSocketImplTest::DoRun(), LteIpv6RoutingTestCase::DoRun(), LteInterferenceStrictFrTestCase::DoRun(), LenaPfFfMacSchedulerTestCase2::DoRun(), LenaTdBetFfMacSchedulerTestCase2::DoRun(), LenaDlCtrlPhyErrorModelTestCase::DoRun(), LenaFdBetFfMacSchedulerTestCase2::DoRun(), LenaTdTbfqFfMacSchedulerTestCase2::DoRun(), EpcS1uDlTestCase::DoRun(), LenaPssFfMacSchedulerTestCase2::DoRun(), LteCellSelectionTestCase::DoRun(), LenaCqaFfMacSchedulerTestCase2::DoRun(), LteDownlinkPowerControlTestCase::DoRun(), ThreeGppHttpObjectTestCase::DoRun(), Ipv4FragmentationTest::DoRun(), LenaFdTbfqFfMacSchedulerTestCase2::DoRun(), LteX2HandoverMeasuresTestCase::DoRun(), LteEpcE2eDataTestCase::DoRun(), Udp6SocketLoopbackTest::DoRun(), LteHandoverTargetTestCase::DoRun(), Ipv6FragmentationTest::DoRun(), LinkTest::DoRun(), LteHardFrTestCase::DoRun(), LteUplinkOpenLoopPowerControlTestCase::DoRun(), SameRoomPositionAllocatorTestCase::DoRun(), LteUplinkClosedLoopPowerControlAbsoluteModeTestCase::DoRun(), LteStrictFrTestCase::DoRun(), LteUplinkClosedLoopPowerControlAccumulatedModeTestCase::DoRun(), WaypointMobilityModelAddWaypointTest::DoRun(), ChainRegressionTest::DoRun(), LteUeMeasurementsPiecewiseTestCase1::DoRun(), LanTest::DoRun(), UdpSocketImplTest::DoRun(), AcousticModemEnergyDepletionTestCase::DoRun(), InterferenceHelperSequenceTest::DoRun(), TwoLinkTest::DoRun(), Ipv4RipCountToInfinityTest::DoRun(), Ipv6RipngCountToInfinityTest::DoRun(), LteStrictFrAreaTestCase::DoRun(), LteSoftFrAreaTestCase::DoRun(), EpcS1uUlTestCase::DoRun(), LteUeMeasurementsPiecewiseTestCase2::DoRun(), WaypointMobilityModelViaHelper::DoRun(), LteSoftFfrAreaTestCase::DoRun(), LteEnhancedFfrAreaTestCase::DoRun(), LteDistributedFfrAreaTestCase::DoRun(), ns3::tests::ObjectFactoryTestCase::DoRun(), TwoLanTest::DoRun(), LteUeMeasurementsHandoverTestCase::DoRun(), Udp6SocketImplTest::DoRun(), BridgeTest::DoRun(), LteRrcConnectionEstablishmentErrorTestCase::DoRun(), TwoBridgeTest::DoRun(), Ipv4DynamicGlobalRoutingTestCase::DoRun(), Ipv4GlobalRoutingSlash32TestCase::DoRun(), PointerAttributeTestCase::DoRun(), ns3::SixLowPanNetDevice::DoSend(), ns3::UdpSocketImpl::DoSendTo(), ns3::Ipv4Interface::DoSetup(), ns3::Ipv6Interface::DoSetup(), ns3::AsciiTraceHelperForIpv4::EnableAsciiIpv4Impl(), ns3::AsciiTraceHelperForIpv6::EnableAsciiIpv6Impl(), ns3::PcapHelperForIpv4::EnablePcapIpv4(), ns3::PcapHelperForIpv6::EnablePcapIpv6(), ns3::Names::Find(), ns3::LteStatsCalculator::FindCellIdFromEnbRlcPath(), ns3::LteStatsCalculator::FindImsiFromEnbRlcPath(), ns3::LteStatsCalculator::FindImsiFromLteNetDevice(), ns3::LteStatsCalculator::FindImsiFromUePhy(), ns3::GlobalRouteManagerImpl::FindOutgoingInterfaceId(), WaypointMobilityModelNotifyTest::ForceUpdates(), ns3::Icmpv4L4Protocol::Forward(), ns3::Icmpv6L4Protocol::Forward(), ns3::BsmApplication::GenerateWaveTraffic(), OcbWifiMacTestCase::GetCurrentPosition(), ns3::MobilityHelper::GetDistanceSquaredBetween(), ns3::PcapHelper::GetFilenameFromInterfacePair(), ns3::AsciiTraceHelper::GetFilenameFromInterfacePair(), ns3::Ipv6ExtensionFragment::GetFragments(), ns3::MeshWifiInterfaceMac::GetFrequencyChannel(), ns3::Ipv4L3Protocol::GetIcmp(), ns3::Ipv6L3Protocol::GetIcmpv6(), ns3::dsr::DsrRouting::GetIDfromIP(), ns3::dsr::DsrOptions::GetIDfromIP(), ns3::dsr::DsrRouting::GetIPfromID(), ns3::dsr::DsrRouting::GetIPfromMAC(), ns3::ItuR1238PropagationLossModel::GetLoss(), ns3::OhBuildingsPropagationLossModel::GetLoss(), ns3::HybridBuildingsPropagationLossModel::GetLoss(), ns3::SameRoomPositionAllocator::GetNext(), ns3::BsmApplication::GetNode(), ns3::dsr::DsrRouting::GetNodeWithAddress(), ns3::dsr::DsrOptions::GetNodeWithAddress(), Experiment::GetPosition(), NodeStatistics::GetPosition(), GetPosition(), ns3::BuildingsPropagationLossModel::GetShadowing(), ns3::PointToPointEpcHelper::GetUeDefaultGatewayAddress(), ns3::EmuEpcHelper::GetUeDefaultGatewayAddress(), ns3::PointToPointEpcHelper::GetUeDefaultGatewayAddress6(), ns3::EmuEpcHelper::GetUeDefaultGatewayAddress6(), GetYansWifiPhyPtr(), SetChannelFrequencyTest::GetYansWifiPhyPtr(), ns3::Ipv6ExtensionFragment::HandleFragmentsTimeout(), ns3::Ipv4L3Protocol::HandleFragmentsTimeout(), ns3::SixLowPanNetDevice::HandleFragmentsTimeout(), ns3::Icmpv6L4Protocol::HandleNS(), ns3::Icmpv6L4Protocol::HandlePacketTooBig(), ns3::Icmpv6L4Protocol::HandleRA(), ns3::Radvd::HandleRead(), ns3::BsmApplication::HandleReceivedBsmPacket(), ns3::Icmpv6L4Protocol::HandleRedirection(), ns3::Icmpv6L4Protocol::HandleRS(), ns3::GlobalRouteManagerImpl::InitializeRoutes(), ns3::BuildingsHelper::Install(), ns3::FlowMonitorHelper::Install(), ns3::WaveBsmHelper::Install(), ns3::EnergyHarvesterHelper::Install(), ns3::RadioEnvironmentMapHelper::Install(), ns3::CsmaHelper::Install(), ns3::WaveformGeneratorHelper::Install(), ns3::TvSpectrumTransmitterHelper::Install(), ns3::AdhocAlohaNoackIdealPhyHelper::Install(), ns3::SpectrumAnalyzerHelper::Install(), ns3::InternetStackHelper::Install(), ns3::MobilityHelper::Install(), ns3::UanHelper::Install(), ns3::WifiHelper::Install(), ns3::TvSpectrumTransmitterHelper::InstallAdjacent(), ns3::FlowMonitorHelper::InstallAll(), AodvExample::InstallApplications(), DsdvManetExample::InstallApplications(), ns3::DhcpHelper::InstallDhcpClientPriv(), ns3::DhcpHelper::InstallDhcpServer(), ns3::DhcpHelper::InstallFixedAddress(), ns3::Ipv4L3Protocol::IpForward(), ns3::Ipv6L3Protocol::IpForward(), ns3::Ipv4L3Protocol::IpMulticastForward(), ns3::Ipv6L3Protocol::IpMulticastForward(), ns3::Ipv4FlowProbe::Ipv4FlowProbe(), ns3::Ipv6FlowProbe::Ipv6FlowProbe(), ns3::Ipv6RawSocketImpl::Ipv6JoinGroup(), ns3::UdpSocketImpl::Ipv6JoinGroup(), ns3::DhcpClient::LinkStateHandler(), ns3::Ipv6L3Protocol::LocalDeliver(), LteFadingTestSuite::LteFadingTestSuite(), ns3::BuildingsHelper::MakeConsistent(), ns3::BuildingsHelper::MakeMobilityModelConsistent(), ns3::UdpL4Protocol::NotifyNewAggregate(), ns3::TcpL4Protocol::NotifyNewAggregate(), ns3::dsr::DsrRouting::NotifyNewAggregate(), ns3::PointToPointEpcHelper::PointToPointEpcHelper(), OcbWifiMacTestCase::PostDeviceConfiguration(), ns3::Ipv4RoutingHelper::Print(), ns3::Ipv6RoutingHelper::Print(), ns3::Ipv4RoutingHelper::PrintArpCache(), ns3::Ipv4RoutingHelper::PrintArpCacheEvery(), ns3::Ipv4RoutingHelper::PrintEvery(), ns3::Ipv6RoutingHelper::PrintEvery(), PrintGnuplottableEnbListToFile(), PrintGnuplottableUeListToFile(), IpAddressHelper::PrintIpAddresses(), ns3::Ipv6RoutingHelper::PrintNdiscCache(), ns3::Ipv6RoutingHelper::PrintNdiscCacheEvery(), PrintPosition(), ns3::dsr::DsrOptionRreq::Process(), ns3::dsr::DsrOptionRrep::Process(), ns3::dsr::DsrOptionSR::Process(), ns3::dsr::DsrOptionRerr::Process(), ns3::Ipv6ExtensionRouting::Process(), ns3::dsr::DsrOptionAckReq::Process(), ns3::dsr::DsrOptionAck::Process(), ns3::Ipv6ExtensionLooseRouting::Process(), ns3::GlobalRouter::ProcessBridgedBroadcastLink(), ns3::SixLowPanNetDevice::ProcessFragment(), ns3::Ipv6Extension::ProcessOptions(), ns3::GlobalRouter::ProcessPointToPointLink(), ns3::GlobalRouter::ProcessSingleBroadcastLink(), ns3::dsr::DsrRouting::PromiscReceive(), ns3::Ipv6L3Protocol::Receive(), ns3::Ipv4L3Protocol::Receive(), ns3::Icmpv6L4Protocol::Receive(), ns3::dsr::DsrRouting::Receive(), ns3::SixLowPanNetDevice::ReceiveFromDevice(), ns3::AnimationInterface::RecursiveIpv4RoutePathSearch(), ns3::DhcpClient::RemoveAndStart(), ns3::Ipv6AutoconfiguredPrefix::RemoveMe(), ns3::MeshHelper::Report(), ns3::Ipv6L3Protocol::ReportDrop(), HwmpSimplestRegressionTest::ResetPosition(), HwmpReactiveRegressionTest::ResetPosition(), ns3::MeshHelper::ResetStats(), ns3::Ipv4L3Protocol::RouteInputError(), ns3::Ipv6L3Protocol::RouteInputError(), NetAnimExperiment::Run(), Experiment::Run(), RoutingExperiment::Run(), ns3::SameRoomPositionAllocator::SameRoomPositionAllocator(), ns3::SimpleOfdmWimaxChannel::Send(), ns3::YansWifiChannel::Send(), ns3::Ping6::Send(), ns3::Radvd::Send(), ns3::Ipv6L3Protocol::Send(), ns3::Ipv4Interface::Send(), ns3::Ipv4L3Protocol::Send(), ns3::Ipv6Interface::Send(), ns3::NscTcpL4Protocol::send_callback(), ns3::ArpL3Protocol::SendArpRequest(), ns3::Icmpv6L4Protocol::SendMessage(), ns3::Icmpv4L4Protocol::SendMessage(), ns3::DhcpServer::SendOffer(), ns3::TcpL4Protocol::SendPacketV4(), ns3::TcpL4Protocol::SendPacketV6(), ns3::Ipv4L3Protocol::SendRealOut(), ns3::Ipv6L3Protocol::SendRealOut(), ns3::Ipv4RawSocketImpl::SendTo(), ns3::Ipv6RawSocketImpl::SendTo(), ns3::RipNgHelper::SetDefaultRouter(), ns3::RipHelper::SetDefaultRouter(), ns3::UdpEchoClientHelper::SetFill(), Experiment::SetPosition(), SetPosition(), NodeStatistics::SetPosition(), ns3::MobilityHelper::SetPositionAllocator(), ns3::LteHexGridEnbTopologyHelper::SetPositionAndInstallEnbDevice(), VanetRoutingExperiment::SetupAdhocMobilityNodes(), UanExperiment::SetupCommunications(), ns3::UeManager::SetupDataRadioBearer(), TcpTestCase::SetupDefaultSim(), TcpTestCase::SetupDefaultSim6(), ns3::TcpSocketBase::SetupEndpoint(), ns3::TcpSocketBase::SetupEndpoint6(), DsdvManetExample::SetupMobility(), showPosition(), ns3::GlobalRouteManagerImpl::SPFAddASExternal(), ns3::GlobalRouteManagerImpl::SPFIntraAddRouter(), ns3::GlobalRouteManagerImpl::SPFIntraAddStub(), ns3::GlobalRouteManagerImpl::SPFIntraAddTransit(), Receiver::StartApplication(), ns3::DhcpServer::StartApplication(), ns3::DhcpClient::StartApplication(), ns3::Radvd::StartApplication(), ns3::DhcpClient::StopApplication(), ns3::MeshWifiInterfaceMac::SwitchFrequencyChannel(), TearDownLink(), LteFrAreaTestCase::TeleportUe2(), ns3::AnimationInterface::TrackIpv4RoutePaths(), Tunnel::Tunnel(), ns3::UanChannel::TxPacket(), GlobalPathlossDatabase::UpdatePathloss(), NetAnimExperiment::UpdatePositions(), and Experiment::UpdatePositions().
Get a pointer to the requested aggregated Object by TypeId.
Definition at line 479 of file object.h.
References DoGetObject(), and ns3::PeekPointer().
|
static |
Register this type.
Definition at line 86 of file object.cc.
References ns3::TypeId::SetParent().
Referenced by DoGetObject().
void Object::Initialize | ( | void | ) |
Invoke DoInitialize on all Objects aggregated to this one.
This method calls the virtual DoInitialize() method on all the Objects aggregated to this Object. DoInitialize() will be called only once over the lifetime of an Object, just like DoDispose() is called only once.
Note: the code here is a bit tricky because we need to protect ourselves from modifications in the aggregate array while DoInitialize is called. The user's implementation of the DoInitialize method could call GetObject (which could reorder the array) and it could call AggregateObject which would add an object at the end of the array. To be safe, we restart iteration over the array whenever we call some user code, just in case.
Definition at line 183 of file object.cc.
References ns3::Object::Aggregates::buffer, DoInitialize(), m_aggregates, m_initialized, sample-rng-plot::n, ns3::Object::Aggregates::n, and NS_LOG_FUNCTION.
Referenced by ns3::BuildingListPriv::Add(), ns3::NodeListPriv::Add(), ns3::Node::AddApplication(), ns3::Node::AddDevice(), ns3::EmuEpcHelper::AddEnb(), ns3::LteUeRrc::ApplyRadioResourceConfigDedicated(), ns3::PrioQueueDisc::CheckConfig(), ns3::TbfQueueDisc::CheckConfig(), ns3::FqCoDelQueueDisc::DoEnqueue(), ns3::WifiNetDevice::DoInitialize(), ns3::Node::DoInitialize(), ns3::RegularWifiMac::DoInitialize(), ns3::ApWifiMac::DoInitialize(), ns3::WaveNetDevice::DoInitialize(), SteadyStateRandomWaypointTest::DoRun(), WaypointMobilityModelNotifyTest::DoRun(), FqCoDelQueueDiscNoSuitableFilter::DoRun(), CoDelQueueDiscBasicEnqueueDequeue::DoRun(), FqCoDelQueueDiscIPFlowsSeparationAndPacketLimit::DoRun(), PrioQueueDiscTestCase::DoRun(), WaypointMobilityModelAddWaypointTest::DoRun(), FqCoDelQueueDiscDeficit::DoRun(), CoDelQueueDiscBasicOverflow::DoRun(), QueueDiscTracesTestCase::DoRun(), FqCoDelQueueDiscTCPFlowsSeparation::DoRun(), CoDelQueueDiscBasicDrop::DoRun(), FqCoDelQueueDiscUDPFlowsSeparation::DoRun(), ns3::LteSimpleHelper::InstallEnbDevice(), ns3::LteHelper::InstallEnbDevice(), ns3::LteHelper::InstallSingleEnbDevice(), AredQueueDiscTestCase::RunAredDiscTest(), FifoQueueDiscTestCase::RunFifoTest(), PieQueueDiscTestCase::RunPieTest(), RedQueueDiscTestCase::RunRedTest(), and TbfQueueDiscTestCase::RunTbfTest().
bool Object::IsInitialized | ( | void | ) | const |
Check if the object has been initialized.
returns true if the object has been initialized.
Definition at line 208 of file object.cc.
References m_initialized, and NS_LOG_FUNCTION.
Referenced by ns3::SpectrumWifiPhy::ConfigureStandard(), ns3::WifiPhy::DoChannelSwitch(), ns3::WifiPhy::DoFrequencySwitch(), ns3::SpectrumWifiPhy::ResetSpectrumModel(), ns3::SpectrumWifiPhy::SetChannelNumber(), ns3::SpectrumWifiPhy::SetChannelWidth(), ns3::ThreeGppHttpVariables::SetEmbeddedObjectSizeMean(), ns3::ThreeGppHttpVariables::SetEmbeddedObjectSizeStdDev(), ns3::SpectrumWifiPhy::SetFrequency(), ns3::ThreeGppHttpVariables::SetMainObjectSizeMean(), and ns3::ThreeGppHttpVariables::SetMainObjectSizeStdDev().
|
protectedvirtual |
Notify all Objects aggregated to this one of a new Object being aggregated.
This function must be implemented in the stack that needs to notify other stacks connected to the node of their presence in the node.
This method is invoked whenever two sets of Objects are aggregated together. It is invoked exactly once for each Object in both sets. This method can be overridden by subclasses who wish to be notified of aggregation events. These subclasses must chain up to their base class NotifyNewAggregate() method.
It is safe to call GetObject() and AggregateObject() from within this method.
Reimplemented in ns3::dsr::DsrRouting, ns3::Ipv6L3Protocol, ns3::CsmaNetDevice, ns3::TcpL4Protocol, ns3::Ipv4L3Protocol, ns3::UdpL4Protocol, ns3::TrafficControlLayer, ns3::PointToPointNetDevice, ns3::NscTcpL4Protocol, ns3::SimpleNetDevice, ns3::Icmpv4L4Protocol, ns3::ArpL3Protocol, ns3::Icmpv6L4Protocol, and ns3::WifiNetDevice.
Definition at line 325 of file object.cc.
References NS_LOG_FUNCTION.
Referenced by AggregateObject(), ns3::WifiNetDevice::NotifyNewAggregate(), ns3::Icmpv6L4Protocol::NotifyNewAggregate(), ns3::ArpL3Protocol::NotifyNewAggregate(), ns3::Icmpv4L4Protocol::NotifyNewAggregate(), ns3::SimpleNetDevice::NotifyNewAggregate(), ns3::NscTcpL4Protocol::NotifyNewAggregate(), ns3::PointToPointNetDevice::NotifyNewAggregate(), ns3::TrafficControlLayer::NotifyNewAggregate(), ns3::UdpL4Protocol::NotifyNewAggregate(), ns3::Ipv4L3Protocol::NotifyNewAggregate(), ns3::TcpL4Protocol::NotifyNewAggregate(), ns3::CsmaNetDevice::NotifyNewAggregate(), ns3::Ipv6L3Protocol::NotifyNewAggregate(), and ns3::dsr::DsrRouting::NotifyNewAggregate().
|
private |
Set the TypeId of this Object.
[in] | tid | The TypeId value to set. |
Invoked from ns3::CreateObject only. Initialize the m_tid
member variable to keep track of the type of this Object instance.
Definition at line 338 of file object.cc.
References Check(), m_tid, NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by ns3::ObjectFactory::Create().
|
private |
Keep the list of aggregates in most-recently-used order.
[in,out] | aggregates | The list of aggregated Objects. |
[in] | i | The most recently used entry in the list. |
Definition at line 239 of file object.cc.
References ns3::Object::Aggregates::buffer, m_getObjectCount, and NS_LOG_FUNCTION.
Referenced by AggregateObject(), and DoGetObject().
|
friend |
Definition at line 320 of file object.h.
Referenced by GetAggregateIterator().
|
friend |
Copy an Object.
[in] | object | A pointer to the object to copy. |
This method invoke the copy constructor of the input object and returns the new instance.
Definition at line 494 of file object.h.
Referenced by ns3::TcpSocketBase::TcpSocketBase(), and ns3::TcpYeah::TcpYeah().
|
friend |
|
friend |
Definition at line 319 of file object.h.
Referenced by ns3::LteHelper::SetEnbComponentCarrierManagerType(), ns3::LteHelper::SetFadingModel(), ns3::LteHelper::SetFfrAlgorithmType(), ns3::LteHelper::SetHandoverAlgorithmType(), ns3::LteHelper::SetPathlossModelType(), ns3::LteHelper::SetSchedulerType(), and ns3::LteHelper::SetUeComponentCarrierManagerType().
|
private |
A pointer to an array of 'aggregates'.
A pointer to each Object aggregated to this Object is stored in this array. The array is shared by all aggregated Objects so the size of the array is indirectly a reference count.
Definition at line 426 of file object.h.
Referenced by AggregateObject(), CheckLoose(), Dispose(), DoDelete(), DoGetObject(), GetObject(), Initialize(), ns3::Object::AggregateIterator::Next(), Object(), and ~Object().
|
private |
Set to true
when the DoDispose() method of the Object has run, false
otherwise.
Definition at line 413 of file object.h.
Referenced by AggregateObject(), Dispose(), DoDelete(), and DoDispose().
|
private |
The number of times the Object was accessed with a call to GetObject().
This integer is used to implement a heuristic to sort the array of aggregates in most-frequently accessed order.
Definition at line 434 of file object.h.
Referenced by DoGetObject(), and UpdateSortedArray().
|
private |
Set to true
once the DoInitialize() method has run, false
otherwise.
Definition at line 418 of file object.h.
Referenced by DoInitialize(), Initialize(), and IsInitialized().
|
private |
Identifies the type of this Object instance.
Definition at line 408 of file object.h.
Referenced by GetInstanceTypeId(), and SetTypeId().