A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::Object Class Reference

A base class which provides memory management and object aggregation. More...

#include "object.h"

Inherits ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >.

Inherited by AttributeContainerObject, AttributeObjectTest, ConfigExample, DeprecatedAttribute, Derived, Emitter, LengthValueTestCase::TestObject, MyObject, PairObject, PtrExample, SampleEmitter, TracedCallbackTypedefTestCase::Checker< Ts >, TracedValueCallbackTestCase::CheckTvCb< T >, TupleObject, anonymous_namespace{log-example.cc}::MyEventObject, anonymous_namespace{object-test-suite.cc}::BaseA, anonymous_namespace{object-test-suite.cc}::BaseB, anonymous_namespace{sequence-number-test-suite.cc}::SequenceNumberTestObj, anonymous_namespace{test-string-value-formatting.cc}::FormattingTestObject, ns3::AntennaModel, ns3::Application, ns3::ArpCache, ns3::ArpL3Protocol, ns3::AthstatsWifiTraceSink, ns3::BSLinkManager, ns3::BSScheduler, ns3::BandwidthManager, ns3::BlockAckManager, ns3::Building, ns3::BuildingListPriv, ns3::BurstProfileManager, ns3::CcHelper, ns3::Channel, ns3::ChannelAccessManager, ns3::ChannelCondition, ns3::ChannelConditionModel, ns3::ChannelListPriv, ns3::ComponentCarrier, ns3::ConnectionManager, ns3::DataCalculator, ns3::DataCollectionObject, ns3::DataCollector, ns3::DataOutputInterface, ns3::DeviceEnergyModel, ns3::EhtConfiguration, ns3::EmlsrManager, ns3::EnergyHarvester, ns3::EnergyHarvesterContainer, ns3::EnergySource, ns3::EnergySourceContainer, ns3::EpcHelper, ns3::EpcTestRrc, ns3::EpcUeNas, ns3::EpcX2, ns3::ErrorModel, ns3::ErrorRateModel, ns3::FfMacScheduler, ns3::FlowMonitor, ns3::FlowProbe, ns3::FrameCaptureModel, ns3::FrameExchangeManager, ns3::GlobalRouter, ns3::GrantedTimeWindowMpiInterface [private], ns3::GridBuildingAllocator, ns3::HeConfiguration, ns3::HtConfiguration, ns3::InterferenceHelper, ns3::IpL4Protocol, ns3::IpcsClassifier, ns3::Ipv4, ns3::Ipv4Interface, ns3::Ipv4RoutingProtocol, ns3::Ipv6, ns3::Ipv6AutoconfiguredPrefix, ns3::Ipv6Extension, ns3::Ipv6ExtensionDemux, ns3::Ipv6ExtensionRoutingDemux, ns3::Ipv6Interface, ns3::Ipv6Option, ns3::Ipv6OptionDemux, ns3::Ipv6PmtuCache, ns3::Ipv6RoutingProtocol, ns3::JakesProcess, ns3::LteAmc, ns3::LteAnr, ns3::LteEnbComponentCarrierManager, ns3::LteEnbMac, ns3::LteEnbRrc, ns3::LteEnbRrcProtocolIdeal, ns3::LteEnbRrcProtocolReal, ns3::LteFfrAlgorithm, ns3::LteHandoverAlgorithm, ns3::LteHelper, ns3::LteHexGridEnbTopologyHelper, ns3::LteInterference, ns3::LtePdcp, ns3::LtePhy, ns3::LteRadioBearerInfo, ns3::LteRlc, ns3::LteSimpleHelper, ns3::LteStatsCalculator, ns3::LteTestMac, ns3::LteTestPdcp, ns3::LteTestRrc, ns3::LteUeComponentCarrierManager, ns3::LteUeMac, ns3::LteUePowerControl, ns3::LteUeRrc, ns3::LteUeRrcProtocolIdeal, ns3::LteUeRrcProtocolReal, ns3::MatrixBasedChannelModel, ns3::MeshL2RoutingProtocol, ns3::MeshStack, ns3::MobilityBuildingInfo, ns3::MobilityModel, ns3::MpduAggregator, ns3::MpiReceiver, ns3::MsduAggregator, ns3::MultiUserScheduler, ns3::NdiscCache, ns3::NetDevice, ns3::NetDeviceQueue, ns3::NetDeviceQueueInterface, ns3::Node, ns3::NodeListPriv, ns3::NullMessageMpiInterface [private], ns3::ObssPdAlgorithm, ns3::PacketBurst, ns3::PacketFilter, ns3::PcapFileWrapper, ns3::PhasedArrayModel, ns3::PhasedArraySpectrumPropagationLossModel, ns3::PositionAllocator, ns3::PreambleDetectionModel, ns3::PriorityUlJob, ns3::PropagationDelayModel, ns3::PropagationLossModel, ns3::QueueBase, ns3::QueueDisc, ns3::QueueDiscClass, ns3::QueueLimits, ns3::RadioEnvironmentMapHelper, ns3::RandomVariableStream, ns3::RemoteChannelBundle, ns3::RttEstimator, ns3::SSLinkManager, ns3::SSManager, ns3::SSScheduler, ns3::Scheduler, ns3::ServiceFlowManager, ns3::SimulatorImpl, ns3::Socket, ns3::SocketFactory, ns3::SpectrumErrorModel, ns3::SpectrumInterference, ns3::SpectrumPhy, ns3::SpectrumPropagationLossModel, ns3::SpectrumTransmitFilter, ns3::Synchronizer, ns3::TcpCongestionOps, ns3::TcpOption, ns3::TcpRateOps, ns3::TcpRecoveryOps, ns3::TcpRxBuffer, ns3::TcpSocketState, ns3::TcpTxBuffer, ns3::ThreeGppHttpVariables, ns3::TopologyReader, ns3::TrafficControlLayer, ns3::Txop, ns3::UanMac, ns3::UanNoiseModel, ns3::UanPhy, ns3::UanPhyCalcSinr, ns3::UanPhyPer, ns3::UanPropModel, ns3::UanTransducer, ns3::UeManager, ns3::UlJob, ns3::UplinkScheduler, ns3::VhtConfiguration, ns3::WifiAckManager, ns3::WifiAssocManager, ns3::WifiMac, ns3::WifiMacQueueScheduler, ns3::WifiPhy, ns3::WifiPhyStateHelper, ns3::WifiProtectionManager, ns3::WifiRemoteStationManager, ns3::WifiTxCurrentModel, ns3::WimaxConnection, ns3::WimaxMacQueue, ns3::WimaxPhy, ns3::dot11s::AirtimeLinkMetricCalculator, ns3::dot11s::HwmpRtable, ns3::dot11s::PeerLink, ns3::dot11s::PeerManagementProtocol, ns3::dsr::DsrGraReply, ns3::dsr::DsrNetworkQueue, ns3::dsr::DsrOptions, ns3::dsr::DsrPassiveBuffer, ns3::dsr::DsrRouteCache, ns3::dsr::DsrRreqTable, ns3::flame::FlameRtable, ns3::lrwpan::LrWpanCsmaCa, ns3::lrwpan::LrWpanErrorModel, ns3::lrwpan::LrWpanMacBase, ns3::ofi::Controller, ns3::tests::AlternateTestObject, ns3::tests::BaseConfigObject, ns3::tests::ConfigTestObject, and ns3::tests::TestObject.

+ Collaboration diagram for ns3::Object:

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.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
virtual TypeId GetInstanceTypeId () const =0
 Get the most derived TypeId for this Object.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 

Protected Member Functions

 Object (const Object &o)
 Copy an Object.
 
virtual void DoDispose ()
 Destructor implementation.
 
