keep track of a set of node pointers. More...
#include "node-container.h"
Public Types | |
typedef std::vector< Ptr< Node > >::const_iterator | Iterator |
Node container iterator. More... | |
Public Member Functions | |
NodeContainer () | |
Create an empty NodeContainer. More... | |
NodeContainer (const NodeContainer &a, const NodeContainer &b) | |
Create a node container which is a concatenation of two input NodeContainers. More... | |
NodeContainer (const NodeContainer &a, const NodeContainer &b, const NodeContainer &c) | |
Create a node container which is a concatenation of three input NodeContainers. More... | |
NodeContainer (const NodeContainer &a, const NodeContainer &b, const NodeContainer &c, const NodeContainer &d) | |
Create a node container which is a concatenation of four input NodeContainers. More... | |
NodeContainer (const NodeContainer &a, const NodeContainer &b, const NodeContainer &c, const NodeContainer &d, const NodeContainer &e) | |
Create a node container which is a concatenation of five input NodeContainers. More... | |
NodeContainer (Ptr< Node > node) | |
Create a NodeContainer with exactly one node which has been previously instantiated. More... | |
NodeContainer (std::string nodeName) | |
Create a NodeContainer with exactly one node which has been previously instantiated and assigned a name using the Object Name Service. More... | |
NodeContainer (uint32_t n, uint32_t systemId=0) | |
Create a NodeContainer with the requested number of Nodes. More... | |
void | Add (NodeContainer other) |
Append the contents of another NodeContainer to the end of this container. More... | |
void | Add (Ptr< Node > node) |
Append a single Ptr<Node> to this container. More... | |
void | Add (std::string nodeName) |
Append to this container the single Ptr<Node> referred to via its object name service registered name. More... | |
Iterator | Begin (void) const |
Get an iterator which refers to the first Node in the container. More... | |
bool | Contains (uint32_t id) const |
Return true if container contains a Node with index id. More... | |
void | Create (uint32_t n) |
Create n nodes and append pointers to them to the end of this NodeContainer. More... | |
void | Create (uint32_t n, uint32_t systemId) |
Create n nodes with specified systemId for distributed simulations and append pointers to them to the end of this NodeContainer. More... | |
Iterator | End (void) const |
Get an iterator which indicates past-the-last Node in the container. More... | |
Ptr< Node > | Get (uint32_t i) const |
Get the Ptr<Node> stored in this container at a given index. More... | |
uint32_t | GetN (void) const |
Get the number of Ptr<Node> stored in this container. More... | |
Static Public Member Functions | |
static NodeContainer | GetGlobal (void) |
Create a NodeContainer that contains a list of all nodes created through NodeContainer::Create() and stored in the ns3::NodeList. More... | |
Private Attributes | |
std::vector< Ptr< Node > > | m_nodes |
Nodes smart pointers. More... | |
keep track of a set of node pointers.
Typically ns-3 helpers operate on more than one node at a time. For example a device helper may want to install devices on a large number of similar nodes. The helper Install methods usually take a NodeContainer as a parameter. NodeContainers hold the multiple Ptr<Node> which are used to refer to the nodes.
Definition at line 38 of file node-container.h.
typedef std::vector<Ptr<Node> >::const_iterator ns3::NodeContainer::Iterator |
Node container iterator.
Definition at line 42 of file node-container.h.
ns3::NodeContainer::NodeContainer | ( | ) |
Create an empty NodeContainer.
Definition at line 26 of file node-container.cc.
Create a NodeContainer with exactly one node which has been previously instantiated.
The single Node is specified by a smart pointer.
node | The Ptr<Node> to add to the container. |
Definition at line 30 of file node-container.cc.
References m_nodes.
ns3::NodeContainer::NodeContainer | ( | std::string | nodeName | ) |
Create a NodeContainer with exactly one node which has been previously instantiated and assigned a name using the Object Name Service.
This Node is then specified by its assigned name.
Definition at line 34 of file node-container.cc.
References m_nodes.
ns3::NodeContainer::NodeContainer | ( | uint32_t | n, |
uint32_t | systemId = 0 |
||
) |
Create a NodeContainer with the requested number of Nodes.
This is syntatic sugar for
NodeContainer nodes; nodes.Create (size); // or nodes.Create (size, systemId);
[in] | n | The number of nodes to create. |
[in] | systemId | The system id or rank associated with this node |
Definition at line 39 of file node-container.cc.
References Create(), and m_nodes.
ns3::NodeContainer::NodeContainer | ( | const NodeContainer & | a, |
const NodeContainer & | b | ||
) |
Create a node container which is a concatenation of two input NodeContainers.
a | The first NodeContainer |
b | The second NodeContainer |
Definition at line 44 of file node-container.cc.
References Add().
ns3::NodeContainer::NodeContainer | ( | const NodeContainer & | a, |
const NodeContainer & | b, | ||
const NodeContainer & | c | ||
) |
Create a node container which is a concatenation of three input NodeContainers.
a | The first NodeContainer |
b | The second NodeContainer |
c | The third NodeContainer |
Definition at line 49 of file node-container.cc.
References Add().
ns3::NodeContainer::NodeContainer | ( | const NodeContainer & | a, |
const NodeContainer & | b, | ||
const NodeContainer & | c, | ||
const NodeContainer & | d | ||
) |
Create a node container which is a concatenation of four input NodeContainers.
a | The first NodeContainer |
b | The second NodeContainer |
c | The third NodeContainer |
d | The fourth NodeContainer |
Definition at line 56 of file node-container.cc.
References Add().
ns3::NodeContainer::NodeContainer | ( | const NodeContainer & | a, |
const NodeContainer & | b, | ||
const NodeContainer & | c, | ||
const NodeContainer & | d, | ||
const NodeContainer & | e | ||
) |
Create a node container which is a concatenation of five input NodeContainers.
a | The first NodeContainer |
b | The second NodeContainer |
c | The third NodeContainer |
d | The fourth NodeContainer |
e | The fifth NodeContainer |
Definition at line 65 of file node-container.cc.
References Add().
void ns3::NodeContainer::Add | ( | NodeContainer | other | ) |
Append the contents of another NodeContainer to the end of this container.
other | The NodeContainer to append. |
Definition at line 114 of file node-container.cc.
References Begin(), End(), and m_nodes.
Referenced by NodeContainer(), Experiment::AssignNeighbors(), ns3::BriteTopologyHelper::BuildBriteTopology(), BriteTopologyFunctionTestCase::DoRun(), IcmpTimeExceedTestCase::DoRun(), IcmpV6TimeExceedTestCase::DoRun(), EpcS1uDlTestCase::DoRun(), EpcS1uUlTestCase::DoRun(), NixVectorRoutingTest::DoRun(), CsmaPingTestCase::DoRun(), CsmaStarTestCase::DoRun(), Ns3TcpLossTestCase::DoRun(), Ns3TcpStateTestCase::DoRun(), Experiment::GenerateNeighbors(), and GetGlobal().
Append a single Ptr<Node> to this container.
node | The Ptr<Node> to append. |
Definition at line 122 of file node-container.cc.
References m_nodes.
void ns3::NodeContainer::Add | ( | std::string | nodeName | ) |
NodeContainer::Iterator ns3::NodeContainer::Begin | ( | void | ) | const |
Get an iterator which refers to the first Node in the container.
Nodes can be retrieved from the container in two ways. First, directly by an index into the container, and second, using an iterator. This method is used in the iterator method and is typically used in a for-loop to run through the Nodes
Definition at line 77 of file node-container.cc.
References m_nodes.
Referenced by ns3::SameRoomPositionAllocator::SameRoomPositionAllocator(), Add(), ns3::LteHelper::AddX2Interface(), ns3::AodvHelper::AssignStreams(), ns3::OnOffHelper::AssignStreams(), ns3::InternetStackHelper::AssignStreams(), ns3::RipHelper::AssignStreams(), ns3::RipNgHelper::AssignStreams(), ns3::GroupMobilityHelper::AssignStreams(), ns3::MobilityHelper::AssignStreams(), ns3::OlsrHelper::AssignStreams(), ns3::WaveBsmHelper::AssignStreams(), ns3::DistributedSimulatorImpl::CalculateLookAhead(), ns3::NullMessageSimulatorImpl::CalculateLookAhead(), LteCellSelectionTestCase::DoRun(), SameRoomPositionAllocatorTestCase::DoRun(), ns3::MobilityHelper::EnableAscii(), ns3::UanHelper::EnableAscii(), ns3::AsciiTraceHelperForDevice::EnableAsciiImpl(), ns3::AsciiTraceHelperForIpv4::EnableAsciiIpv4Impl(), ns3::AsciiTraceHelperForIpv6::EnableAsciiIpv6Impl(), ns3::AthstatsHelper::EnableAthstats(), ns3::PcapHelperForDevice::EnablePcap(), ns3::PcapHelperForIpv4::EnablePcapIpv4(), ns3::PcapHelperForIpv6::EnablePcapIpv6(), ns3::SameRoomPositionAllocator::GetNext(), ns3::FdNetDeviceHelper::Install(), ns3::CsmaHelper::Install(), ns3::SimpleNetDeviceHelper::Install(), ns3::WaveHelper::Install(), ns3::WifiHelper::Install(), ns3::MeshHelper::Install(), ns3::UdpServerHelper::Install(), ns3::UdpClientHelper::Install(), ns3::UdpTraceClientHelper::Install(), ns3::BuildingsHelper::Install(), ns3::Ping6Helper::Install(), ns3::LrWpanHelper::Install(), ns3::BulkSendHelper::Install(), ns3::OnOffHelper::Install(), ns3::PacketSinkHelper::Install(), ns3::ThreeGppHttpClientHelper::Install(), ns3::ThreeGppHttpServerHelper::Install(), ns3::UdpEchoServerHelper::Install(), ns3::UdpEchoClientHelper::Install(), ns3::EnergySourceHelper::Install(), ns3::InternetStackHelper::Install(), ns3::PacketSocketHelper::Install(), ns3::AdhocAlohaNoackIdealPhyHelper::Install(), ns3::SpectrumAnalyzerHelper::Install(), ns3::WaveformGeneratorHelper::Install(), ns3::WimaxHelper::Install(), ns3::UanHelper::Install(), ns3::GroupMobilityHelper::Install(), ns3::MobilityHelper::Install(), ns3::TvSpectrumTransmitterHelper::Install(), ns3::V4PingHelper::Install(), ns3::V4TraceRouteHelper::Install(), ns3::TvSpectrumTransmitterHelper::InstallAdjacent(), ns3::LteHelper::InstallEnbDevice(), ns3::LteSimpleHelper::InstallEnbDevice(), ns3::LteHelper::InstallUeDevice(), ns3::LteSimpleHelper::InstallUeDevice(), and ns3::AnimationInterface::TrackIpv4Route().
bool ns3::NodeContainer::Contains | ( | uint32_t | id | ) | const |
Return true if container contains a Node with index id.
id | Node Id |
Definition at line 145 of file node-container.cc.
References m_nodes.
void ns3::NodeContainer::Create | ( | uint32_t | n | ) |
Create n nodes and append pointers to them to the end of this NodeContainer.
Nodes are at the heart of any ns-3 simulation. One of the first tasks that any simulation needs to do is to create a number of nodes. This method automates that task.
n | The number of Nodes to create |
Definition at line 98 of file node-container.cc.
References m_nodes.
Referenced by ns3::CsmaStarHelper::CsmaStarHelper(), NodeContainer(), ns3::PointToPointDumbbellHelper::PointToPointDumbbellHelper(), ns3::PointToPointGridHelper::PointToPointGridHelper(), ns3::PointToPointStarHelper::PointToPointStarHelper(), ns3::BriteTopologyHelper::BuildBriteTopology(), VanetRoutingExperiment::ConfigureNodes(), BatteryLifetimeTest::ConstantLoadTest(), AodvExample::CreateNodes(), ChainRegressionTest::CreateNodes(), Bug772ChainTest::CreateNodes(), DsdvManetExample::CreateNodes(), TracerouteExample::CreateNodes(), MeshTest::CreateNodes(), HwmpProactiveRegressionTest::CreateNodes(), HwmpReactiveRegressionTest::CreateNodes(), HwmpSimplestRegressionTest::CreateNodes(), HwmpDoRfRegressionTest::CreateNodes(), PeerManagementProtocolRegressionTest::CreateNodes(), FlameRegressionTest::CreateNodes(), ns3::olsr::Bug780Test::CreateNodes(), ns3::olsr::HelloRegressionTest::CreateNodes(), ns3::olsr::TcRegressionTest::CreateNodes(), BasicEnergyDepletionTest::DepletionTestCase(), LteCellSelectionTestCase::DoRun(), LtePrimaryCellChangeTestCase::DoRun(), LteRadioLinkFailureTestCase::DoRun(), LteSecondaryCellSelectionTestCase::DoRun(), LteUeMeasurementsPiecewiseTestCase1::DoRun(), LteUeMeasurementsPiecewiseTestCase2::DoRun(), LteUeMeasurementsPiecewiseTestCase3::DoRun(), LteUeMeasurementsHandoverTestCase::DoRun(), LteHandoverTargetTestCase::DoRun(), UdpClientServerTestCase::DoRun(), UdpTraceClientServerTestCase::DoRun(), BriteTopologyFunctionTestCase::DoRun(), SameRoomPositionAllocatorTestCase::DoRun(), DhcpTestCase::DoRun(), IcmpEchoReplyTestCase::DoRun(), IcmpTimeExceedTestCase::DoRun(), IcmpV6EchoReplyTestCase::DoRun(), IcmpV6TimeExceedTestCase::DoRun(), Ipv4DynamicGlobalRoutingTestCase::DoRun(), IpAddressHelperTestCasev6::DoRun(), EpcS1uDlTestCase::DoRun(), EpcS1uUlTestCase::DoRun(), CarrierAggregationConfigTestCase::DoRun(), CarrierAggregationTestCase::DoRun(), LenaCqaFfMacSchedulerTestCase1::DoRun(), LenaCqaFfMacSchedulerTestCase2::DoRun(), LteCqiGenerationTestCase::DoRun(), LteCqiGenerationDlPowerControlTestCase::DoRun(), ns3::LenaDeactivateBearerTestCase::DoRun(), LteDownlinkPowerControlTestCase::DoRun(), LteDownlinkPowerControlRrcConnectionReconfigurationTestCase::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(), LteIpv6RoutingTestCase::DoRun(), LteLinkAdaptationTestCase::DoRun(), LenaMimoTestCase::DoRun(), LtePathlossModelSystemTestCase::DoRun(), LenaPfFfMacSchedulerTestCase1::DoRun(), LenaPfFfMacSchedulerTestCase2::DoRun(), LenaDataPhyErrorModelTestCase::DoRun(), LenaDlCtrlPhyErrorModelTestCase::DoRun(), LenaPssFfMacSchedulerTestCase1::DoRun(), LenaPssFfMacSchedulerTestCase2::DoRun(), LteRlcAmE2eTestCase::DoRun(), LteRlcUmE2eTestCase::DoRun(), LenaRrFfMacSchedulerTestCase::DoRun(), LenaTdBetFfMacSchedulerTestCase1::DoRun(), LenaTdBetFfMacSchedulerTestCase2::DoRun(), LenaTdMtFfMacSchedulerTestCase::DoRun(), LenaTdTbfqFfMacSchedulerTestCase1::DoRun(), LenaTdTbfqFfMacSchedulerTestCase2::DoRun(), LenaTtaFfMacSchedulerTestCase::DoRun(), LteUeMeasurementsTestCase::DoRun(), LteUplinkOpenLoopPowerControlTestCase::DoRun(), LteUplinkClosedLoopPowerControlAbsoluteModeTestCase::DoRun(), LteUplinkClosedLoopPowerControlAccumulatedModeTestCase::DoRun(), LteEnbAntennaTestCase::DoRun(), LteEpcE2eDataTestCase::DoRun(), LteHandoverDelayTestCase::DoRun(), LteRrcConnectionEstablishmentTestCase::DoRun(), LteRrcConnectionEstablishmentErrorTestCase::DoRun(), LteX2HandoverMeasuresTestCase::DoRun(), LteX2HandoverTestCase::DoRun(), WaypointMobilityModelViaHelper::DoRun(), MobilityTraceTestCase::DoRun(), NixVectorRoutingTest::DoRun(), SpectrumIdealPhyTestCase::DoRun(), CsmaBridgeTestCase::DoRun(), CsmaBroadcastTestCase::DoRun(), CsmaMulticastTestCase::DoRun(), CsmaPingTestCase::DoRun(), CsmaRawIpSocketTestCase::DoRun(), CsmaStarTestCase::DoRun(), Ns3TcpLossTestCase::DoRun(), Ns3TcpStateTestCase::DoRun(), WifiAcMappingTest::DoRun(), Issue211Test::DoRun(), WifiMsduAggregatorThroughputTest::DoRun(), TcFlowControlTestCase::DoRun(), OcbWifiMacTestCase::DoRun(), WifiChannelSwitchingTest::DoRun(), Ns3WimaxNetworkEntryTestCase::DoRun(), Ns3WimaxManagementConnectionsTestCase::DoRun(), Ns3WimaxSfCreationTestCase::DoRun(), BlockAckAggregationDisabledTest::DoRun(), PreservePacketsInAmpdus::DoRun(), Bug730TestCase::DoRun(), QosFragmentationTestCase::DoRun(), SetChannelFrequencyTest::DoRun(), Bug2222TestCase::DoRun(), Bug2843TestCase::DoRun(), Issue169TestCase::DoRun(), IdealRateManagerChannelWidthTest::DoRun(), IdealRateManagerMimoTest::DoRun(), Ns3WimaxSimpleOFDMTestCase::DoRunOnce(), Ns3WimaxSFTypeTestCase::DoRunOnce(), Ns3WimaxSchedulingTestCase::DoRunOnce(), LinkTest::DoSetup(), LanTest::DoSetup(), TwoLinkTest::DoSetup(), TwoLanTest::DoSetup(), BridgeTest::DoSetup(), TwoBridgeTest::DoSetup(), TestUlOfdmaPowerControl::DoSetup(), WifiPrimaryChannelsTest::DoSetup(), experiment(), ns3::TvSpectrumTransmitterHelper::InstallRandomRegionalTransmitters(), AnimationInterfaceTestCase::PrepareNetwork(), AnimationRemainingEnergyTestCase::PrepareNetwork(), Experiment::Run(), RoutingExperiment::Run(), NetAnimExperiment::Run(), TestInterBssConstantObssPdAlgo::RunOne(), Issue40TestCase::RunOne(), Bug2470TestCase::RunSubtest(), TbfQueueDiscTestCase::RunTbfTest(), StaWifiMacScanningTestCase::Setup(), and BatteryLifetimeTest::VariableLoadTest().
void ns3::NodeContainer::Create | ( | uint32_t | n, |
uint32_t | systemId | ||
) |
Create n nodes with specified systemId for distributed simulations and append pointers to them to the end of this NodeContainer.
Nodes are at the heart of any ns-3 simulation. One of the first tasks that any simulation needs to do is to create a number of nodes. This method automates that task, and adds the ability to specify systemId for distributed simulations.
n | The number of Nodes to create |
systemId | The system id or rank associated with this node |
Definition at line 106 of file node-container.cc.
References m_nodes.
NodeContainer::Iterator ns3::NodeContainer::End | ( | void | ) | const |
Get an iterator which indicates past-the-last Node in the container.
Nodes can be retrieved from the container in two ways. First, directly by an index into the container, and second, using an iterator. This method is used in the iterator method and is typically used in a for-loop to run through the Nodes
Definition at line 82 of file node-container.cc.
References m_nodes.
Referenced by ns3::SameRoomPositionAllocator::SameRoomPositionAllocator(), Add(), ns3::LteHelper::AddX2Interface(), ns3::AodvHelper::AssignStreams(), ns3::OnOffHelper::AssignStreams(), ns3::InternetStackHelper::AssignStreams(), ns3::RipHelper::AssignStreams(), ns3::RipNgHelper::AssignStreams(), ns3::GroupMobilityHelper::AssignStreams(), ns3::MobilityHelper::AssignStreams(), ns3::OlsrHelper::AssignStreams(), ns3::WaveBsmHelper::AssignStreams(), ns3::DistributedSimulatorImpl::CalculateLookAhead(), ns3::NullMessageSimulatorImpl::CalculateLookAhead(), LteCellSelectionTestCase::DoRun(), SameRoomPositionAllocatorTestCase::DoRun(), ns3::MobilityHelper::EnableAscii(), ns3::UanHelper::EnableAscii(), ns3::AsciiTraceHelperForDevice::EnableAsciiImpl(), ns3::AsciiTraceHelperForIpv4::EnableAsciiIpv4Impl(), ns3::AsciiTraceHelperForIpv6::EnableAsciiIpv6Impl(), ns3::AthstatsHelper::EnableAthstats(), ns3::PcapHelperForDevice::EnablePcap(), ns3::PcapHelperForIpv4::EnablePcapIpv4(), ns3::PcapHelperForIpv6::EnablePcapIpv6(), ns3::SameRoomPositionAllocator::GetNext(), ns3::FdNetDeviceHelper::Install(), ns3::CsmaHelper::Install(), ns3::SimpleNetDeviceHelper::Install(), ns3::WaveHelper::Install(), ns3::WifiHelper::Install(), ns3::MeshHelper::Install(), ns3::UdpServerHelper::Install(), ns3::UdpClientHelper::Install(), ns3::UdpTraceClientHelper::Install(), ns3::BuildingsHelper::Install(), ns3::Ping6Helper::Install(), ns3::LrWpanHelper::Install(), ns3::BulkSendHelper::Install(), ns3::OnOffHelper::Install(), ns3::PacketSinkHelper::Install(), ns3::ThreeGppHttpClientHelper::Install(), ns3::ThreeGppHttpServerHelper::Install(), ns3::UdpEchoServerHelper::Install(), ns3::UdpEchoClientHelper::Install(), ns3::EnergySourceHelper::Install(), ns3::InternetStackHelper::Install(), ns3::PacketSocketHelper::Install(), ns3::AdhocAlohaNoackIdealPhyHelper::Install(), ns3::SpectrumAnalyzerHelper::Install(), ns3::WaveformGeneratorHelper::Install(), ns3::WimaxHelper::Install(), ns3::UanHelper::Install(), ns3::GroupMobilityHelper::Install(), ns3::MobilityHelper::Install(), ns3::TvSpectrumTransmitterHelper::Install(), ns3::V4PingHelper::Install(), ns3::V4TraceRouteHelper::Install(), ns3::TvSpectrumTransmitterHelper::InstallAdjacent(), ns3::LteHelper::InstallEnbDevice(), ns3::LteSimpleHelper::InstallEnbDevice(), ns3::LteHelper::InstallUeDevice(), ns3::LteSimpleHelper::InstallUeDevice(), and ns3::AnimationInterface::TrackIpv4Route().
Get the Ptr<Node> stored in this container at a given index.
Nodes can be retrieved from the container in two ways. First, directly by an index into the container, and second, using an iterator. This method is used in the direct method and is used to retrieve the indexed Ptr<Appliation>.
i | the index of the requested node pointer. |
Definition at line 93 of file node-container.cc.
References m_nodes.
Referenced by ns3::CsmaStarHelper::CsmaStarHelper(), ns3::PointToPointDumbbellHelper::PointToPointDumbbellHelper(), ns3::PointToPointGridHelper::PointToPointGridHelper(), ns3::PointToPointStarHelper::PointToPointStarHelper(), Experiment::AssignNeighbors(), ns3::PointToPointStarHelper::BoundingBox(), BuildAppsTest(), AnimationRemainingEnergyTestCase::CheckLogic(), ns3::BriteTopologyHelper::ConstructTopology(), ChainRegressionTest::CreateDevices(), Bug772ChainTest::CreateDevices(), AodvExample::CreateNodes(), TracerouteExample::CreateNodes(), ns3::olsr::Bug780Test::CreateNodes(), ns3::olsr::HelloRegressionTest::CreateNodes(), ns3::olsr::TcRegressionTest::CreateNodes(), ChainRegressionTest::DoRun(), LteCellSelectionTestCase::DoRun(), LteRadioLinkFailureTestCase::DoRun(), LteUeMeasurementsPiecewiseTestCase1::DoRun(), LteUeMeasurementsPiecewiseTestCase2::DoRun(), LteUeMeasurementsPiecewiseTestCase3::DoRun(), LteUeMeasurementsHandoverTestCase::DoRun(), LteHandoverTargetTestCase::DoRun(), UdpClientServerTestCase::DoRun(), UdpTraceClientServerTestCase::DoRun(), BriteTopologyFunctionTestCase::DoRun(), IcmpEchoReplyTestCase::DoRun(), IcmpTimeExceedTestCase::DoRun(), IcmpV6EchoReplyTestCase::DoRun(), IcmpV6TimeExceedTestCase::DoRun(), LinkTest::DoRun(), LanTest::DoRun(), TwoLinkTest::DoRun(), TwoLanTest::DoRun(), BridgeTest::DoRun(), TwoBridgeTest::DoRun(), Ipv4DynamicGlobalRoutingTestCase::DoRun(), IpAddressHelperTestCasev6::DoRun(), EpcS1uDlTestCase::DoRun(), EpcS1uUlTestCase::DoRun(), CarrierAggregationConfigTestCase::DoRun(), CarrierAggregationTestCase::DoRun(), LenaCqaFfMacSchedulerTestCase1::DoRun(), LenaCqaFfMacSchedulerTestCase2::DoRun(), LteCqiGenerationTestCase::DoRun(), ns3::LenaDeactivateBearerTestCase::DoRun(), LenaFdBetFfMacSchedulerTestCase1::DoRun(), LenaFdBetFfMacSchedulerTestCase2::DoRun(), LenaFdMtFfMacSchedulerTestCase::DoRun(), LenaFdTbfqFfMacSchedulerTestCase1::DoRun(), LenaFdTbfqFfMacSchedulerTestCase2::DoRun(), LteStrictFrAreaTestCase::DoRun(), LteSoftFrAreaTestCase::DoRun(), LteSoftFfrAreaTestCase::DoRun(), LteEnhancedFfrAreaTestCase::DoRun(), LteDistributedFfrAreaTestCase::DoRun(), LenaHarqTestCase::DoRun(), LteInterferenceHardFrTestCase::DoRun(), LteInterferenceStrictFrTestCase::DoRun(), LteIpv6RoutingTestCase::DoRun(), LenaMimoTestCase::DoRun(), LtePathlossModelSystemTestCase::DoRun(), LenaPfFfMacSchedulerTestCase1::DoRun(), LenaPfFfMacSchedulerTestCase2::DoRun(), LenaDataPhyErrorModelTestCase::DoRun(), LenaDlCtrlPhyErrorModelTestCase::DoRun(), LenaPssFfMacSchedulerTestCase1::DoRun(), LenaPssFfMacSchedulerTestCase2::DoRun(), LenaRrFfMacSchedulerTestCase::DoRun(), LenaTdBetFfMacSchedulerTestCase1::DoRun(), LenaTdBetFfMacSchedulerTestCase2::DoRun(), LenaTdMtFfMacSchedulerTestCase::DoRun(), LenaTdTbfqFfMacSchedulerTestCase1::DoRun(), LenaTdTbfqFfMacSchedulerTestCase2::DoRun(), LenaTtaFfMacSchedulerTestCase::DoRun(), LteUplinkOpenLoopPowerControlTestCase::DoRun(), LteUplinkClosedLoopPowerControlAbsoluteModeTestCase::DoRun(), LteUplinkClosedLoopPowerControlAccumulatedModeTestCase::DoRun(), LteEpcE2eDataTestCase::DoRun(), LteRrcConnectionEstablishmentErrorTestCase::DoRun(), LteX2HandoverMeasuresTestCase::DoRun(), LteX2HandoverTestCase::DoRun(), WaypointMobilityModelViaHelper::DoRun(), NixVectorRoutingTest::DoRun(), SpectrumIdealPhyTestCase::DoRun(), CsmaBridgeTestCase::DoRun(), CsmaBroadcastTestCase::DoRun(), CsmaMulticastTestCase::DoRun(), CsmaPingTestCase::DoRun(), CsmaRawIpSocketTestCase::DoRun(), CsmaStarTestCase::DoRun(), Ns3TcpLossTestCase::DoRun(), Ns3TcpStateTestCase::DoRun(), WifiAcMappingTest::DoRun(), Issue211Test::DoRun(), WifiMsduAggregatorThroughputTest::DoRun(), TcFlowControlTestCase::DoRun(), OcbWifiMacTestCase::DoRun(), BlockAckAggregationDisabledTest::DoRun(), PreservePacketsInAmpdus::DoRun(), Bug730TestCase::DoRun(), QosFragmentationTestCase::DoRun(), SetChannelFrequencyTest::DoRun(), Bug2222TestCase::DoRun(), TwoLinkTest::DoSetup(), TwoLanTest::DoSetup(), BridgeTest::DoSetup(), TwoBridgeTest::DoSetup(), TestUlOfdmaPowerControl::DoSetup(), WifiPrimaryChannelsTest::DoSetup(), experiment(), Experiment::GenerateNeighbors(), OcbWifiMacTestCase::GetCurrentPosition(), ns3::CsmaStarHelper::GetHub(), ns3::PointToPointStarHelper::GetHub(), ns3::PointToPointDumbbellHelper::GetLeft(), ns3::PointToPointDumbbellHelper::GetRight(), ns3::CsmaStarHelper::GetSpokeNode(), ns3::PointToPointStarHelper::GetSpokeNode(), ns3::PointToPointHelper::Install(), MeshTest::InstallApplication(), AodvExample::InstallApplications(), DsdvManetExample::InstallApplications(), TracerouteExample::InstallApplications(), HwmpProactiveRegressionTest::InstallApplications(), HwmpReactiveRegressionTest::InstallApplications(), HwmpSimplestRegressionTest::InstallApplications(), HwmpDoRfRegressionTest::InstallApplications(), FlameRegressionTest::InstallApplications(), ns3::QKDLinkHelper::InstallQKDControl(), ns3::QKDLinkHelper::InstallQKDEncryptor(), ns3::PointToPointGridHelper::InstallStack(), AnimationInterfaceTestCase::PrepareNetwork(), AnimationRemainingEnergyTestCase::PrepareNetwork(), HwmpReactiveRegressionTest::ResetPosition(), HwmpSimplestRegressionTest::ResetPosition(), Experiment::Run(), RoutingExperiment::Run(), NetAnimExperiment::Run(), TestInterBssConstantObssPdAlgo::RunOne(), Issue40TestCase::RunOne(), TbfQueueDiscTestCase::RunTbfTest(), Experiment::SelectSrcDest(), Experiment::SendMultiDestinations(), WifiChannelSwitchingTest::SendPacket(), ns3::LteHexGridEnbTopologyHelper::SetPositionAndInstallEnbDevice(), and RoutingHelper::SetupRoutingMessages().
|
static |
Create a NodeContainer that contains a list of all nodes created through NodeContainer::Create() and stored in the ns3::NodeList.
Whenever a Node is created, a Ptr<Node> is added to a global list of all nodes in the system. It is sometimes useful to be able to get to all nodes in one place. This method creates a NodeContainer that is initialized to contain all of the simulation nodes,
Definition at line 134 of file node-container.cc.
References Add(), ns3::NodeList::Begin(), and ns3::NodeList::End().
Referenced by ns3::DistributedSimulatorImpl::CalculateLookAhead(), ns3::NullMessageSimulatorImpl::CalculateLookAhead(), ns3::MobilityHelper::EnableAsciiAll(), ns3::UanHelper::EnableAsciiAll(), ns3::AsciiTraceHelperForDevice::EnableAsciiAll(), ns3::AsciiTraceHelperForDevice::EnableAsciiImpl(), ns3::AsciiTraceHelperForIpv4::EnableAsciiIpv4All(), ns3::AsciiTraceHelperForIpv4::EnableAsciiIpv4Impl(), ns3::AsciiTraceHelperForIpv6::EnableAsciiIpv6All(), ns3::AsciiTraceHelperForIpv6::EnableAsciiIpv6Impl(), ns3::PcapHelperForDevice::EnablePcap(), ns3::PcapHelperForDevice::EnablePcapAll(), ns3::PcapHelperForIpv4::EnablePcapIpv4(), ns3::PcapHelperForIpv4::EnablePcapIpv4All(), ns3::PcapHelperForIpv6::EnablePcapIpv6(), ns3::PcapHelperForIpv6::EnablePcapIpv6All(), ns3::MobilityHelper::InstallAll(), ns3::EnergySourceHelper::InstallAll(), and ns3::InternetStackHelper::InstallAll().
uint32_t ns3::NodeContainer::GetN | ( | void | ) | const |
Get the number of Ptr<Node> stored in this container.
Nodes can be retrieved from the container in two ways. First, directly by an index into the container, and second, using an iterator. This method is used in the direct method and is typically used to define an ending condition in a for-loop that runs through the stored Nodes
Definition at line 88 of file node-container.cc.
References m_nodes.
Referenced by ns3::CsmaStarHelper::CsmaStarHelper(), ns3::PointToPointStarHelper::PointToPointStarHelper(), ns3::CsmaStarHelper::AssignIpv4Addresses(), ns3::PointToPointStarHelper::AssignIpv4Addresses(), ns3::CsmaStarHelper::AssignIpv6Addresses(), ns3::PointToPointStarHelper::AssignIpv6Addresses(), Experiment::AssignNeighbors(), ns3::PointToPointStarHelper::BoundingBox(), LteCellSelectionTestCase::DoRun(), LteUeMeasurementsHandoverTestCase::DoRun(), LteHandoverTargetTestCase::DoRun(), EpcS1uDlTestCase::DoRun(), EpcS1uUlTestCase::DoRun(), CarrierAggregationConfigTestCase::DoRun(), LenaCqaFfMacSchedulerTestCase1::DoRun(), LenaCqaFfMacSchedulerTestCase2::DoRun(), ns3::LenaDeactivateBearerTestCase::DoRun(), LenaFdTbfqFfMacSchedulerTestCase1::DoRun(), LenaFdTbfqFfMacSchedulerTestCase2::DoRun(), LteDistributedFfrAreaTestCase::DoRun(), LteIpv6RoutingTestCase::DoRun(), LenaPssFfMacSchedulerTestCase1::DoRun(), LenaPssFfMacSchedulerTestCase2::DoRun(), LenaTdTbfqFfMacSchedulerTestCase1::DoRun(), LenaTdTbfqFfMacSchedulerTestCase2::DoRun(), LteEpcE2eDataTestCase::DoRun(), LteX2HandoverMeasuresTestCase::DoRun(), LteX2HandoverTestCase::DoRun(), CsmaStarTestCase::DoRun(), ns3::PointToPointHelper::Install(), ns3::QKDLinkHelper::InstallQKDControl(), ns3::QKDLinkHelper::InstallQKDEncryptor(), ns3::PointToPointGridHelper::InstallStack(), ns3::PointToPointDumbbellHelper::LeftCount(), ns3::PointToPointDumbbellHelper::RightCount(), NetAnimExperiment::Run(), Experiment::Run(), Experiment::SelectSrcDest(), Experiment::SendMultiDestinations(), ns3::LteHexGridEnbTopologyHelper::SetPositionAndInstallEnbDevice(), ns3::CsmaStarHelper::SpokeCount(), ns3::PointToPointStarHelper::SpokeCount(), and ns3::AnimationInterface::TrackIpv4Route().
Nodes smart pointers.
Definition at line 314 of file node-container.h.
Referenced by NodeContainer(), Add(), Begin(), Contains(), Create(), End(), Get(), and GetN().