A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 AlternateTestObject, anonymous_namespace{object-test-suite.cc}::BaseA, anonymous_namespace{object-test-suite.cc}::BaseB, AttributeObjectTest, ConfigExample, ConfigTestObject, Derived, Emitter, Emitter, Emitter, MyObject, ns3::AntennaModel, ns3::Application, ns3::ArpCache, ns3::ArpL3Protocol, ns3::AthstatsWifiTraceSink, ns3::BandwidthManager, ns3::BSLinkManager, ns3::BSScheduler, ns3::Building, ns3::BuildingListPriv, ns3::BurstProfileManager, ns3::Channel, ns3::ChannelListPriv, ns3::ConnectionManager, ns3::DataCalculator, ns3::DataCollectionObject, ns3::DataCollector, ns3::DataOutputInterface, ns3::Dcf, ns3::DeviceEnergyModel, ns3::dot11s::AirtimeLinkMetricCalculator, ns3::dot11s::HwmpRtable, ns3::dot11s::PeerLink, ns3::dot11s::PeerManagementProtocol, ns3::dsr::DsrNetworkQueue, ns3::dsr::DsrOptions, ns3::dsr::GraReply, ns3::dsr::PassiveBuffer, ns3::dsr::RouteCache, ns3::dsr::RreqTable, ns3::EnergySource, ns3::EnergySourceContainer, ns3::EpcHelper, ns3::EpcMme, ns3::EpcTestRrc, ns3::EpcUeNas, ns3::EpcX2, ns3::ErrorModel, ns3::ErrorRateModel, ns3::FfMacScheduler, ns3::flame::FlameRtable, ns3::FlowMonitor, ns3::FlowProbe, ns3::GlobalRouter, ns3::GrantedTimeWindowMpiInterface [private], ns3::GridBuildingAllocator, ns3::IpcsClassifier, ns3::IpL4Protocol, 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::LteEnbMac, ns3::LteEnbRrc, ns3::LteEnbRrcProtocolIdeal, ns3::LteEnbRrcProtocolReal, 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::LteUeMac, ns3::LteUeRrc, ns3::LteUeRrcProtocolIdeal, ns3::LteUeRrcProtocolReal, ns3::MacLow, ns3::MeshL2RoutingProtocol, ns3::MeshStack, ns3::MobilityBuildingInfo, ns3::MobilityModel, ns3::MpiReceiver, ns3::MsduAggregator, ns3::NdiscCache, ns3::NetDevice, ns3::Node, ns3::NodeListPriv, ns3::Ns3NscStack, ns3::ofi::Controller, ns3::PacketBurst, ns3::PcapFileWrapper, ns3::PositionAllocator, ns3::PriorityUlJob, ns3::PropagationDelayModel, ns3::PropagationLossModel, ns3::Queue, ns3::RadioEnvironmentMapHelper, ns3::RandomVariableStream, ns3::RemoteChannelBundle, ns3::RttEstimator, ns3::Scheduler, ns3::ServiceFlowManager, ns3::SimulatorImpl, ns3::Socket, ns3::SocketFactory, ns3::SpectrumErrorModel, ns3::SpectrumInterference, ns3::SpectrumPhy, ns3::SpectrumPropagationLossModel, ns3::SSLinkManager, ns3::SSManager, ns3::SSScheduler, ns3::Synchronizer, ns3::TcpRxBuffer, ns3::TcpTxBuffer, ns3::TopologyReader, ns3::UanMac, ns3::UanNoiseModel, ns3::UanPhy, ns3::UanPhyCalcSinr, ns3::UanPhyPer, ns3::UanPropModel, ns3::UanTransducer, ns3::UeManager, ns3::UlJob, ns3::UplinkScheduler, ns3::WifiMac, ns3::WifiMacQueue, ns3::WifiPhy, ns3::WifiPhyStateHelper, ns3::WifiRemoteStationManager, ns3::WimaxConnection, ns3::WimaxMacQueue, ns3::WimaxPhy, PtrExample, SampleEmitter, SequenceNumberTestObj, and TestObject.

+ Collaboration diagram for ns3::Object:

Classes

class  AggregateIterator
 Iterate over the objects aggregated to an ns3::Object. More...
 
struct  Aggregates
 This data structure uses a classic C-style trick to hold an array of variable size without performing two memory allocations: the declaration of the structure declares a one-element array but when we allocate memory for this struct, we effectively allocate a larger chunk of memory than the struct to allow space for a larger variable sized buffer whose size is indicated by the element 'n'. More...
 

Public Member Functions

 Object ()
 
virtual ~Object ()
 
void AggregateObject (Ptr< Object > other)
 
void Dispose (void)
 Run the DoDispose methods of this object and all the objects aggregated to it. More...
 
AggregateIterator GetAggregateIterator (void) const
 
virtual TypeId GetInstanceTypeId (void) const
 
template<typename T >
Ptr< T > GetObject (void) const
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 
void Initialize (void)
 This method calls the virtual DoInitialize method on all the objects aggregated to this object. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment. 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
 
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
 
void SetAttribute (std::string name, const AttributeValue &value)
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 

Static Public Member Functions

static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
static void Cleanup (void)
 Noop. 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)
 
virtual void DoDispose (void)
 This method is called by Object::Dispose or by the object's destructor, whichever comes first. More...
 
virtual void DoInitialize (void)
 This method is called only once by Object::Initialize. More...
 
virtual void NotifyNewAggregate (void)
 This method is invoked whenever two sets of objects are aggregated together. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 
virtual void NotifyConstructionCompleted (void)
 This method is invoked once all member attributes have been initialized. More...
 

Private Member Functions

bool Check (void) const
 
bool CheckLoose (void) const
 
void Construct (const AttributeConstructionList &attributes)
 
void DoDelete (void)
 Attempt to delete this object. More...
 
Ptr< ObjectDoGetObject (TypeId tid) const
 Find an object of TypeId tid in the aggregates of this Object. More...
 
void SetTypeId (TypeId tid)
 
void UpdateSortedArray (struct Aggregates *aggregates, uint32_t i) const
 Keep the list of aggregates in most-recently-used order. More...
 

Private Attributes

struct Aggregatesm_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
 Indicates 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)
 
template<typename T >
Ptr< T > CopyObject (Ptr< T > object)
 
template<typename T >
Ptr< T > CopyObject (Ptr< const T > object)
 
struct ObjectDeleter
 
class ObjectFactory
 

Detailed Description

a base class which provides memory management and object aggregation

Doxygen 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 increamented and decremented with the methods Object::Ref and Object::Unref. If a reference cycle is present, the user is responsible for breaking it by calling Object::Dispose in a single location. This will eventually trigger the invocation of Object::DoDispose on itself and all its aggregates. The Object::DoDispose method is always automatically invoked from the Object::Unref method before destroying the object, even if the user did not call Object::Dispose directly.


No Attributes are defined for this type.
No TraceSources are defined for this type.

Definition at line 63 of file object.h.

Constructor & Destructor Documentation

ns3::Object::Object ( )
ns3::Object::~Object ( )
virtual
ns3::Object::Object ( const Object o)
protected
Parameters
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 to do 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 responsability 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 128 of file object.cc.

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

Member Function Documentation

void ns3::Object::AggregateObject ( Ptr< Object other)
Parameters
otheranother 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 243 of file object.cc.

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

Referenced by ns3::PointToPointEpcHelper::AddEnb(), AddInternetStack(), anonymous_namespace{ipv4-packet-info-tag-test-suite.cc}::AddInternetStack(), AddInternetStack6(), ns3::PointToPointStarHelper::BoundingBox(), ns3::PointToPointGridHelper::BoundingBox(), ns3::PointToPointDumbbellHelper::BoundingBox(), ns3::AodvHelper::Create(), ns3::Ipv4GlobalRoutingHelper::Create(), ns3::Ipv4NixVectorHelper::Create(), ns3::DsdvHelper::Create(), ns3::DsrHelper::Create(), ns3::OlsrHelper::Create(), ns3::InternetStackHelper::CreateAndAggregateObjectFromTypeId(), CreateDualStackNode(), TcpTestCase::CreateInternetNode(), TcpTestCase::CreateInternetNode6(), ns3::BuildingsPathlossTestCase::CreateMobilityModel(), ns3::BuildingsShadowingTestCase::CreateMobilityModel(), ns3::WifiTest::CreateOne(), ns3::InterferenceHelperSequenceTest::CreateOne(), ns3::RadioEnvironmentMapHelper::DelayedInstall(), ns3::aodv::LoopbackTestCase::DoRun(), ns3::LiIonEnergyTestCase::DoRun(), WaypointLazyNotifyFalse::DoRun(), ns3::AcousticModemEnergyTestCase::DoRun(), ns3::Ipv6L3ProtocolTestCase::DoRun(), WaypointLazyNotifyTrue::DoRun(), ns3::AcousticModemEnergyDepletionTestCase::DoRun(), ns3::Bug555TestCase::DoRun(), experiment(), ns3::PacketSocketHelper::Install(), ns3::BuildingsHelper::Install(), ns3::InternetStackHelper::Install(), ns3::MobilityHelper::Install(), main(), ns3::NscTcpL4Protocol::NotifyNewAggregate(), ns3::TcpL4Protocol::NotifyNewAggregate(), ns3::UdpL4Protocol::NotifyNewAggregate(), ns3::AnimationRemainingEnergyTestCase::PrepareNetwork(), ns3::Ipv6L3Protocol::RegisterExtensions(), ns3::Ipv6L3Protocol::RegisterOptions(), NetAnimExperiment::Run(), Experiment::Run(), ns3::AnimationInterface::SetConstantPosition(), ns3::NscTcpL4Protocol::SetNode(), and BasicEnergyUpdateTest::StateSwitchTest().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::Object::Check ( void  ) const
private
Returns
is reference count non zero

Definition at line 350 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:

bool ns3::Object::CheckLoose ( void  ) const
private
Returns
Do 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 ran 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 364 of file object.cc.

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

Referenced by AggregateObject(), and DoGetObject().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::Object::Construct ( const AttributeConstructionList attributes)
private
Parameters
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 139 of file object.cc.

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

Referenced by ns3::ObjectFactory::Create().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::Object::Dispose ( void  )

Run the DoDispose methods of this object and all the objects aggregated to it.

After calling this method, the object is expected to be totally unusable except for the Ref and Unref methods.

Note that 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 205 of file object.cc.

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

Referenced by ns3::NodeListPriv::DoDispose(), ns3::PointToPointEpcHelper::DoDispose(), ns3::ArpL3Protocol::DoDispose(), ns3::WifiNetDevice::DoDispose(), ns3::Icmpv6L4Protocol::DoDispose(), SequenceNumberTestCase::DoRun(), Ipv6RawSocketImplTest::DoRun(), Ipv4RawSocketImplTest::DoRun(), UdpSocketImplTest::DoRun(), and Udp6SocketImplTest::DoRun().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

References ns3::Object::Aggregates::buffer, current, 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:

void ns3::Object::DoDispose ( void  )
protectedvirtual

This method is called by Object::Dispose or by the object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overriden 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::MacLow, ns3::Socket, ns3::GlobalRouter, ns3::dsr::DsrRouting, ns3::WifiRemoteStationManager, ns3::Ipv6ExtensionRoutingDemux, ns3::LteEnbRrc, ns3::NdiscCache, ns3::Icmpv6L4Protocol, ns3::UanPhyGen, ns3::Ipv4StaticRouting, ns3::Ipv6L3Protocol, ns3::YansWifiPhy, ns3::CsmaNetDevice, ns3::UanPropModel, ns3::UanMacRc, ns3::DcaTxop, ns3::WimaxPhy, ns3::Ipv6ExtensionFragment, ns3::SubscriberStationNetDevice, ns3::UanPhyDual, ns3::ArpCache, ns3::CounterCalculator< T >, ns3::CounterCalculator< uint32_t >, ns3::CounterCalculator<>, ns3::EpcTestRrc, ns3::UanMacRcGw, ns3::Ipv6Interface, ns3::Ipv6StaticRouting, ns3::FlowMonitor, ns3::OpenFlowSwitchNetDevice, ns3::RegularWifiMac, ns3::Ipv4GlobalRouting, ns3::BaseStationNetDevice, ns3::Ipv4L3Protocol, ns3::UdpL4Protocol, ns3::WimaxNetDevice, ns3::EmuNetDevice, ns3::TcpL4Protocol, ns3::WifiRadioEnergyModel, ns3::TapBridge, ns3::Node, ns3::ApWifiMac, ns3::olsr::RoutingProtocol, ns3::SimpleOfdmWimaxPhy, ns3::PointToPointNetDevice, ns3::HalfDuplexIdealPhy, ns3::UanNetDevice, ns3::AlohaNoackNetDevice, ns3::RvBatteryModel, ns3::Ipv4Interface, ns3::Ipv6RawSocketImpl, ns3::Icmpv4L4Protocol, ns3::FdNetDevice, ns3::UanMacCw, ns3::DataCalculator, ns3::AcousticModemEnergyModel, ns3::EnergySource, ns3::LteSpectrumPhy, ns3::EnergySourceContainer, ns3::LteTestMac, ns3::MeshWifiInterfaceMac, ns3::LiIonEnergySource, ns3::LteRlcSm, ns3::VirtualNetDevice, ns3::SixLowPanNetDevice, ns3::NscTcpL4Protocol, ns3::Ipv4NixVectorRouting, ns3::UdpEchoClient, ns3::LteAnr, ns3::DataCollector, ns3::UanChannel, ns3::UanPhyPer, ns3::DistributedSimulatorImpl, ns3::WaypointMobilityModel, ns3::WaveformGenerator, ns3::OnOffApplication, ns3::NonCommunicatingNetDevice, ns3::Application, ns3::LtePhy, ns3::LteUeRrc, ns3::UdpTraceClient, ns3::LteTestPdcp, ns3::BridgeNetDevice, ns3::Ipv6ListRouting, ns3::LteEnbRrcProtocolReal, ns3::MeshPointDevice, ns3::PacketSocket, ns3::SimpleNetDevice, ns3::WifiNetDevice, ns3::WimaxConnection, ns3::ArpL3Protocol, ns3::BasicEnergySource, ns3::MultiModelSpectrumChannel, ns3::SpectrumInterference, ns3::SimpleDeviceEnergyModel, ns3::UeManager, ns3::BulkSendApplication, ns3::A2A4RsrqHandoverAlgorithm, ns3::LteEnbRrcProtocolIdeal, ns3::EdcaTxopN, ns3::PacketSizeMinMaxAvgTotalCalculator, ns3::MinMaxAvgTotalCalculator< T >, ns3::UanPhyCalcSinr, ns3::MinMaxAvgTotalCalculator< uint32_t >, ns3::MinMaxAvgTotalCalculator< double >, ns3::MinMaxAvgTotalCalculator< uint64_t >, ns3::NullMessageSimulatorImpl, ns3::PacketSink, ns3::Ipv4ListRouting, ns3::PssFfMacScheduler, ns3::SpectrumAnalyzer, ns3::FdTbfqFfMacScheduler, ns3::TdTbfqFfMacScheduler, ns3::Ping6, ns3::RealtimeSimulatorImpl, ns3::UanMacAloha, ns3::LteHandoverAlgorithm, ns3::Radvd, ns3::Ipv4RawSocketImpl, ns3::A3RsrpHandoverAlgorithm, ns3::FdBetFfMacScheduler, ns3::TdBetFfMacScheduler, ns3::GaussMarkovMobilityModel, ns3::PfFfMacScheduler, ns3::Ipv6ExtensionDemux, ns3::Ipv6OptionDemux, ns3::EpcX2, ns3::EpsBearerTagUdpClient, ns3::flame::FlameProtocol, ns3::RadioBearerStatsCalculator, ns3::LteUePhy, Receiver, ns3::UdpServer, ns3::UanTransducerHd, ns3::FdMtFfMacScheduler, ns3::TdMtFfMacScheduler, ns3::TtaFfMacScheduler, ns3::V4Ping, ns3::SpectrumPropagationLossModel, ns3::Ipv4FlowProbe, ns3::LoopbackNetDevice, ns3::FfMacScheduler, ns3::UdpClient, ns3::UdpSocketFactoryImpl, ns3::VisualSimulatorImpl, ns3::RrFfMacScheduler, ns3::Ipv6PmtuCache, ns3::LteEnbPhy, ns3::flame::FlameRtable, ns3::dot11s::HwmpRtable, ns3::DefaultSimulatorImpl, ns3::SingleModelSpectrumChannel, ns3::PointToPointEpcHelper, ns3::PacketBurst, ns3::dsdv::RoutingProtocol, ns3::EpcHelper, ns3::NoOpHandoverAlgorithm, ns3::LteEnbMac, ns3::aodv::RoutingProtocol, ns3::LteHelper, ns3::LteUeRrcProtocolReal, ns3::PacketCounterCalculator, ns3::ShannonSpectrumErrorModel, ns3::DataOutputInterface, ns3::SSScheduler, ns3::EpcMme, ns3::JakesProcess, ns3::EpcEnbApplication, ns3::LteEnbNetDevice, ns3::RandomWalk2dMobilityModel, ns3::TimeMinMaxAvgTotalCalculator, ns3::BandwidthManager, ns3::NscTcpSocketFactoryImpl, ns3::LteUeNetDevice, ns3::RemSpectrumPhy, ns3::MpiReceiver, ns3::TcpSocketFactoryImpl, ns3::LteRlc, ns3::FlameStack, ns3::EpcSgwPgwApplication, ns3::LteNetDevice, ns3::LteUeRrcProtocolIdeal, ns3::RandomDirection2dMobilityModel, ns3::SsServiceFlowManager, ns3::UdpEchoServer, ns3::BuildingListPriv, ns3::dot11s::PeerManagementProtocol, ns3::ChannelListPriv, ns3::LteInterference, ns3::LteUeMac, ns3::NodeListPriv, ns3::ServiceFlowManager, ns3::LteTestRrc, ns3::Dot11sStack, ns3::dot11s::HwmpProtocol, ns3::UanNoiseModel, ns3::BsServiceFlowManager, ns3::FlowProbe, ns3::dot11s::PeerLink, ns3::RadioEnvironmentMapHelper, ns3::EpcUeNas, ns3::LteSimpleHelper, ns3::ConnectionManager, ns3::SqliteDataOutput, ns3::LteSimpleNetDevice, ns3::OmnetDataOutput, ns3::SSLinkManager, ns3::LteTestUePhy, Sender, ns3::LtePdcp, ns3::Building, ns3::LteHexGridEnbTopologyHelper, ns3::BurstProfileManager, ns3::LteRlcAm, ns3::LteRlcTm, and ns3::LteRlcUm.

Definition at line 336 of file object.cc.

References m_disposed, NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by Dispose(), DoDelete(), ns3::LteHexGridEnbTopologyHelper::DoDispose(), ns3::LteSimpleHelper::DoDispose(), ns3::FlowProbe::DoDispose(), ns3::UanNoiseModel::DoDispose(), ns3::LteInterference::DoDispose(), ns3::LteUeMac::DoDispose(), ns3::NodeListPriv::DoDispose(), ns3::BuildingListPriv::DoDispose(), ns3::ChannelListPriv::DoDispose(), ns3::LteNetDevice::DoDispose(), ns3::RandomDirection2dMobilityModel::DoDispose(), ns3::TcpSocketFactoryImpl::DoDispose(), ns3::NscTcpSocketFactoryImpl::DoDispose(), ns3::RemSpectrumPhy::DoDispose(), ns3::RandomWalk2dMobilityModel::DoDispose(), ns3::ShannonSpectrumErrorModel::DoDispose(), ns3::DataOutputInterface::DoDispose(), ns3::LteHelper::DoDispose(), ns3::aodv::RoutingProtocol::DoDispose(), ns3::EpcHelper::DoDispose(), ns3::dsdv::RoutingProtocol::DoDispose(), ns3::SingleModelSpectrumChannel::DoDispose(), ns3::DefaultSimulatorImpl::DoDispose(), ns3::UdpSocketFactoryImpl::DoDispose(), ns3::VisualSimulatorImpl::DoDispose(), ns3::LoopbackNetDevice::DoDispose(), ns3::UanTransducerHd::DoDispose(), ns3::Ipv6ExtensionDemux::DoDispose(), ns3::Ipv6OptionDemux::DoDispose(), ns3::GaussMarkovMobilityModel::DoDispose(), ns3::UanMacAloha::DoDispose(), ns3::RealtimeSimulatorImpl::DoDispose(), ns3::SpectrumAnalyzer::DoDispose(), ns3::NullMessageSimulatorImpl::DoDispose(), ns3::UanPhyCalcSinr::DoDispose(), ns3::SpectrumInterference::DoDispose(), ns3::MultiModelSpectrumChannel::DoDispose(), ns3::ArpL3Protocol::DoDispose(), ns3::WifiNetDevice::DoDispose(), ns3::SimpleNetDevice::DoDispose(), ns3::MeshPointDevice::DoDispose(), ns3::BridgeNetDevice::DoDispose(), ns3::LtePhy::DoDispose(), ns3::Application::DoDispose(), ns3::NonCommunicatingNetDevice::DoDispose(), ns3::WaypointMobilityModel::DoDispose(), ns3::DistributedSimulatorImpl::DoDispose(), ns3::UanChannel::DoDispose(), ns3::UanPhyPer::DoDispose(), ns3::DataCollector::DoDispose(), ns3::Ipv4NixVectorRouting::DoDispose(), ns3::NscTcpL4Protocol::DoDispose(), ns3::SixLowPanNetDevice::DoDispose(), ns3::VirtualNetDevice::DoDispose(), ns3::LteSpectrumPhy::DoDispose(), ns3::DataCalculator::DoDispose(), ns3::FdNetDevice::DoDispose(), ns3::UanMacCw::DoDispose(), ns3::Icmpv4L4Protocol::DoDispose(), ns3::Ipv4Interface::DoDispose(), ns3::AlohaNoackNetDevice::DoDispose(), ns3::UanNetDevice::DoDispose(), ns3::HalfDuplexIdealPhy::DoDispose(), ns3::PointToPointNetDevice::DoDispose(), ns3::olsr::RoutingProtocol::DoDispose(), ns3::Node::DoDispose(), ns3::TapBridge::DoDispose(), ns3::TcpL4Protocol::DoDispose(), ns3::EmuNetDevice::DoDispose(), ns3::WimaxNetDevice::DoDispose(), ns3::UdpL4Protocol::DoDispose(), ns3::Ipv4L3Protocol::DoDispose(), ns3::Ipv4GlobalRouting::DoDispose(), ns3::FlowMonitor::DoDispose(), ns3::Ipv6Interface::DoDispose(), ns3::Ipv6StaticRouting::DoDispose(), ns3::UanMacRcGw::DoDispose(), ns3::ArpCache::DoDispose(), ns3::UanPhyDual::DoDispose(), ns3::Ipv6ExtensionFragment::DoDispose(), ns3::UanMacRc::DoDispose(), ns3::UanPropModel::DoDispose(), ns3::CsmaNetDevice::DoDispose(), ns3::Ipv6L3Protocol::DoDispose(), ns3::Ipv4StaticRouting::DoDispose(), ns3::UanPhyGen::DoDispose(), ns3::Icmpv6L4Protocol::DoDispose(), ns3::NdiscCache::DoDispose(), ns3::Ipv6ExtensionRoutingDemux::DoDispose(), ns3::dsr::DsrRouting::DoDispose(), and ns3::GlobalRouter::DoDispose().

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

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

Parameters
tidthe TypeId we're looking for
Returns
the matching Object, if it is found

Definition at line 146 of file object.cc.

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

Referenced by AggregateObject(), and GetObject().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::Object::DoInitialize ( void  )
protectedvirtual

This method is called only once by Object::Initialize.

If the user calls Object::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::LteHelper, ns3::EdcaTxopN, ns3::RegularWifiMac, ns3::Node, ns3::ApWifiMac, ns3::RvBatteryModel, ns3::EnergySourceContainer, ns3::LteEnbNetDevice, ns3::MeshWifiInterfaceMac, ns3::DcaTxop, ns3::dot11s::PeerManagementProtocol, ns3::LiIonEnergySource, ns3::LteRlcSm, ns3::LteAnr, ns3::olsr::RoutingProtocol, ns3::LteUeNetDevice, ns3::Application, ns3::LteUeRrc, ns3::LteSimpleHelper, ns3::WifiNetDevice, ns3::BasicEnergySource, ns3::UeManager, ns3::A2A4RsrqHandoverAlgorithm, ns3::dot11s::HwmpProtocol, ns3::Ipv4ListRouting, ns3::A3RsrpHandoverAlgorithm, ns3::LteUePhy, ns3::LteEnbPhy, ns3::NoOpHandoverAlgorithm, ns3::RandomWalk2dMobilityModel, ns3::SteadyStateRandomWaypointMobilityModel, ns3::LteSimpleNetDevice, ns3::RandomDirection2dMobilityModel, ns3::RandomWaypointMobilityModel, ns3::TraceFadingLossModel, Emitter, Emitter, and Emitter.

Definition at line 343 of file object.cc.

References m_initialized, NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by ns3::RandomDirection2dMobilityModel::DoInitialize(), ns3::RandomWaypointMobilityModel::DoInitialize(), ns3::RandomWalk2dMobilityModel::DoInitialize(), ns3::SteadyStateRandomWaypointMobilityModel::DoInitialize(), ns3::NoOpHandoverAlgorithm::DoInitialize(), ns3::LteEnbPhy::DoInitialize(), ns3::LteUePhy::DoInitialize(), ns3::A3RsrpHandoverAlgorithm::DoInitialize(), ns3::Ipv4ListRouting::DoInitialize(), ns3::A2A4RsrqHandoverAlgorithm::DoInitialize(), ns3::WifiNetDevice::DoInitialize(), ns3::LteSimpleHelper::DoInitialize(), ns3::Application::DoInitialize(), ns3::DcaTxop::DoInitialize(), ns3::Node::DoInitialize(), ns3::EdcaTxopN::DoInitialize(), ns3::LteHelper::DoInitialize(), and Initialize().

+ Here is the caller graph for this function:

Object::AggregateIterator ns3::Object::GetAggregateIterator ( void  ) const
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 321 of file object.cc.

References AggregateIterator, and NS_LOG_FUNCTION.

TypeId ns3::Object::GetInstanceTypeId ( void  ) const
virtual
template<typename T >
Ptr< T > ns3::Object::GetObject ( void  ) const
inline
Returns
a pointer to the requested interface or zero if it could not be found.

Definition at line 361 of file object.h.

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

Referenced by ns3::PointToPointEpcHelper::ActivateEpsBearer(), StackHelper::AddAddress(), ns3::Ipv6Interface::AddAddress(), ns3::PointToPointEpcHelper::AddEnb(), ns3::NscTcpL4Protocol::AddInterface(), ns3::Ipv6StaticRoutingHelper::AddMulticastRoute(), ns3::Ipv4StaticRoutingHelper::AddMulticastRoute(), ns3::FileHelper::AddProbe(), ns3::GnuplotHelper::AddProbe(), TcpTestCase::AddSimpleNetDevice(), AddSimpleNetDevice(), TcpTestCase::AddSimpleNetDevice6(), ns3::PointToPointEpcHelper::AddX2Interface(), OcbWifiMacTestCase::AdvancePosition(), ns3::GlobalRouter::AnotherRouterOnLink(), ns3::AnimationInterface::AppendXMLRemainingEnergy(), Experiment::ApplicationSetup(), ns3::LteUeRrc::ApplyRadioResourceConfigDedicated(), ns3::Ipv6AddressHelper::Assign(), ns3::Ipv4AddressHelper::Assign(), ns3::AodvHelper::AssignStreams(), ns3::OlsrHelper::AssignStreams(), ns3::InternetStackHelper::AssignStreams(), ns3::MobilityHelper::AssignStreams(), ns3::Ipv4NixVectorRouting::BFS(), ns3::PointToPointStarHelper::BoundingBox(), ns3::PointToPointGridHelper::BoundingBox(), ns3::PointToPointDumbbellHelper::BoundingBox(), ns3::GlobalRouteManagerImpl::BuildGlobalRoutingDatabase(), ns3::GlobalRouter::BuildNetworkLSAs(), ns3::GlobalRouteManagerImpl::CheckForStubNode(), ns3::Ns2MobilityHelperTest::CheckInitialPositions(), ns3::Ipv4RawSocketImpl::Close(), ns3::Ipv6RawSocketImpl::Close(), ns3::DsrHelper::Create(), ns3::SpectrumPhyHelper::Create(), ns3::ArpL3Protocol::CreateCache(), ns3::Socket::CreateSocket(), ns3::TapBridge::CreateTap(), ns3::GlobalRouteManagerImpl::DeleteGlobalRoutes(), ns3::GlobalRouter::DiscoverLSAs(), ns3::Icmpv6L4Protocol::DoDAD(), ns3::LteHelper::DoInitialize(), ns3::BasicEnergySourceHelper::DoInstall(), ns3::RvBatteryModelHelper::DoInstall(), ns3::WifiRadioEnergyModelHelper::DoInstall(), ns3::Resolver::DoResolve(), IpAddressHelperTestCasev6::DoRun(), ns3::LenaMimoTestCase::DoRun(), ns3::SteadyStateRandomWaypointTest::DoRun(), ns3::LenaHarqTestCase::DoRun(), ns3::LenaRrFfMacSchedulerTestCase::DoRun(), ns3::LenaDataPhyErrorModelTestCase::DoRun(), ns3::LenaPfFfMacSchedulerTestCase1::DoRun(), ns3::WaypointMobilityModelNotifyTest::DoRun(), ns3::LenaFdBetFfMacSchedulerTestCase1::DoRun(), LenaFdMtFfMacSchedulerTestCase::DoRun(), ns3::LenaFdTbfqFfMacSchedulerTestCase1::DoRun(), ns3::LenaPssFfMacSchedulerTestCase1::DoRun(), ns3::LenaTdBetFfMacSchedulerTestCase1::DoRun(), LenaTdMtFfMacSchedulerTestCase::DoRun(), ns3::LenaTdTbfqFfMacSchedulerTestCase1::DoRun(), LenaTtaFfMacSchedulerTestCase::DoRun(), StaticRoutingSlash32TestCase::DoRun(), ns3::LteLinkAdaptationTestCase::DoRun(), ns3::AcousticModemEnergyTestCase::DoRun(), ns3::LteInterferenceTestCase::DoRun(), ns3::LtePathlossModelSystemTestCase::DoRun(), DynamicGlobalRoutingTestCase::DoRun(), ns3::LteEnbAntennaTestCase::DoRun(), ns3::LteX2HandoverTestCase::DoRun(), ns3::LenaPfFfMacSchedulerTestCase2::DoRun(), ns3::LteUeMeasurementsTestCase::DoRun(), ns3::LenaFdBetFfMacSchedulerTestCase2::DoRun(), ns3::LenaTdBetFfMacSchedulerTestCase2::DoRun(), ns3::LenaFdTbfqFfMacSchedulerTestCase2::DoRun(), ns3::LenaPssFfMacSchedulerTestCase2::DoRun(), ns3::LenaTdTbfqFfMacSchedulerTestCase2::DoRun(), ns3::LenaDlCtrlPhyErrorModelTestCase::DoRun(), ns3::LteHandoverDelayTestCase::DoRun(), ns3::RandomRoomPositionAllocatorTestCase::DoRun(), Ipv4ForwardingTest::DoRun(), Ipv6ForwardingTest::DoRun(), Ipv6PacketInfoTagTest::DoRun(), SixlowpanHc1ImplTest::DoRun(), SixlowpanIphcImplTest::DoRun(), ns3::SpectrumIdealPhyTestCase::DoRun(), Ipv6RawSocketImplTest::DoRun(), Ipv4HeaderTest::DoRun(), ns3::EpcS1uDlTestCase::DoRun(), Ipv4PacketInfoTagTest::DoRun(), Ipv4RawSocketImplTest::DoRun(), ns3::LteX2HandoverMeasuresTestCase::DoRun(), Ipv4FragmentationTest::DoRun(), ns3::LteCellSelectionTestCase::DoRun(), ns3::LteEpcE2eDataTestCase::DoRun(), ns3::BuildingsHelperOneTestCase::DoRun(), SixlowpanFragmentationTest::DoRun(), Ipv6FragmentationTest::DoRun(), UdpSocketLoopbackTest::DoRun(), ns3::LteHandoverTargetTestCase::DoRun(), ns3::LteUeMeasurementsPiecewiseTestCase1::DoRun(), Udp6SocketLoopbackTest::DoRun(), ns3::SameRoomPositionAllocatorTestCase::DoRun(), ns3::aodv::ChainRegressionTest::DoRun(), UdpSocketImplTest::DoRun(), ns3::AcousticModemEnergyDepletionTestCase::DoRun(), ns3::InterferenceHelperSequenceTest::DoRun(), ns3::LteUeMeasurementsPiecewiseTestCase2::DoRun(), ns3::EpcS1uUlTestCase::DoRun(), GlobalRoutingSlash32TestCase::DoRun(), WaypointMobilityModelViaHelper::DoRun(), ns3::LteUeMeasurementsHandoverTestCase::DoRun(), ns3::ObjectFactoryTestCase::DoRun(), Udp6SocketImplTest::DoRun(), CsmaStarTestCase::DoRun(), PointerAttributeTestCase::DoRun(), ns3::UdpSocketImpl::DoSendTo(), ns3::Ipv4Interface::DoSetup(), ns3::Ipv6Interface::DoSetup(), ns3::AsciiTraceHelperForIpv4::EnableAsciiIpv4Impl(), ns3::AsciiTraceHelperForIpv6::EnableAsciiIpv6Impl(), ns3::PcapHelperForIpv4::EnablePcapIpv4(), ns3::PcapHelperForIpv6::EnablePcapIpv6(), experiment(), ns3::Names::Find(), ns3::LteStatsCalculator::FindCellIdFromEnbRlcPath(), ns3::GlobalRouter::FindDesignatedRouterForLink(), ns3::LteStatsCalculator::FindImsiFromEnbRlcPath(), ns3::LteStatsCalculator::FindImsiFromLteNetDevice(), ns3::LteStatsCalculator::FindImsiFromUePhy(), ns3::GlobalRouter::FindInterfaceForDevice(), ns3::Ipv4NixVectorRouting::FindNetDeviceForNixIndex(), ns3::GlobalRouteManagerImpl::FindOutgoingInterfaceId(), ns3::Ipv4NixVectorRouting::FlushGlobalNixRoutingCache(), ns3::WaypointMobilityModelNotifyTest::ForceUpdates(), ns3::Icmpv4L4Protocol::Forward(), ns3::Icmpv6L4Protocol::Forward(), OcbWifiMacTestCase::GetCurrentPosition(), 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::AnimationInterface::GetIpv4RoutingTable(), ns3::OhBuildingsPropagationLossModel::GetLoss(), ns3::ItuR1238PropagationLossModel::GetLoss(), ns3::HybridBuildingsPropagationLossModel::GetLoss(), ns3::SameRoomPositionAllocator::GetNext(), ns3::Ipv4NixVectorRouting::GetNodeByIp(), ns3::dsr::DsrRouting::GetNodeWithAddress(), ns3::dsr::DsrOptions::GetNodeWithAddress(), Experiment::GetPosition(), GetPosition(), ns3::BuildingsPropagationLossModel::GetShadowing(), ns3::PointToPointEpcHelper::GetUeDefaultGatewayAddress(), ns3::Ipv4L3Protocol::HandleFragmentsTimeout(), ns3::Ipv6ExtensionFragment::HandleFragmentsTimeout(), ns3::SixLowPanNetDevice::HandleFragmentsTimeout(), ns3::Icmpv6L4Protocol::HandleNS(), ns3::Icmpv6L4Protocol::HandlePacketTooBig(), ns3::Icmpv6L4Protocol::HandleRA(), ns3::Icmpv6L4Protocol::HandleRedirection(), ns3::Icmpv6L4Protocol::HandleRS(), ns3::GlobalRouteManagerImpl::InitializeRoutes(), ns3::BuildingsHelper::Install(), ns3::FlowMonitorHelper::Install(), ns3::RadioEnvironmentMapHelper::Install(), ns3::CsmaHelper::Install(), ns3::WaveformGeneratorHelper::Install(), ns3::AdhocAlohaNoackIdealPhyHelper::Install(), ns3::SpectrumAnalyzerHelper::Install(), ns3::InternetStackHelper::Install(), ns3::WifiHelper::Install(), ns3::MobilityHelper::Install(), ns3::UanHelper::Install(), ns3::FlowMonitorHelper::InstallAll(), AodvExample::InstallApplications(), DsdvManetExample::InstallApplications(), ns3::LteHelper::InstallSingleEnbDevice(), ns3::LteHelper::InstallSingleUeDevice(), ns3::Ipv4L3Protocol::IpForward(), ns3::Ipv6L3Protocol::IpForward(), ns3::Ipv4L3Protocol::IpMulticastForward(), ns3::Ipv6L3Protocol::IpMulticastForward(), ns3::Ipv4FlowProbe::Ipv4FlowProbe(), ns3::Ipv6L3Protocol::LocalDeliver(), ns3::LteFadingTestSuite::LteFadingTestSuite(), main(), ns3::BuildingsHelper::MakeConsistent(), ns3::BuildingsHelper::MakeMobilityModelConsistent(), ns3::dsr::DsrRouting::NotifyDataReceipt(), ns3::TcpL4Protocol::NotifyNewAggregate(), ns3::UdpL4Protocol::NotifyNewAggregate(), ns3::dsr::DsrRouting::NotifyNewAggregate(), OcbWifiMacTestCase::PostDeviceConfiguration(), ns3::Ipv4RoutingHelper::Print(), ns3::Ipv6RoutingHelper::Print(), ns3::Ipv4RoutingHelper::PrintEvery(), ns3::Ipv6RoutingHelper::PrintEvery(), PrintGnuplottableEnbListToFile(), PrintGnuplottableUeListToFile(), IpAddressHelper::PrintIpAddresses(), PrintPosition(), StackHelper::PrintRoutingTable(), 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::MobilityHelper::PushReferenceMobilityModel(), ns3::AnimationInterface::RecalcTopoBounds(), ns3::Ipv6L3Protocol::Receive(), ns3::Ipv4L3Protocol::Receive(), ns3::Icmpv6L4Protocol::Receive(), ns3::dsr::DsrRouting::Receive(), ns3::SixLowPanNetDevice::ReceiveFromDevice(), ns3::AnimationInterface::RecursiveIpv4RoutePathSearch(), ns3::Ipv6AutoconfiguredPrefix::RemoveMe(), ns3::MeshHelper::Report(), 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::SixLowPanNetDevice::Send(), ns3::Ping6::Send(), ns3::Radvd::Send(), ns3::Ipv4Interface::Send(), ns3::Ipv6L3Protocol::Send(), ns3::Ipv4L3Protocol::Send(), ns3::TcpL4Protocol::Send(), ns3::Ipv6Interface::Send(), ns3::NscTcpL4Protocol::send_callback(), ns3::ArpL3Protocol::SendArpRequest(), ns3::SixLowPanNetDevice::SendFrom(), ns3::Icmpv4L4Protocol::SendMessage(), ns3::Icmpv6L4Protocol::SendMessage(), ns3::TcpL4Protocol::SendPacket(), ns3::Ipv4L3Protocol::SendRealOut(), ns3::Ipv6L3Protocol::SendRealOut(), ns3::Ipv4RawSocketImpl::SendTo(), ns3::Ipv6RawSocketImpl::SendTo(), ns3::AnimationInterface::SetConstantPosition(), ns3::Ipv4StaticRoutingHelper::SetDefaultMulticastRoute(), Experiment::SetPosition(), SetPosition(), ns3::MobilityHelper::SetPositionAllocator(), ns3::LteHexGridEnbTopologyHelper::SetPositionAndInstallEnbDevice(), ns3::UeManager::SetupDataRadioBearer(), TcpTestCase::SetupDefaultSim(), TcpTestCase::SetupDefaultSim6(), ns3::TcpSocketBase::SetupEndpoint(), ns3::TcpSocketBase::SetupEndpoint6(), DsdvManetExample::SetupMobility(), ns3::olsr::SetVelocity(), showPosition(), ns3::GlobalRouteManagerImpl::SPFAddASExternal(), ns3::GlobalRouteManagerImpl::SPFIntraAddRouter(), ns3::GlobalRouteManagerImpl::SPFIntraAddStub(), ns3::GlobalRouteManagerImpl::SPFIntraAddTransit(), Receiver::StartApplication(), ns3::MeshWifiInterfaceMac::SwitchFrequencyChannel(), ns3::AnimationInterface::TrackIpv4RoutePaths(), Tunnel::Tunnel(), ns3::UanChannel::TxPacket(), GlobalPathlossDatabase::UpdatePathloss(), ns3::AnimationInterface::UpdatePosition(), NetAnimExperiment::UpdatePositions(), and Experiment::UpdatePositions().

+ Here is the call graph for this function:

template<typename T >
Ptr< T > ns3::Object::GetObject ( TypeId  tid) const
Parameters
tidthe interface id of the requested interface
Returns
a pointer to the requested interface or zero if it could not be found.

Definition at line 381 of file object.h.

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

+ Here is the call graph for this function:

TypeId ns3::Object::GetTypeId ( void  )
static

Register this type.

Returns
The object TypeId.

Definition at line 84 of file object.cc.

References ns3::TypeId::SetParent().

Referenced by DoGetObject(), MyObject::GetTypeId(), TestObject::GetTypeId(), and AlternateTestObject::GetTypeId().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::Object::Initialize ( void  )

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

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

Referenced by ns3::NodeListPriv::Add(), ns3::BuildingListPriv::Add(), ns3::Node::AddApplication(), ns3::Node::AddDevice(), ns3::WifiNetDevice::DoInitialize(), ns3::SteadyStateRandomWaypointTest::DoRun(), ns3::WaypointMobilityModelNotifyTest::DoRun(), ns3::LteSimpleHelper::InstallEnbDevice(), ns3::LteHelper::InstallEnbDevice(), and main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::Object::NotifyNewAggregate ( void  )
protectedvirtual

This method is invoked whenever two sets of objects are aggregated together.

This function must be implemented in the stack that needs to notify other stacks connected to the node of their presence in the node.

It is invoked exactly once for each object in both sets. This method can be overriden 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::Ipv4L3Protocol, ns3::UdpL4Protocol, ns3::TcpL4Protocol, ns3::Icmpv6L4Protocol, ns3::NscTcpL4Protocol, ns3::ArpL3Protocol, and ns3::Icmpv4L4Protocol.

Definition at line 315 of file object.cc.

References NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

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

Invoked from ns3::CreateObject only. Initialize the m_tid member variable to keep track of the type of this object instance.

Definition at line 328 of file object.cc.

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

Referenced by ns3::ObjectFactory::Create().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

Parameters
aggregatesthe list of aggregated objects
ithe most recently used entry in the list

Definition at line 230 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

friend class AggregateIterator
friend

Definition at line 230 of file object.h.

Referenced by GetAggregateIterator().

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

Definition at line 412 of file object.h.

template<typename T >
Ptr<T> CopyObject ( Ptr< T >  object)
friend
Parameters
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 396 of file object.h.

template<typename T >
Ptr<T> CopyObject ( Ptr< const T >  object)
friend
Parameters
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 396 of file object.h.

friend struct ObjectDeleter
friend

Definition at line 231 of file object.h.

Member Data Documentation

struct Aggregates* ns3::Object::m_aggregates
private

a pointer to an array of 'aggregates'.

i.e., 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 323 of file object.h.

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

bool ns3::Object::m_disposed
private

Set to true when the DoDispose method of the object has run, false otherwise.

Definition at line 311 of file object.h.

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

uint32_t ns3::Object::m_getObjectCount
private

Indicates 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 to put at the start of the array the most-frequently accessed elements.

Definition at line 330 of file object.h.

Referenced by DoGetObject(), and UpdateSortedArray().

bool ns3::Object::m_initialized
private

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

Definition at line 316 of file object.h.

Referenced by DoInitialize(), and Initialize().

TypeId ns3::Object::m_tid
private

Identifies the type of this object instance.

Definition at line 306 of file object.h.

Referenced by GetInstanceTypeId(), and SetTypeId().


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