virtual void DoInitialize ()
 Initialize() implementation.
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.
 

Private Member Functions

bool Check () const
 Verify that this Object is still live, by checking it's reference count.
 
bool CheckLoose () const
 Check if any aggregated Objects have non-zero reference counts.
 
void Construct (const AttributeConstructionList &attributes)
 Initialize all member variables registered as Attributes of this TypeId.
 
void DoDelete ()
 Attempt to delete this Object.
 
Ptr< ObjectDoGetObject (TypeId tid) const
 Find an Object of TypeId tid in the aggregates of this Object.
 
void SetTypeId (TypeId tid)
 Set the TypeId of this Object.
 
void UpdateSortedArray (Aggregates *aggregates, uint32_t i) const
 Keep the list of aggregates in most-recently-used order.
 

Private Attributes

Aggregatesm_aggregates
 A pointer to an array of 'aggregates'.
 
bool m_disposed
 Set to true when the DoDispose() method of the Object has run, false otherwise.
 
uint32_t m_getObjectCount
 The number of times the Object was accessed with a call to GetObject().
 
bool m_initialized
 Set to true once the DoInitialize() method has run, false otherwise.
 
TypeId m_tid
 Identifies the type of this Object instance.
 
std::vector< Ptr< Object > > m_unidirectionalAggregates
 An array of unidirectional aggregates, i.e., objects that are aggregated to the current object, but not vice-versa.
 

Friends

template<typename T >
Ptr< T > CompleteConstruct (T *object)
 Set the TypeId and construct all Attributes of an Object.
 
class ObjectFactory
 Friends.
 
class AggregateIterator
 Friends.
 
struct ObjectDeleter
 Friends.
 
template<typename T >
Ptr< T > CopyObject (Ptr< T > object)
 Copy an Object.
 
template<typename T >
Ptr< T > CopyObject (Ptr< const T > object)
 

Additional Inherited Members

Detailed Description

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 56 bytes (on a 64-bit architecture).

Definition at line 88 of file object.h.

Constructor & Destructor Documentation

◆ Object() [1/2]

ns3::Object::Object ( )

Constructor.

Definition at line 107 of file object.cc.

References ns3::Object::Aggregates::buffer, m_aggregates, ns3::Object::Aggregates::n, and NS_LOG_FUNCTION.

◆ ~Object()

ns3::Object::~Object ( )
override

◆ Object() [2/2]

ns3::Object::Object ( const Object o)
protected

Copy an Object.

Parameters
[in]othe 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 145 of file object.cc.

References ns3::Object::Aggregates::buffer, m_aggregates, and ns3::Object::Aggregates::n.

Member Function Documentation

◆ AggregateObject()

void ns3::Object::AggregateObject ( Ptr< Object other)

Aggregate two Objects together.

Parameters
[in]otherThe 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.

See also
NotifyNewAggregate()

Definition at line 309 of file object.cc.

References ns3::Object::Aggregates::buffer, CheckLoose(), DoGetObject(), GetInstanceTypeId(), m_aggregates, m_disposed, ns3::Object::Aggregates::n, NotifyNewAggregate(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, ns3::PeekPointer(), and UpdateSortedArray().

Referenced by ns3::Ipv6L3Protocol::Ipv6L3Protocol(), ns3::RadioEnvironmentMapHelper::DelayedInstall(), BuildingsChannelConditionModelTestCase::DoRun(), BuildingsPenetrationLossesTestCase::DoRun(), ThreeGppV2vBuildingsChCondModelTestCase::DoRun(), ThreeGppV2vUrbanLosNlosvChCondModelTestCase::DoRun(), ThreeGppV2vHighwayLosNlosvChCondModelTestCase::DoRun(), LiIonEnergyTestCase::DoRun(), WaypointLazyNotifyFalse::DoRun(), WaypointLazyNotifyTrue::DoRun(), ThreeGppChannelConditionModelTestCase::DoRun(), V2vUrbanProbChCondModelTestCase::DoRun(), V2vHighwayProbChCondModelTestCase::DoRun(), ThreeGppRmaPropagationLossModelTestCase::DoRun(), ThreeGppUmaPropagationLossModelTestCase::DoRun(), ThreeGppUmiPropagationLossModelTestCase::DoRun(), ThreeGppIndoorOfficePropagationLossModelTestCase::DoRun(), ThreeGppV2vUrbanPropagationLossModelTestCase::DoRun(), ThreeGppV2vHighwayPropagationLossModelTestCase::DoRun(), ThreeGppChannelMatrixComputationTest::DoRun(), ThreeGppChannelMatrixUpdateTest::DoRun(), ThreeGppSpectrumPropagationLossModelTest::DoRun(), ThreeGppCalcLongTermMultiPortTest::DoRun(), ThreeGppMimoPolarizationTest::DoRun(), TcFlowControlTestCase::DoRun(), AcousticModemEnergyTestCase::DoRun(), AcousticModemEnergyDepletionTestCase::DoRun(), EmlsrDlTxopTest::DoSetup(), MultiLinkMuTxTest::DoSetup(), WifiPhyCcaThresholdsTest::DoSetup(), experiment(), AnimationRemainingEnergyTestCase::PrepareNetwork(), ns3::Ipv6L3Protocol::RegisterExtensions(), ns3::Ipv6L3Protocol::RegisterOptions(), TbfQueueDiscTestCase::RunTbfTest(), and ThreeGppShadowingTestCase::RunTest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Check()

bool ns3::Object::Check ( ) const
private

Verify that this Object is still live, by checking it's reference count.

Returns
true if the reference count is non zero.

Definition at line 458 of file object.cc.

References ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >::GetReferenceCount(), and NS_LOG_FUNCTION.

Referenced by SetTypeId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckLoose()

bool ns3::Object::CheckLoose ( ) const
private

Check if any aggregated Objects have non-zero reference counts.

Returns
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 472 of file object.cc.

References ns3::Object::Aggregates::buffer, ns3::SimpleRefCount< T, PARENT, DELETER >::GetReferenceCount(), m_aggregates, ns3::Object::Aggregates::n, and NS_LOG_FUNCTION.

Referenced by AggregateObject(), DoGetObject(), and UnidirectionalAggregateObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Construct()

void ns3::Object::Construct ( const AttributeConstructionList attributes)
private

Initialize all member variables registered as Attributes of this TypeId.

Parameters
[in]attributesThe 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 157 of file object.cc.

References ns3::ObjectBase::ConstructSelf(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ Dispose()

void ns3::Object::Dispose ( )

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.

Note
You can call Dispose() many times on the same Object or different Objects aggregated together, and DoDispose() will be called only once for each aggregated Object.

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 258 of file object.cc.

References ns3::Object::Aggregates::buffer, DoDispose(), m_aggregates, m_disposed, m_unidirectionalAggregates, ns3::Object::Aggregates::n, and NS_LOG_FUNCTION.

Referenced by ns3::WifiMac::LinkEntity::~LinkEntity(), ns3::NoBackhaulEpcHelper::DoDispose(), ns3::LteSimpleHelper::DoDispose(), ns3::ApWifiMac::DoDispose(), ns3::WifiMac::DoDispose(), ns3::WifiNetDevice::DoDispose(), LargestIdlePrimaryChannelTest::DoRun(), SpectrumWifiPhyBasicTest::DoTeardown(), SpectrumWifiPhyFilterTest::DoTeardown(), AmpduAggregationTest::DoTeardown(), TestNonHtDuplicatePhyReception::DoTeardown(), TestMultipleCtsResponsesFromMuRts::DoTeardown(), WifiPhyCcaThresholdsTest::DoTeardown(), WifiPhyCcaIndicationTest::DoTeardown(), TestDlMuMimoPhyTransmission::DoTeardown(), TestDlOfdmaPhyTransmission::DoTeardown(), TestDlOfdmaPhyPuncturing::DoTeardown(), TestUlOfdmaPpduUid::DoTeardown(), TestMultipleHeTbPreambles::DoTeardown(), TestUlOfdmaPhyTransmission::DoTeardown(), TestPhyPaddingExclusion::DoTeardown(), TestUlOfdmaPowerControl::DoTeardown(), WifiPhyReceptionTest::DoTeardown(), TestUnsupportedBandwidthReception::DoTeardown(), TestPrimary20CoveredByPpdu::DoTeardown(), TestSpectrumChannelWithBandwidthFilter::DoTeardown(), WifiPhyThresholdsTest::DoTeardown(), and InterferenceExperiment::Run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoDelete()

void ns3::Object::DoDelete ( )
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 490 of file object.cc.

References ns3::Object::Aggregates::buffer, DoDispose(), ns3::SimpleRefCount< T, PARENT, DELETER >::GetReferenceCount(), m_aggregates, m_disposed, ns3::Object::Aggregates::n, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ DoDispose()

void ns3::Object::DoDispose ( )
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 Sender, Receiver, ns3::aodv::RoutingProtocol, ns3::BulkSendApplication, ns3::OnOffApplication, ns3::PacketSink, ns3::ThreeGppHttpClient, ns3::ThreeGppHttpServer, ns3::BridgeNetDevice, ns3::BuildingListPriv, ns3::Building, ns3::RandomWalk2dOutdoorMobilityModel, ns3::Ipv4ClickRouting, ns3::Ipv4L3ClickProtocol, ns3::DefaultSimulatorImpl, ns3::RealtimeSimulatorImpl, anonymous_namespace{object-test-suite.cc}::DerivedA, anonymous_namespace{object-test-suite.cc}::DerivedB, ns3::CsmaNetDevice, ns3::dsdv::RoutingProtocol, ns3::dsr::DsrRouting, ns3::EnergyHarvesterContainer, ns3::EnergySourceContainer, ns3::BasicEnergyHarvester, ns3::BasicEnergySource, ns3::EnergyHarvester, ns3::EnergySource, ns3::GenericBatteryModel, ns3::LiIonEnergySource, ns3::RvBatteryModel, ns3::SimpleDeviceEnergyModel, ns3::FdNetDevice, ns3::FlowMonitor, ns3::FlowProbe, ns3::Ipv4FlowProbe, ns3::Ipv6FlowProbe, ns3::DhcpClient, ns3::DhcpServer, ns3::Ping, ns3::Radvd, ns3::V4TraceRoute, ns3::ArpCache, ns3::ArpL3Protocol, ns3::GlobalRouter, ns3::Icmpv4L4Protocol, ns3::Icmpv6L4Protocol, ns3::Ipv4GlobalRouting, ns3::Ipv4Interface, ns3::Ipv4L3Protocol, ns3::Ipv4ListRouting, ns3::Ipv4RawSocketImpl, ns3::Ipv4StaticRouting, ns3::Ipv6ExtensionDemux, ns3::Ipv6ExtensionFragment, ns3::Ipv6ExtensionRoutingDemux, ns3::Ipv6Interface, ns3::Ipv6L3Protocol, ns3::Ipv6ListRouting, ns3::Ipv6OptionDemux, ns3::Ipv6PmtuCache, ns3::Ipv6RawSocketImpl, ns3::Ipv6StaticRouting, ns3::LoopbackNetDevice, ns3::NdiscCache, ns3::Rip, ns3::RipNg, ns3::TcpL4Protocol, ns3::TcpSocketFactoryImpl, ns3::UdpL4Protocol, ns3::UdpSocketFactoryImpl, ns3::lrwpan::LrWpanCsmaCa, ns3::lrwpan::LrWpanMac, ns3::lrwpan::LrWpanNetDevice, ns3::lrwpan::LrWpanPhy, ns3::CcHelper, ns3::EmuEpcHelper, ns3::EpcHelper, ns3::LteHelper, ns3::LteHexGridEnbTopologyHelper, ns3::NoBackhaulEpcHelper, ns3::PointToPointEpcHelper, ns3::RadioBearerStatsCalculator, ns3::RadioEnvironmentMapHelper, ns3::A2A4RsrqHandoverAlgorithm, ns3::A3RsrpHandoverAlgorithm, ns3::ComponentCarrierEnb, ns3::ComponentCarrierUe, ns3::ComponentCarrier, ns3::CqaFfMacScheduler, ns3::EpcEnbApplication, ns3::EpcMmeApplication, ns3::EpcPgwApplication, ns3::EpcSgwApplication, ns3::EpcUeNas, ns3::EpcX2, ns3::FdBetFfMacScheduler, ns3::FdMtFfMacScheduler, ns3::FdTbfqFfMacScheduler, ns3::FfMacScheduler, ns3::LteAnr, ns3::LteEnbComponentCarrierManager, ns3::LteEnbMac, ns3::LteEnbNetDevice, ns3::LteEnbPhy, ns3::UeManager, ns3::LteEnbRrc, ns3::LteFfrAlgorithm, ns3::LteFfrDistributedAlgorithm, ns3::LteFfrEnhancedAlgorithm, ns3::LteFfrSoftAlgorithm, ns3::LteFrHardAlgorithm, ns3::LteFrNoOpAlgorithm, ns3::LteFrSoftAlgorithm, ns3::LteFrStrictAlgorithm, ns3::LteHandoverAlgorithm, ns3::LteInterference, ns3::LteNetDevice, ns3::LtePdcp, ns3::LtePhy, ns3::LteRlcAm, ns3::LteRlcTm, ns3::LteRlcUm, ns3::LteRlc, ns3::LteRlcSm, ns3::LteUeRrcProtocolIdeal, ns3::LteEnbRrcProtocolIdeal, ns3::LteUeRrcProtocolReal, ns3::LteEnbRrcProtocolReal, ns3::LteSpectrumPhy, ns3::LteUeComponentCarrierManager, ns3::LteUeMac, ns3::LteUeNetDevice, ns3::LteUePhy, ns3::LteUePowerControl, ns3::LteUeRrc, ns3::NoOpComponentCarrierManager, ns3::NoOpHandoverAlgorithm, ns3::PfFfMacScheduler, ns3::PssFfMacScheduler, ns3::RemSpectrumPhy, ns3::RrFfMacScheduler, ns3::SimpleUeComponentCarrierManager, ns3::TdBetFfMacScheduler, ns3::TdMtFfMacScheduler, ns3::TdTbfqFfMacScheduler, ns3::TtaFfMacScheduler, EpsBearerTagUdpClient, ns3::LteFfrSimple, ns3::LteSimpleHelper, ns3::LteSimpleNetDevice, ns3::LteSimpleSpectrumPhy, ns3::LteTestRrc, ns3::LteTestPdcp, ns3::LteTestMac, ns3::EpcTestRrc, ns3::LteTestUePhy, ns3::Dot11sStack, ns3::FlameStack, ns3::dot11s::HwmpProtocol, ns3::dot11s::HwmpRtable, ns3::dot11s::PeerLink, ns3::dot11s::PeerManagementProtocol, ns3::flame::FlameProtocol, ns3::flame::FlameRtable, ns3::MeshPointDevice, ns3::MeshWifiInterfaceMac, ns3::GaussMarkovMobilityModel, ns3::RandomDirection2dMobilityModel, ns3::RandomWalk2dMobilityModel, ns3::WaypointMobilityModel, ns3::DistributedSimulatorImpl, ns3::MpiReceiver, ns3::NullMessageSimulatorImpl, ns3::Application, ns3::ChannelListPriv, ns3::NodeListPriv, ns3::Node, ns3::Socket, ns3::NetDeviceQueueInterface, ns3::PacketBurst, ns3::PacketSizeMinMaxAvgTotalCalculator, ns3::PacketSocketClient, ns3::PacketSocketServer, ns3::PacketSocket, ns3::Queue< Item, Container >, ns3::Queue< Item >, ns3::Queue< WifiMpdu, ns3::WifiMacQueueContainer >, ns3::Queue< ns3::Packet >, ns3::SimpleNetDevice, ns3::olsr::RoutingProtocol, ns3::OpenFlowSwitchNetDevice, ns3::PointToPointNetDevice, ns3::ThreeGppChannelConditionModel, ns3::JakesProcess, ns3::JakesPropagationLossModel, ns3::ThreeGppPropagationLossModel, ns3::SixLowPanNetDevice, ns3::MockNetDevice, ns3::AlohaNoackNetDevice, ns3::HalfDuplexIdealPhy, ns3::MultiModelSpectrumChannel, ns3::NonCommunicatingNetDevice, ns3::PhasedArraySpectrumPropagationLossModel, ns3::SingleModelSpectrumChannel, ns3::SpectrumAnalyzer, ns3::SpectrumChannel, ns3::ShannonSpectrumErrorModel, ns3::SpectrumInterference, ns3::SpectrumPropagationLossModel, ns3::SpectrumTransmitFilter, ns3::ThreeGppChannelModel, ns3::ThreeGppSpectrumPropagationLossModel, ns3::TwoRaySpectrumPropagationLossModel, ns3::WaveformGenerator, ns3::MinMaxAvgTotalCalculator< T >, ns3::MinMaxAvgTotalCalculator< uint32_t >, ns3::MinMaxAvgTotalCalculator< double >, ns3::MinMaxAvgTotalCalculator< uint64_t >, ns3::CounterCalculator< T >, ns3::DataCalculator, ns3::DataCollector, ns3::DataOutputInterface, ns3::OmnetDataOutput, ns3::TimeMinMaxAvgTotalCalculator, ns3::TapBridge, ns3::CobaltQueueDisc, ns3::PieQueueDisc, ns3::QueueDiscClass, ns3::QueueDisc, ns3::RedQueueDisc, ns3::TbfQueueDisc, ns3::TrafficControlLayer, ns3::AcousticModemEnergyModel, ns3::UanChannel, ns3::UanMacAloha, ns3::UanMacCw, ns3::UanMacRcGw, ns3::UanMacRc, ns3::UanNetDevice, ns3::UanNoiseModel, ns3::UanPhyDual, ns3::UanPhyGen, ns3::UanPhyCalcSinr, ns3::UanPhyPer, ns3::UanPropModel, ns3::UanTransducerHd, ns3::VirtualNetDevice, ns3::VisualSimulatorImpl, ns3::ApWifiMac, ns3::BlockAckManager, ns3::ChannelAccessManager, ns3::EhtFrameExchangeManager, ns3::EmlsrManager, ns3::FrameExchangeManager, ns3::HeFrameExchangeManager, ns3::MultiUserScheduler, ns3::ObssPdAlgorithm, ns3::RrMultiUserScheduler, ns3::HtFrameExchangeManager, ns3::InterferenceHelper, ns3::MpduAggregator, ns3::MsduAggregator, ns3::QosFrameExchangeManager, ns3::QosTxop, ns3::SpectrumWifiPhy, ns3::StaWifiMac, ns3::Txop, ns3::WifiAckManager, ns3::WifiAssocManager, ns3::WifiDefaultAssocManager, ns3::WifiMacQueueSchedulerImpl< Priority, Compare >, ns3::WifiMacQueueSchedulerImpl< FcfsPrio >, ns3::WifiMacQueueScheduler, ns3::WifiMacQueue, ns3::WifiMac, ns3::WifiNetDevice, ns3::WifiPhy, ns3::WifiProtectionManager, ns3::WifiRadioEnergyModel, ns3::WifiRemoteStationManager, ns3::WifiSpectrumPhyInterface, ns3::YansWifiPhy, MuRtsCtsSpectrumWifiPhy, MuMimoSpectrumWifiPhy, OfdmaSpectrumWifiPhy, ns3::BandwidthManager, ns3::BaseStationNetDevice, ns3::BsServiceFlowManager, ns3::BurstProfileManager, ns3::ConnectionManager, ns3::ServiceFlowManager, ns3::SimpleOfdmWimaxPhy, ns3::SSLinkManager, ns3::SubscriberStationNetDevice, ns3::SSScheduler, ns3::SsServiceFlowManager, ns3::WimaxConnection, ns3::WimaxNetDevice, and ns3::WimaxPhy.

Definition at line 444 of file object.cc.

References m_disposed, NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by Dispose(), DoDelete(), ns3::aodv::RoutingProtocol::DoDispose(), ns3::BridgeNetDevice::DoDispose(), ns3::BuildingListPriv::DoDispose(), ns3::RandomWalk2dOutdoorMobilityModel::DoDispose(), ns3::Ipv4ClickRouting::DoDispose(), ns3::Ipv4L3ClickProtocol::DoDispose(), ns3::DefaultSimulatorImpl::DoDispose(), ns3::RealtimeSimulatorImpl::DoDispose(), ns3::CsmaNetDevice::DoDispose(), ns3::dsdv::RoutingProtocol::DoDispose(), ns3::dsr::DsrRouting::DoDispose(), ns3::FdNetDevice::DoDispose(), ns3::FlowMonitor::DoDispose(), ns3::FlowProbe::DoDispose(), ns3::ArpCache::DoDispose(), ns3::ArpL3Protocol::DoDispose(), ns3::GlobalRouter::DoDispose(), ns3::Icmpv4L4Protocol::DoDispose(), ns3::Icmpv6L4Protocol::DoDispose(), ns3::Ipv4GlobalRouting::DoDispose(), ns3::Ipv4Interface::DoDispose(), ns3::Ipv4L3Protocol::DoDispose(), ns3::Ipv4StaticRouting::DoDispose(), ns3::Ipv6ExtensionDemux::DoDispose(), ns3::Ipv6ExtensionFragment::DoDispose(), ns3::Ipv6ExtensionRoutingDemux::DoDispose(), ns3::Ipv6Interface::DoDispose(), ns3::Ipv6L3Protocol::DoDispose(), ns3::Ipv6OptionDemux::DoDispose(), ns3::Ipv6StaticRouting::DoDispose(), ns3::LoopbackNetDevice::DoDispose(), ns3::NdiscCache::DoDispose(), ns3::Rip::DoDispose(), ns3::RipNg::DoDispose(), ns3::TcpL4Protocol::DoDispose(), ns3::TcpSocketFactoryImpl::DoDispose(), ns3::UdpL4Protocol::DoDispose(), ns3::UdpSocketFactoryImpl::DoDispose(), ns3::lrwpan::LrWpanMac::DoDispose(), ns3::lrwpan::LrWpanNetDevice::DoDispose(), ns3::lrwpan::LrWpanPhy::DoDispose(), ns3::CcHelper::DoDispose(), ns3::EpcHelper::DoDispose(), ns3::LteHelper::DoDispose(), ns3::LteHexGridEnbTopologyHelper::DoDispose(), ns3::ComponentCarrierEnb::DoDispose(), ns3::ComponentCarrierUe::DoDispose(), ns3::ComponentCarrier::DoDispose(), ns3::LteInterference::DoDispose(), ns3::LteNetDevice::DoDispose(), ns3::LtePhy::DoDispose(), ns3::LteSpectrumPhy::DoDispose(), ns3::LteUeMac::DoDispose(), ns3::RemSpectrumPhy::DoDispose(), ns3::LteSimpleHelper::DoDispose(), ns3::LteSimpleSpectrumPhy::DoDispose(), ns3::MeshPointDevice::DoDispose(), ns3::GaussMarkovMobilityModel::DoDispose(), ns3::RandomDirection2dMobilityModel::DoDispose(), ns3::RandomWalk2dMobilityModel::DoDispose(), ns3::WaypointMobilityModel::DoDispose(), ns3::DistributedSimulatorImpl::DoDispose(), ns3::NullMessageSimulatorImpl::DoDispose(), ns3::Application::DoDispose(), ns3::ChannelListPriv::DoDispose(), ns3::NodeListPriv::DoDispose(), ns3::Node::DoDispose(), ns3::NetDeviceQueueInterface::DoDispose(), ns3::Queue< Item, Container >::DoDispose(), ns3::SimpleNetDevice::DoDispose(), ns3::olsr::RoutingProtocol::DoDispose(), ns3::OpenFlowSwitchNetDevice::DoDispose(), ns3::PointToPointNetDevice::DoDispose(), ns3::SixLowPanNetDevice::DoDispose(), ns3::MockNetDevice::DoDispose(), ns3::AlohaNoackNetDevice::DoDispose(), ns3::HalfDuplexIdealPhy::DoDispose(), ns3::NonCommunicatingNetDevice::DoDispose(), ns3::SpectrumAnalyzer::DoDispose(), ns3::ShannonSpectrumErrorModel::DoDispose(), ns3::SpectrumInterference::DoDispose(), ns3::SpectrumTransmitFilter::DoDispose(), ns3::DataCalculator::DoDispose(), ns3::DataCollector::DoDispose(), ns3::DataOutputInterface::DoDispose(), ns3::TapBridge::DoDispose(), ns3::QueueDiscClass::DoDispose(), ns3::QueueDisc::DoDispose(), ns3::TrafficControlLayer::DoDispose(), ns3::UanChannel::DoDispose(), ns3::UanMacAloha::DoDispose(), ns3::UanMacCw::DoDispose(), ns3::UanMacRcGw::DoDispose(), ns3::UanMacRc::DoDispose(), ns3::UanNetDevice::DoDispose(), ns3::UanNoiseModel::DoDispose(), ns3::UanPhyDual::DoDispose(), ns3::UanPhyGen::DoDispose(), ns3::UanPhyCalcSinr::DoDispose(), ns3::UanPhyPer::DoDispose(), ns3::UanPropModel::DoDispose(), ns3::UanTransducerHd::DoDispose(), ns3::VirtualNetDevice::DoDispose(), ns3::VisualSimulatorImpl::DoDispose(), ns3::EmlsrManager::DoDispose(), ns3::FrameExchangeManager::DoDispose(), ns3::HeFrameExchangeManager::DoDispose(), ns3::MultiUserScheduler::DoDispose(), ns3::MpduAggregator::DoDispose(), ns3::MsduAggregator::DoDispose(), ns3::WifiAckManager::DoDispose(), ns3::WifiNetDevice::DoDispose(), ns3::WifiProtectionManager::DoDispose(), and ns3::WimaxNetDevice::DoDispose().

◆ DoGetObject()

Ptr< Object > ns3::Object::DoGetObject ( TypeId  tid) const
private

Find an Object of TypeId tid in the aggregates of this Object.

Parameters
[in]tidThe TypeId we're looking for
Returns
The matching Object, if it is found

Definition at line 164 of file object.cc.

References ns3::Object::Aggregates::buffer, CheckLoose(), GetInstanceTypeId(), ns3::TypeId::GetParent(), GetTypeId(), m_aggregates, m_getObjectCount, m_unidirectionalAggregates, ns3::Object::Aggregates::n, NS_ASSERT, NS_LOG_FUNCTION, and UpdateSortedArray().

Referenced by AggregateObject(), GetObject(), and UnidirectionalAggregateObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoInitialize()

void ns3::Object::DoInitialize ( )
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::aodv::RoutingProtocol, ns3::ThreeGppHttpVariables, ns3::MobilityBuildingInfo, ns3::RandomWalk2dOutdoorMobilityModel, ns3::Ipv4ClickRouting, ns3::EnergyHarvesterContainer, ns3::EnergySourceContainer, ns3::BasicEnergyHarvester, ns3::BasicEnergySource, ns3::GenericBatteryModel, ns3::LiIonEnergySource, ns3::RvBatteryModel, ns3::FdNetDevice, ns3::Ipv4ListRouting, ns3::Rip, ns3::RipNg, ns3::lrwpan::LrWpanMac, ns3::lrwpan::LrWpanNetDevice, ns3::lrwpan::LrWpanPhy, ns3::CcHelper, ns3::LteHelper, ns3::A2A4RsrqHandoverAlgorithm, ns3::A3RsrpHandoverAlgorithm, ns3::ComponentCarrierEnb, ns3::ComponentCarrierUe, ns3::LteAnr, ns3::LteEnbNetDevice, ns3::LteEnbPhy, ns3::UeManager, ns3::LteFfrDistributedAlgorithm, ns3::LteFfrEnhancedAlgorithm, ns3::LteFfrSoftAlgorithm, ns3::LteFrHardAlgorithm, ns3::LteFrNoOpAlgorithm, ns3::LteFrSoftAlgorithm, ns3::LteFrStrictAlgorithm, ns3::LteRlcSm, ns3::LteUeNetDevice, ns3::LteUePhy, ns3::LteUePowerControl, ns3::LteUeRrc, ns3::NoOpComponentCarrierManager, ns3::NoOpHandoverAlgorithm, ns3::SimpleUeComponentCarrierManager, ns3::LteFfrSimple, ns3::LteSimpleHelper, ns3::LteSimpleNetDevice, ns3::dot11s::HwmpProtocol, ns3::dot11s::PeerManagementProtocol, ns3::MeshWifiInterfaceMac, ns3::HierarchicalMobilityModel, ns3::RandomDirection2dMobilityModel, ns3::RandomWalk2dMobilityModel, ns3::RandomWaypointMobilityModel, ns3::SteadyStateRandomWaypointMobilityModel, ns3::Application, ns3::Node, ns3::olsr::RoutingProtocol, ns3::TraceFadingLossModel, Emitter, Emitter, Emitter, Emitter, ns3::QueueDisc, ns3::TrafficControlLayer, ns3::UanNetDevice, ns3::ApWifiMac, ns3::ChannelAccessManager, ns3::MultiUserScheduler, ns3::RrMultiUserScheduler, ns3::AarfWifiManager, ns3::AarfcdWifiManager, ns3::AmrrWifiManager, ns3::AparfWifiManager, ns3::ArfWifiManager, ns3::CaraWifiManager, ns3::IdealWifiManager, ns3::MinstrelHtWifiManager, ns3::MinstrelWifiManager, ns3::OnoeWifiManager, ns3::ParfWifiManager, ns3::RraaWifiManager, ns3::RrpaaWifiManager, ns3::SpectrumWifiPhy, ns3::StaWifiMac, ns3::Txop, ns3::WifiMac, ns3::WifiNetDevice, ns3::WifiPhy, MuRtsCtsSpectrumWifiPhy, MuMimoSpectrumWifiPhy, and OfdmaSpectrumWifiPhy.

Definition at line 451 of file object.cc.

References m_initialized, NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by ns3::LteEnbRrc::ConfigureCarriers(), ns3::aodv::RoutingProtocol::DoInitialize(), ns3::RandomWalk2dOutdoorMobilityModel::DoInitialize(), ns3::FdNetDevice::DoInitialize(), ns3::Ipv4ListRouting::DoInitialize(), ns3::Rip::DoInitialize(), ns3::RipNg::DoInitialize(), ns3::lrwpan::LrWpanMac::DoInitialize(), ns3::lrwpan::LrWpanNetDevice::DoInitialize(), ns3::LteHelper::DoInitialize(), ns3::A2A4RsrqHandoverAlgorithm::DoInitialize(), ns3::A3RsrpHandoverAlgorithm::DoInitialize(), ns3::LteEnbPhy::DoInitialize(), ns3::LteFfrDistributedAlgorithm::DoInitialize(), ns3::LteFfrEnhancedAlgorithm::DoInitialize(), ns3::LteFfrSoftAlgorithm::DoInitialize(), ns3::LteFrHardAlgorithm::DoInitialize(), ns3::LteFrNoOpAlgorithm::DoInitialize(), ns3::LteFrSoftAlgorithm::DoInitialize(), ns3::LteFrStrictAlgorithm::DoInitialize(), ns3::LteUePhy::DoInitialize(), ns3::NoOpComponentCarrierManager::DoInitialize(), ns3::NoOpHandoverAlgorithm::DoInitialize(), ns3::SimpleUeComponentCarrierManager::DoInitialize(), ns3::LteFfrSimple::DoInitialize(), ns3::LteSimpleHelper::DoInitialize(), ns3::RandomDirection2dMobilityModel::DoInitialize(), ns3::RandomWalk2dMobilityModel::DoInitialize(), ns3::RandomWaypointMobilityModel::DoInitialize(), ns3::SteadyStateRandomWaypointMobilityModel::DoInitialize(), ns3::Application::DoInitialize(), ns3::Node::DoInitialize(), ns3::QueueDisc::DoInitialize(), ns3::TrafficControlLayer::DoInitialize(), ns3::UanNetDevice::DoInitialize(), ns3::WifiNetDevice::DoInitialize(), and Initialize().

+ Here is the caller graph for this function:

◆ GetAggregateIterator()

Object::AggregateIterator ns3::Object::GetAggregateIterator ( ) const

Get an iterator to the Objects aggregated to this one.

Returns
An iterator to the first Object aggregated to this Object.

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 429 of file object.cc.

References NS_LOG_FUNCTION.

◆ GetInstanceTypeId()

TypeId ns3::Object::GetInstanceTypeId ( ) const
overridevirtual

◆ GetObject() [1/4]

template<typename T >
Ptr< T > ns3::Object::GetObject
inline

Get a pointer to the requested aggregated Object.

If the type of object requested is ns3::Object, a Ptr to the calling object is returned.

Template Parameters
T[explicit] The type of the aggregated Object to retrieve.
Returns
A pointer to the requested Object, or zero if it could not be found.

Definition at line 522 of file object.h.

References ns3::Object::Aggregates::buffer, DoGetObject(), m_aggregates, and ns3::PeekPointer().

Referenced by ns3::NoBackhaulEpcHelper::NoBackhaulEpcHelper(), ns3::DhcpClient::AcceptAck(), ns3::Ipv6Interface::AddAddress(), ns3::Ipv4L3Protocol::AddInterface(), ns3::Ipv6L3Protocol::AddInterface(), ns3::FileHelper::AddProbe(), ns3::GnuplotHelper::AddProbe(), ns3::LteUeRrc::ApplyRadioResourceConfigDedicated(), ns3::UdpSocketImpl::Bind(), ns3::UdpSocketImpl::BindToNetDevice(), ns3::LteHelper::ChannelModelInitialization(), ns3::GlobalRouteManagerImpl::CheckForStubNode(), ns3::Ipv4RawSocketImpl::Close(), ns3::Ipv6RawSocketImpl::Close(), ns3::ArpL3Protocol::CreateCache(), ns3::olsr::HelloRegressionTest::CreateNodes(), ns3::olsr::TcRegressionTest::CreateNodes(), ns3::Icmpv6L4Protocol::DoDAD(), ns3::WifiPhy::DoInitialize(), ns3::WifiRadioEnergyModelHelper::DoInstall(), ThreeGppHttpObjectTestCase::DoRun(), BuildingsHelperOneTestCase::DoRun(), OutdoorRandomWalkTestCase::DoRun(), PointerAttributeTestCase::DoRun(), Ipv4DeduplicationTest::DoRun(), LinkTest::DoRun(), LanTest::DoRun(), TwoLinkTest::DoRun(), TwoLanTest::DoRun(), BridgeTest::DoRun(), TwoBridgeTest::DoRun(), IpAddressHelperTestCasev6::DoRun(), EpcS1uDlTestCase::DoRun(), EpcS1uUlTestCase::DoRun(), CarrierAggregationTestCase::DoRun(), LenaCqaFfMacSchedulerTestCase1::DoRun(), LenaCqaFfMacSchedulerTestCase2::DoRun(), ns3::LenaDeactivateBearerTestCase::DoRun(), LteDownlinkPowerControlTestCase::DoRun(), LenaFdBetFfMacSchedulerTestCase1::DoRun(), LenaFdBetFfMacSchedulerTestCase2::DoRun(), LenaFdMtFfMacSchedulerTestCase::DoRun(), LenaFdTbfqFfMacSchedulerTestCase1::DoRun(), LenaFdTbfqFfMacSchedulerTestCase2::DoRun(), LteHardFrTestCase::DoRun(), LteStrictFrTestCase::DoRun(), LteStrictFrAreaTestCase::DoRun(), LteSoftFrAreaTestCase::DoRun(), LteSoftFfrAreaTestCase::DoRun(), LteEnhancedFfrAreaTestCase::DoRun(), LteDistributedFfrAreaTestCase::DoRun(), LenaHarqTestCase::DoRun(), LteInterferenceHardFrTestCase::DoRun(), LteInterferenceStrictFrTestCase::DoRun(), LteInterferenceTestCase::DoRun(), LteLinkAdaptationTestCase::DoRun(), LenaMimoTestCase::DoRun(), LtePathlossModelSystemTestCase::DoRun(), LenaPfFfMacSchedulerTestCase1::DoRun(), LenaPfFfMacSchedulerTestCase2::DoRun(), LenaDataPhyErrorModelTestCase::DoRun(), LenaDlCtrlPhyErrorModelTestCase::DoRun(), LenaPssFfMacSchedulerTestCase1::DoRun(), LenaPssFfMacSchedulerTestCase2::DoRun(), LteRadioLinkFailureTestCase::DoRun(), LenaRrFfMacSchedulerTestCase::DoRun(), LenaTdBetFfMacSchedulerTestCase1::DoRun(), LenaTdBetFfMacSchedulerTestCase2::DoRun(), LenaTdMtFfMacSchedulerTestCase::DoRun(), LenaTdTbfqFfMacSchedulerTestCase1::DoRun(), LenaTdTbfqFfMacSchedulerTestCase2::DoRun(), LenaTtaFfMacSchedulerTestCase::DoRun(), LteUeMeasurementsPiecewiseTestCase1::DoRun(), LteUeMeasurementsPiecewiseTestCase2::DoRun(), LteUeMeasurementsPiecewiseTestCase3::DoRun(), LteUplinkOpenLoopPowerControlTestCase::DoRun(), LteUplinkClosedLoopPowerControlAbsoluteModeTestCase::DoRun(), LteUplinkClosedLoopPowerControlAccumulatedModeTestCase::DoRun(), LteEnbAntennaTestCase::DoRun(), LteEpcE2eDataTestCase::DoRun(), LteRrcConnectionEstablishmentErrorTestCase::DoRun(), LteX2HandoverMeasuresTestCase::DoRun(), LteX2HandoverTestCase::DoRun(), WaypointMobilityModelViaHelper::DoRun(), SteadyStateRandomWaypointTest::DoRun(), WaypointMobilityModelNotifyTest::DoRun(), WaypointMobilityModelAddWaypointTest::DoRun(), NixVectorRoutingTest::DoRun(), SpectrumIdealPhyTestCase::DoRun(), WaveformGeneratorTestCase::DoRun(), OverallGainAverageTest::DoRun(), WifiAcMappingTest::DoRun(), Issue211Test::DoRun(), AcousticModemEnergyTestCase::DoRun(), AcousticModemEnergyDepletionTestCase::DoRun(), WifiUseAvailBwTest::DoRun(), ns3::UdpSocketImpl::DoSendTo(), ns3::Ipv4Interface::DoSetup(), ns3::Ipv6Interface::DoSetup(), PingTestCase::DoSetup(), TestUlOfdmaPowerControl::DoSetup(), experiment(), ns3::Icmpv4L4Protocol::Forward(), ns3::Icmpv6L4Protocol::Forward(), ns3::Icmpv6L4Protocol::FunctionDadTimeout(), ns3::Ipv6ExtensionFragment::GetFragments(), ns3::AnimationInterface::GetIpv4Address(), ns3::AnimationInterface::GetIpv4Addresses(), ns3::AnimationInterface::GetIpv6Address(), ns3::AnimationInterface::GetIpv6Addresses(), ns3::NoBackhaulEpcHelper::GetUeDefaultGatewayAddress(), ns3::NoBackhaulEpcHelper::GetUeDefaultGatewayAddress6(), ns3::Ipv6ExtensionFragment::HandleFragmentsTimeout(), ns3::Icmpv6L4Protocol::HandleNS(), ns3::Icmpv6L4Protocol::HandlePacketTooBig(), ns3::Icmpv6L4Protocol::HandleRA(), ns3::Radvd::HandleRead(), ns3::Icmpv6L4Protocol::HandleRedirection(), ns3::Icmpv6L4Protocol::HandleRS(), ns3::RadioEnvironmentMapHelper::Install(), ns3::SpectrumAnalyzerHelper::Install(), ns3::WaveformGeneratorHelper::Install(), ns3::TvSpectrumTransmitterHelper::Install(), ns3::GroupMobilityHelper::Install(), ns3::CsmaHelper::Install(), ns3::MobilityHelper::Install(), ns3::TvSpectrumTransmitterHelper::InstallAdjacent(), ns3::Ipv6RawSocketImpl::Ipv6JoinGroup(), ns3::UdpSocketImpl::Ipv6JoinGroup(), ns3::DhcpClient::LinkStateHandler(), ns3::Ipv6L3Protocol::LocalDeliver(), ns3::Ipv6ExtensionRouting::Process(), ns3::Ipv6ExtensionLooseRouting::Process(), ns3::Ipv6Extension::ProcessOptions(), ns3::dsr::DsrRouting::Receive(), ns3::Icmpv6L4Protocol::Receive(), ns3::Ping::Receive(), ns3::ConstantObssPdAlgorithm::ReceiveHeSigA(), ns3::Ipv6L3Protocol::RegisterExtensions(), ns3::Ipv6L3Protocol::RegisterOptions(), ns3::DhcpClient::RemoveAndStart(), ns3::Ipv6AutoconfiguredPrefix::RemoveMe(), RoutingExperiment::Run(), NetAnimExperiment::Run(), Experiment::Run(), TestInterBssConstantObssPdAlgo::RunOne(), Issue40TestCase::RunOne(), ns3::Ipv4Interface::Send(), ns3::Ipv6Interface::Send(), ns3::Radvd::Send(), ns3::ArpL3Protocol::SendArpRequest(), ns3::Icmpv4L4Protocol::SendMessage(), ns3::Icmpv6L4Protocol::SendMessage(), ns3::DhcpServer::SendOffer(), ns3::TcpL4Protocol::SendPacketV4(), ns3::TcpL4Protocol::SendPacketV6(), ns3::Icmpv6L4Protocol::SendRS(), ns3::Ipv4RawSocketImpl::SendTo(), ns3::Ipv6RawSocketImpl::SendTo(), ns3::GroupMobilityHelper::SetMemberPositionAllocator(), ns3::NetDeviceQueueInterface::SetNTxQueues(), ns3::MobilityHelper::SetPositionAllocator(), ns3::GroupMobilityHelper::SetReferenceMobilityModel(), ns3::GroupMobilityHelper::SetReferencePositionAllocator(), UanExperiment::SetupCommunications(), ns3::UeManager::SetupDataRadioBearer(), ns3::TcpSocketBase::SetupEndpoint(), ns3::TcpSocketBase::SetupEndpoint6(), DsdvManetExample::SetupMobility(), UanExperiment::SetupPositions(), DualStackTestCase::SetUpSim(), Sender::StartApplication(), Receiver::StartApplication(), ns3::DhcpClient::StartApplication(), ns3::DhcpServer::StartApplication(), ns3::Radvd::StartApplication(), MultiLinkMuTxTest::StartTraffic(), ns3::DhcpClient::StopApplication(), MultiLinkMuTxTest::Transmit(), and ns3::AnimationInterface::WriteNodeEnergies().

+ Here is the call graph for this function:

◆ GetObject() [2/4]

template<>
Ptr< Object > ns3::Object::GetObject ( ) const
inline

Specialization of () for objects of type ns3::Object.

Returns
A Ptr to the calling object.

Definition at line 548 of file object.h.

◆ GetObject() [3/4]

template<typename T >
Ptr< T > ns3::Object::GetObject ( TypeId  tid) const

Get a pointer to the requested aggregated Object by TypeId.

If the TypeId argument is ns3::Object, a Ptr to the calling object is returned.

Template Parameters
T[explicit] The type of the aggregated Object to retrieve.
Parameters
[in]tidThe TypeId of the requested Object.
Returns
A pointer to the requested Object with the specified TypeId, or zero if it could not be found.

Definition at line 555 of file object.h.

References DoGetObject(), and ns3::PeekPointer().

+ Here is the call graph for this function:

◆ GetObject() [4/4]

template<>
Ptr< Object > ns3::Object::GetObject ( TypeId  tid) const
inline

Specialization of (TypeId tid) for objects of type ns3::Object.

Parameters
[in]tidThe TypeId of the requested Object.
Returns
A Ptr to the calling object.

Definition at line 574 of file object.h.

References DoGetObject(), and GetTypeId().

+ Here is the call graph for this function:

◆ GetTypeId()

TypeId ns3::Object::GetTypeId ( )
static

Register this type.

Returns
The Object TypeId.

Definition at line 101 of file object.cc.

References ns3::TypeId::SetParent().

Referenced by DoGetObject(), and GetObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Initialize()

void ns3::Object::Initialize ( )

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.

See also
DoInitialize()

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 214 of file object.cc.

References ns3::Object::Aggregates::buffer, DoInitialize(), m_aggregates, m_initialized, m_unidirectionalAggregates, ns3::Object::Aggregates::n, and NS_LOG_FUNCTION.

Referenced by ns3::BuildingListPriv::Add(), ns3::ChannelListPriv::Add(), ns3::NodeListPriv::Add(), ns3::Node::AddApplication(), ns3::Node::AddDevice(), ns3::HierarchicalMobilityModel::DoInitialize(), ns3::ApWifiMac::DoInitialize(), ns3::WifiMac::DoInitialize(), ns3::WifiNetDevice::DoInitialize(), SteadyStateRandomWaypointTest::DoRun(), WaypointMobilityModelNotifyTest::DoRun(), WaypointMobilityModelAddWaypointTest::DoRun(), ns3::LteHelper::InstallEnbDevice(), and ns3::LteSimpleHelper::InstallEnbDevice().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsInitialized()

bool ns3::Object::IsInitialized ( ) const

◆ NotifyNewAggregate()

void ns3::Object::NotifyNewAggregate ( )
protectedvirtual

Notify all Objects aggregated to this one of a new Object being aggregated.

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::Ipv4L3ClickProtocol, ns3::dsr::DsrRouting, ns3::ArpL3Protocol, ns3::Icmpv4L4Protocol, ns3::Icmpv6L4Protocol, ns3::Ipv4L3Protocol, ns3::Ipv6L3Protocol, ns3::TcpL4Protocol, ns3::UdpL4Protocol, ns3::NetDeviceQueueInterface, ns3::TrafficControlLayer, and ns3::MultiUserScheduler.

Definition at line 423 of file object.cc.

References NS_LOG_FUNCTION.

Referenced by AggregateObject(), ns3::Ipv4L3ClickProtocol::NotifyNewAggregate(), ns3::dsr::DsrRouting::NotifyNewAggregate(), ns3::ArpL3Protocol::NotifyNewAggregate(), ns3::Icmpv4L4Protocol::NotifyNewAggregate(), ns3::Icmpv6L4Protocol::NotifyNewAggregate(), ns3::Ipv4L3Protocol::NotifyNewAggregate(), ns3::Ipv6L3Protocol::NotifyNewAggregate(), ns3::TcpL4Protocol::NotifyNewAggregate(), ns3::UdpL4Protocol::NotifyNewAggregate(), ns3::NetDeviceQueueInterface::NotifyNewAggregate(), ns3::TrafficControlLayer::NotifyNewAggregate(), and ns3::MultiUserScheduler::NotifyNewAggregate().

+ Here is the caller graph for this function:

◆ SetTypeId()

void ns3::Object::SetTypeId ( TypeId  tid)
private

Set the TypeId of this Object.

Parameters
[in]tidThe 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 436 of file object.cc.

References Check(), m_tid, NS_ASSERT, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ UnidirectionalAggregateObject()

void ns3::Object::UnidirectionalAggregateObject ( Ptr< Object other)

Aggregate an Object to another Object.

Parameters
[in]otherThe other Object pointer

This method aggregates the an object to another Object: after this method returns, it becomes possible to call GetObject() on the aggregating Object to get the other, but not vice-versa.

This method calls the virtual method NotifyNewAggregates() to notify all aggregated Objects that they have been aggregated together.

This method is useful only if there is the need to aggregate an object to more than one object at the same time, and should be avoided if not strictly necessary. In particular, objects aggregated with this method should be destroyed only after making sure that the objects they are aggregated to are destroyed as well. However, the destruction of the aggregating objects will take care of the unidirectional aggregated objects gracefully.

Beware that an object aggregated to another with this function behaves differently than other aggregates in the following ways. Suppose that Object B is aggregated unidirectionally:

  • It can be aggregated unidirectionally to more than one objects (e.g., A1 and A2).
  • It is not possible to call GetObject on B to find an aggregate of object A1 or A2.
  • When A1 or A2 are initialized, B is initialized, whichever happens first.
  • When A1 or A2 are destroyed, B is destroyed, whichever happens last.
  • If B is initialized, A1 and A2 are unaffected.
  • If B is forcefully destroyed, A1 and A2 are unaffected.
See also
AggregateObject()

Definition at line 379 of file object.cc.

References ns3::Object::Aggregates::buffer, CheckLoose(), DoGetObject(), GetInstanceTypeId(), m_aggregates, m_disposed, m_unidirectionalAggregates, ns3::Object::Aggregates::n, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::PeekPointer().

+ Here is the call graph for this function:

◆ UpdateSortedArray()

void ns3::Object::UpdateSortedArray ( Aggregates aggregates,
uint32_t  i 
) const
private

Keep the list of aggregates in most-recently-used order.

Parameters
[in,out]aggregatesThe list of aggregated Objects.
[in]iThe most recently used entry in the list.

Definition at line 295 of file object.cc.

References ns3::Object::Aggregates::buffer, m_getObjectCount, and NS_LOG_FUNCTION.

Referenced by AggregateObject(), and DoGetObject().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ AggregateIterator

friend class AggregateIterator
friend

Friends.

Definition at line 369 of file object.h.

◆ CompleteConstruct

template<typename T >
Ptr< T > CompleteConstruct ( T *  object)
friend

Set the TypeId and construct all Attributes of an Object.

Template Parameters
T[deduced] The type of the Object to complete.
Parameters
[in]objectThe uninitialized object pointer.
Returns
The derived object.

Definition at line 610 of file object.h.

◆ CopyObject [1/2]

template<typename T >
Ptr< T > CopyObject ( Ptr< const T >  object)
friend
Template Parameters
T[deduced] The type of the Object being copied.
Parameters
[in]objectA pointer to the object to copy.
Returns
A copy of the input object.

This method invoke the copy constructor of the input object and returns the new instance.

Definition at line 592 of file object.h.

◆ CopyObject [2/2]

template<typename T >
Ptr< T > CopyObject ( Ptr< T >  object)
friend

Copy an Object.

Template Parameters
T[deduced] The type of the Object being copied.
Parameters
[in]objectA pointer to the object to copy.
Returns
A copy of the input object.

This method invoke the copy constructor of the input object and returns the new instance.

Definition at line 592 of file object.h.

Referenced by ns3::TcpSocketBase::TcpSocketBase(), and ns3::TcpYeah::TcpYeah().

◆ ObjectDeleter

friend struct ObjectDeleter
friend

Friends.

Definition at line 370 of file object.h.

◆ ObjectFactory

Member Data Documentation

◆ m_aggregates

Aggregates* ns3::Object::m_aggregates
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 478 of file object.h.

Referenced by Object(), ~Object(), AggregateObject(), CheckLoose(), Dispose(), DoDelete(), DoGetObject(), GetObject(), ns3::Object::AggregateIterator::HasNext(), Initialize(), ns3::Object::AggregateIterator::Next(), and UnidirectionalAggregateObject().

◆ m_disposed

bool ns3::Object::m_disposed
private

Set to true when the DoDispose() method of the Object has run, false otherwise.

Definition at line 465 of file object.h.

Referenced by AggregateObject(), Dispose(), DoDelete(), DoDispose(), and UnidirectionalAggregateObject().

◆ m_getObjectCount

uint32_t ns3::Object::m_getObjectCount
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 497 of file object.h.

Referenced by DoGetObject(), and UpdateSortedArray().

◆ m_initialized

bool ns3::Object::m_initialized
private

Set to true once the DoInitialize() method has run, false otherwise.

Definition at line 470 of file object.h.

Referenced by DoInitialize(), Initialize(), and IsInitialized().

◆ m_tid

TypeId ns3::Object::m_tid
private

Identifies the type of this Object instance.

Definition at line 460 of file object.h.

Referenced by GetInstanceTypeId(), and SetTypeId().

◆ m_unidirectionalAggregates

std::vector<Ptr<Object> > ns3::Object::m_unidirectionalAggregates
private

An array of unidirectional aggregates, i.e., objects that are aggregated to the current object, but not vice-versa.

This is useful (and suggested) only for Objects that should be aggregated to multiple other Objects, where the normal Aggregation would create an issue.

Definition at line 488 of file object.h.

Referenced by ~Object(), Dispose(), DoGetObject(), Initialize(), and UnidirectionalAggregateObject().


The documentation for this class was generated from the following files: