A Discrete-Event Network Simulator
API
Configuration

Configuration of simulation parameters and tracing. More...

+ Collaboration diagram for Configuration:

Files

file  config-test-suite.cc
 Config test suite.
 
file  config.cc
 ns3::Config implementations.
 
file  config.h
 Declaration of the various ns3::Config functions and classes.
 
file  names-test-suite.cc
 Object Names test suite.
 
file  names.cc
 ns3::Names, ns3::NamesNode and ns3::NamePriv implementations.
 
file  names.h
 Declaration of class ns3::Names.
 

Namespaces

 ns3::Config
 Namespace for the various functions implementing the Config system.
 

Classes

class  ns3::Config::MatchContainer
 hold a set of objects which match a specific search string. More...
 
class  ns3::NameNode
 Node in the naming tree. More...
 
class  ns3::Names
 A directory of name and Ptr<Object> associations that allows us to give any ns3 Object a name. More...
 
class  ns3::NamesPriv
 The singleton root Names object. More...
 

Functions

void ns3::Config::Connect (std::string path, const CallbackBase &cb)
 
void ns3::Config::ConnectWithoutContext (std::string path, const CallbackBase &cb)
 
void ns3::Config::Disconnect (std::string path, const CallbackBase &cb)
 
void ns3::Config::DisconnectWithoutContext (std::string path, const CallbackBase &cb)
 
Ptr< Object > ns3::Config::GetRootNamespaceObject (uint32_t i)
 
std::size_t ns3::Config::GetRootNamespaceObjectN (void)
 
MatchContainer ns3::Config::LookupMatches (std::string path)
 
void ns3::Config::RegisterRootNamespaceObject (Ptr< Object > obj)
 
void ns3::Config::Reset (void)
 Reset the initial value of every attribute as well as the value of every global to what they were before any call to SetDefault and SetGlobal. More...
 
void ns3::Config::Set (std::string path, const AttributeValue &value)
 
void ns3::Config::SetDefault (std::string name, const AttributeValue &value)
 
bool ns3::Config::SetDefaultFailSafe (std::string name, const AttributeValue &value)
 
void ns3::Config::SetGlobal (std::string name, const AttributeValue &value)
 
bool ns3::Config::SetGlobalFailSafe (std::string name, const AttributeValue &value)
 
void ns3::Config::UnregisterRootNamespaceObject (Ptr< Object > obj)
 

Detailed Description

Configuration of simulation parameters and tracing.

Function Documentation

void ns3::Config::Connect ( std::string  path,
const CallbackBase cb 
)
Parameters
[in]pathA path to match trace sources.
[in]cbThe callback to connect to the matching trace sources.

This function will attempt to find all trace sources which match the input path and will then connect the input callback to them in such a way that the callback will receive an extra context string upon trace event notification.

Definition at line 843 of file config.cc.

References ns3::Singleton< ConfigImpl >::Get(), and NS_LOG_FUNCTION.

Referenced by ns3::LteHelper::ActivateDataRadioBearer(), ns3::QKDGraphManager::AddBuffer(), AdvancePosition(), ns3::TcpSocketBase::CheckEcnCe(), VanetRoutingExperiment::ConfigureApplications(), VanetRoutingExperiment::ConfigureDevices(), ns3::AnimationInterface::ConnectCallbacks(), ns3::RadioBearerStatsConnector::ConnectSrb0Traces(), ns3::RadioBearerStatsConnector::ConnectSrb1TracesUe(), ns3::RadioBearerStatsConnector::ConnectTracesEnb(), ns3::RadioBearerStatsConnector::ConnectTracesUe(), CourseChange(), CourseChangeCallback(), Ns3TcpNoDelayTestCase::DoRun(), Ns3TcpSocketTestCase1::DoRun(), NscTcpLossTestCase1::DoRun(), LteRrcConnectionEstablishmentTestCase::DoRun(), LteLinkAdaptationTestCase::DoRun(), LteSecondaryCellSelectionTestCase::DoRun(), SpectrumIdealPhyTestCase::DoRun(), Ns3TcpLossTestCase::DoRun(), Ns3TcpStateTestCase::DoRun(), LteEnbAntennaTestCase::DoRun(), CarrierAggregationTestCase::DoRun(), LteHandoverDelayTestCase::DoRun(), LteCqiGenerationTestCase::DoRun(), LteInterferenceTestCase::DoRun(), CarrierAggregationConfigTestCase::DoRun(), Ns3TcpInteroperabilityTestCase::DoRun(), LteUeMeasurementsTestCase::DoRun(), LteCellSelectionTestCase::DoRun(), LteHandoverTargetTestCase::DoRun(), LteCqiGenerationDlPowerControlTestCase::DoRun(), Ns3TcpSocketTestCase2::DoRun(), NscTcpLossTestCase2::DoRun(), LteDownlinkPowerControlRrcConnectionReconfigurationTestCase::DoRun(), LteUeMeasurementsPiecewiseTestCase1::DoRun(), Ns2MobilityHelperTest::DoRun(), LteUeMeasurementsPiecewiseTestCase2::DoRun(), LteUeMeasurementsHandoverTestCase::DoRun(), Bug730TestCase::DoRun(), LteRrcConnectionEstablishmentErrorTestCase::DoRun(), CsmaPacketSocketTestCase::DoRun(), ns3::tests::ObjectVectorTraceConfigTestCase::DoRun(), CsmaPingTestCase::DoRun(), Bug2222TestCase::DoRun(), Bug2483TestCase::DoRun(), Bug2831TestCase::DoRun(), ns3::UanHelper::EnableAscii(), ns3::WimaxHelper::EnableAsciiForConnection(), ns3::YansWavePhyHelper::EnableAsciiInternal(), ns3::FdNetDeviceHelper::EnableAsciiInternal(), ns3::PointToPointHelper::EnableAsciiInternal(), ns3::WifiPhyHelper::EnableAsciiInternal(), ns3::CsmaHelper::EnableAsciiInternal(), ns3::QKDHelper::EnableAsciiInternal(), ns3::WimaxHelper::EnableAsciiInternal(), ns3::InternetStackHelper::EnableAsciiIpv4Internal(), ns3::InternetStackHelper::EnableAsciiIpv6Internal(), ns3::AthstatsHelper::EnableAthstats(), ns3::LteHelper::EnableDlMacTraces(), ns3::LteHelper::EnableDlPhyTraces(), ns3::LteHelper::EnableDlRxPhyTraces(), ns3::LteHelper::EnableDlTxPhyTraces(), ns3::LteHelper::EnableUlMacTraces(), ns3::LteHelper::EnableUlPhyTraces(), ns3::LteHelper::EnableUlRxPhyTraces(), ns3::LteHelper::EnableUlTxPhyTraces(), ns3::RadioBearerStatsConnector::EnsureConnected(), NotifyHandoverEndOkEnb(), PhyStateTrace(), PingRtt(), OcbWifiMacTestCase::PostDeviceConfiguration(), GlobalPathlossDatabase::Print(), ns3::PyViz::PyViz(), RateCallback(), Ratio(), ns3::PyViz::RegisterCsmaLikeDevice(), ns3::PyViz::RegisterDropTracePath(), ns3::PyViz::RegisterPointToPointLikeDevice(), ns3::PyViz::RegisterWifiLikeDevice(), RxEvent(), StaWifiMacScanningTestCase::Setup(), VanetRoutingExperiment::SetupAdhocMobilityNodes(), SetupPacketReceive(), SinkRx(), TxCallback(), and WifiInterferenceTestCase::WifiSimpleInterference().

+ Here is the call graph for this function:

void ns3::Config::ConnectWithoutContext ( std::string  path,
const CallbackBase cb 
)
Parameters
[in]pathA path to match trace sources.
[in]cbThe callback to connect to the matching trace sources.

This function will attempt to find all trace sources which match the input path and will then connect the input callback to them.

Definition at line 832 of file config.cc.

References ns3::Singleton< ConfigImpl >::Get(), and NS_LOG_FUNCTION.

Referenced by ChangeSignalAndReportRate(), ns3::Uinteger16Probe::ConnectByPath(), ns3::Uinteger32Probe::ConnectByPath(), ns3::Uinteger8Probe::ConnectByPath(), ns3::PacketProbe::ConnectByPath(), ns3::BooleanProbe::ConnectByPath(), ns3::DoubleProbe::ConnectByPath(), ns3::TimeProbe::ConnectByPath(), ns3::ApplicationPacketProbe::ConnectByPath(), ns3::Ipv4PacketProbe::ConnectByPath(), ns3::Ipv6PacketProbe::ConnectByPath(), ns3::AnimationInterface::ConnectCallbacks(), CwndTracer(), CsmaBridgeTestCase::DoRun(), Ns3TcpLossTestCase::DoRun(), CsmaBroadcastTestCase::DoRun(), CsmaMulticastTestCase::DoRun(), CsmaOneSubnetTestCase::DoRun(), ns3::tests::ObjectVectorTraceConfigTestCase::DoRun(), CsmaPingTestCase::DoRun(), CsmaRawIpSocketTestCase::DoRun(), CsmaStarTestCase::DoRun(), ns3::MobilityHelper::EnableAscii(), ns3::YansWavePhyHelper::EnableAsciiInternal(), ns3::WifiPhyHelper::EnableAsciiInternal(), ns3::SpectrumAnalyzerHelper::Install(), ns3::Ipv4FlowProbe::Ipv4FlowProbe(), ns3::Ipv6FlowProbe::Ipv6FlowProbe(), MonitorSniffRx(), PingRtt(), SinkRx(), SojournTimeTrace(), static_SpectrumModelWifi5180MHz_initializer::static_SpectrumModelWifi5180MHz_initializer(), TraceCwnd(), TraceDroppingState(), TraceEveryDrop(), TraceInFlight(), TraceNextRx(), TraceNextTx(), TraceQueueLength(), TraceRto(), TraceRtt(), TraceSojourn(), and TraceSsThresh().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::Config::Disconnect ( std::string  path,
const CallbackBase cb 
)
Parameters
[in]pathA path to match trace sources.
[in]cbThe callback to connect to the matching trace sources.

This function undoes the work of Config::ConnectWithContext.

Definition at line 849 of file config.cc.

References ns3::Singleton< ConfigImpl >::Get(), and NS_LOG_FUNCTION.

Referenced by ns3::RadioBearerStatsConnector::ConnectSrb0Traces().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::Config::DisconnectWithoutContext ( std::string  path,
const CallbackBase cb 
)
Parameters
[in]pathA path to match trace sources.
[in]cbThe callback to disconnect to the matching trace sources.

This function undoes the work of Config::Connect.

Definition at line 837 of file config.cc.

References ns3::Singleton< ConfigImpl >::Get(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

Ptr< Object > ns3::Config::GetRootNamespaceObject ( uint32_t  i)
Parameters
[in]iThe index of the requested object.
Returns
The requested root namespace object

Definition at line 878 of file config.cc.

References ns3::Singleton< ConfigImpl >::Get(), and NS_LOG_FUNCTION.

Referenced by GetTypicalAggregations(), and ns3::AttributeIterator::Iterate().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::size_t ns3::Config::GetRootNamespaceObjectN ( void  )
Returns
The number of registered root namespace objects.

Definition at line 872 of file config.cc.

References ns3::Singleton< ConfigImpl >::Get(), and NS_LOG_FUNCTION_NOARGS.

Referenced by GetTypicalAggregations(), and ns3::AttributeIterator::Iterate().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::Config::RegisterRootNamespaceObject ( Ptr< Object obj)
void ns3::Config::Reset ( void  )

Reset the initial value of every attribute as well as the value of every global to what they were before any call to SetDefault and SetGlobal.

Definition at line 757 of file config.cc.

References ns3::GlobalValue::Begin(), ns3::GlobalValue::End(), ns3::TypeId::GetAttribute(), ns3::TypeId::GetAttributeN(), ns3::TypeId::GetRegistered(), ns3::TypeId::GetRegisteredN(), NS_LOG_FUNCTION_NOARGS, ns3::TypeId::AttributeInformation::originalInitialValue, and ns3::TypeId::SetAttributeInitialValue().

Referenced by LteRrcConnectionEstablishmentTestCase::DoRun(), LteInterferenceHardFrTestCase::DoRun(), LteLinkAdaptationTestCase::DoRun(), LteEnbAntennaTestCase::DoRun(), LteCqiGenerationTestCase::DoRun(), LteX2HandoverTestCase::DoRun(), LteInterferenceStrictFrTestCase::DoRun(), LteDownlinkPowerControlTestCase::DoRun(), LteX2HandoverMeasuresTestCase::DoRun(), LteEpcE2eDataTestCase::DoRun(), LteHardFrTestCase::DoRun(), LteCqiGenerationDlPowerControlTestCase::DoRun(), LteUplinkOpenLoopPowerControlTestCase::DoRun(), LteUplinkClosedLoopPowerControlAbsoluteModeTestCase::DoRun(), LteDownlinkPowerControlRrcConnectionReconfigurationTestCase::DoRun(), LteStrictFrTestCase::DoRun(), LteUplinkClosedLoopPowerControlAccumulatedModeTestCase::DoRun(), LteStrictFrAreaTestCase::DoRun(), LteSoftFrAreaTestCase::DoRun(), LteSoftFfrAreaTestCase::DoRun(), LteEnhancedFfrAreaTestCase::DoRun(), LteDistributedFfrAreaTestCase::DoRun(), LteRrcConnectionEstablishmentErrorTestCase::DoRun(), NetworkNumberAllocatorTestCase::DoTeardown(), NetworkNumber6AllocatorTestCase::DoTeardown(), NetworkAllocatorHelperTestCase::DoTeardown(), IpAddressHelperTestCasev6::DoTeardown(), AddressAllocator6TestCase::DoTeardown(), AddressAllocatorHelperTestCase::DoTeardown(), AddressAllocatorTestCase::DoTeardown(), ResetAllocatorHelperTestCase::DoTeardown(), NetworkAndAddress6TestCase::DoTeardown(), NetworkAndAddressTestCase::DoTeardown(), ExampleAddress6GeneratorTestCase::DoTeardown(), IpAddressHelperTestCasev4::DoTeardown(), ExampleAddressGeneratorTestCase::DoTeardown(), AddressCollision6TestCase::DoTeardown(), and AddressCollisionTestCase::DoTeardown().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::Config::SetDefault ( std::string  name,
const AttributeValue value 
)
Parameters
[in]nameThe full name of the attribute
[in]valueThe value to set.

This method overrides the initial value of the matching attribute. This method cannot fail: it will crash if the input attribute name or value is invalid.

Definition at line 782 of file config.cc.

References NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::Config::SetDefaultFailSafe().

Referenced by AodvqRegressionTestSuite::AodvqRegressionTestSuite(), BuildAppsTest(), CalculateThroughput(), ChangeSignalAndReportRate(), VanetRoutingExperiment::ConfigureDefaults(), TcpBytesInFlightTest::ConfigureEnvironment(), BatteryLifetimeTest::ConstantLoadTest(), CourseChange(), CourseChangeCallback(), CreateOnOffFlow(), ns3::RawTextConfigLoad::Default(), ns3::XmlConfigLoad::Default(), BasicEnergyDepletionTest::DepletionTestCase(), RttEstimatorTestCase::DoRun(), FriisPropagationLossModelTestCase::DoRun(), ns3::LenaDeactivateBearerTestCase::DoRun(), ns3::tests::OneUniformRandomVariableManyGetValueCallsTestCase::DoRun(), ns3::tests::ManyUniformRandomVariablesOneGetValueCallTestCase::DoRun(), Ns3TcpNoDelayTestCase::DoRun(), LenaMimoTestCase::DoRun(), LenaHarqTestCase::DoRun(), LenaRrFfMacSchedulerTestCase::DoRun(), LenaDataPhyErrorModelTestCase::DoRun(), LteRlcAmE2eTestCase::DoRun(), LenaPfFfMacSchedulerTestCase1::DoRun(), LteRrcConnectionEstablishmentTestCase::DoRun(), LenaTdBetFfMacSchedulerTestCase1::DoRun(), LenaTdMtFfMacSchedulerTestCase::DoRun(), LenaCqaFfMacSchedulerTestCase1::DoRun(), LenaTtaFfMacSchedulerTestCase::DoRun(), LenaFdBetFfMacSchedulerTestCase1::DoRun(), LenaFdMtFfMacSchedulerTestCase::DoRun(), LenaPssFfMacSchedulerTestCase1::DoRun(), LenaTdTbfqFfMacSchedulerTestCase1::DoRun(), LteDownlinkDataSinrTestCase::DoRun(), LteInterferenceHardFrTestCase::DoRun(), LteLinkAdaptationTestCase::DoRun(), LenaFdTbfqFfMacSchedulerTestCase1::DoRun(), LtePathlossModelSystemTestCase::DoRun(), Bug772ChainTest::DoRun(), Ns3TcpLossTestCase::DoRun(), Ns3TcpStateTestCase::DoRun(), CarrierAggregationTestCase::DoRun(), LteEnbAntennaTestCase::DoRun(), LteCqiGenerationTestCase::DoRun(), LteX2HandoverTestCase::DoRun(), LteInterferenceTestCase::DoRun(), CarrierAggregationConfigTestCase::DoRun(), LteInterferenceStrictFrTestCase::DoRun(), LenaPfFfMacSchedulerTestCase2::DoRun(), LteDownlinkCtrlSinrTestCase::DoRun(), LenaTdBetFfMacSchedulerTestCase2::DoRun(), LenaDlCtrlPhyErrorModelTestCase::DoRun(), LteUeMeasurementsTestCase::DoRun(), LenaFdBetFfMacSchedulerTestCase2::DoRun(), LenaTdTbfqFfMacSchedulerTestCase2::DoRun(), EpcS1uDlTestCase::DoRun(), LenaPssFfMacSchedulerTestCase2::DoRun(), LenaCqaFfMacSchedulerTestCase2::DoRun(), LteDownlinkPowerControlTestCase::DoRun(), LenaFdTbfqFfMacSchedulerTestCase2::DoRun(), Ipv4FragmentationTest::DoRun(), LteX2HandoverMeasuresTestCase::DoRun(), LteEpcE2eDataTestCase::DoRun(), LteHandoverTargetTestCase::DoRun(), LteHardFrTestCase::DoRun(), LteCqiGenerationDlPowerControlTestCase::DoRun(), TwoRayGroundPropagationLossModelTestCase::DoRun(), LteUplinkOpenLoopPowerControlTestCase::DoRun(), Ns3TcpSocketTestCase2::DoRun(), LteUplinkClosedLoopPowerControlAbsoluteModeTestCase::DoRun(), LteDownlinkPowerControlRrcConnectionReconfigurationTestCase::DoRun(), LteStrictFrTestCase::DoRun(), LteUplinkClosedLoopPowerControlAccumulatedModeTestCase::DoRun(), ChainRegressionTest::DoRun(), LteUeMeasurementsPiecewiseTestCase1::DoRun(), LogDistancePropagationLossModelTestCase::DoRun(), CsmaMulticastTestCase::DoRun(), LteStrictFrAreaTestCase::DoRun(), LteSoftFrAreaTestCase::DoRun(), EpcS1uUlTestCase::DoRun(), LteUeMeasurementsPiecewiseTestCase2::DoRun(), LteSoftFfrAreaTestCase::DoRun(), AttributeTestCase< T >::DoRun(), LteEnhancedFfrAreaTestCase::DoRun(), LteDistributedFfrAreaTestCase::DoRun(), Ns3TcpCwndTestCase2::DoRun(), RangePropagationLossModelTestCase::DoRun(), LteUeMeasurementsHandoverTestCase::DoRun(), Bug730TestCase::DoRun(), LteRrcConnectionEstablishmentErrorTestCase::DoRun(), CsmaPingTestCase::DoRun(), CsmaRawIpSocketTestCase::DoRun(), Ipv4DynamicGlobalRoutingTestCase::DoRun(), Bug2483TestCase::DoRun(), Ns3TcpLossTestCase::DoSetup(), experiment(), Experiment::GenerateTraffic(), GenerateTraffic(), LteAggregationThroughputScaleTestCase::GetThroughput(), ConfigStoreHelper::LoadConfig(), modify(), MonitorSniffRx(), JakesPropagationExample::Next(), NotifyHandoverEndOkEnb(), PingRtt(), PrintAttributesIfEnabled(), PrintGnuplottableEnbListToFile(), ReceivePacket(), RoutingExperiment::Run(), Experiment::Run(), InterferenceExperiment::Run(), TbfQueueDiscTestCase::RunTbfTest(), ConfigStoreHelper::SaveConfig(), SecondBucketTokensTrace(), SinkRx(), SojournTimeTrace(), static_SpectrumModelWifi5180MHz_initializer::static_SpectrumModelWifi5180MHz_initializer(), TearDownLink(), TestDeterministicByTime(), TotalEnergy(), TotalEnergyHarvested(), TraceCwnd(), TraceNextRx(), Tunnel::Tunnel(), BatteryLifetimeTest::VariableLoadTest(), and WifiInterferenceTestCase::WifiSimpleInterference().

+ Here is the call graph for this function:

bool ns3::Config::SetDefaultFailSafe ( std::string  name,
const AttributeValue value 
)
Parameters
[in]nameThe full name of the attribute
[in]valueThe value to set.
Returns
true if the value was set successfully, false otherwise.

This method overrides the initial value of the matching attribute.

Definition at line 790 of file config.cc.

References ns3::TypeId::AttributeInformation::checker, ns3::TypeId::GetAttribute(), ns3::TypeId::GetAttributeN(), ns3::TypeId::LookupByNameFailSafe(), ns3::TypeId::AttributeInformation::name, NS_LOG_FUNCTION, and ns3::TypeId::SetAttributeInitialValue().

Referenced by ns3::cell_edited_callback_config_default(), AttributeTestCase< T >::DoRun(), ns3::CommandLine::HandleArgument(), ns3::CommandLine::HandleAttribute(), and ns3::Config::SetDefault().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::Config::SetGlobal ( std::string  name,
const AttributeValue value 
)
bool ns3::Config::SetGlobalFailSafe ( std::string  name,
const AttributeValue value 
)
Parameters
[in]nameThe name of the requested GlobalValue.
[in]valueThe value to set
Returns
true if the GlobalValue could be set.

This method is equivalent to GlobalValue::BindFailSafe

Definition at line 827 of file config.cc.

References ns3::GlobalValue::BindFailSafe(), and NS_LOG_FUNCTION.

Referenced by ns3::CommandLine::HandleArgument(), and ns3::CommandLine::HandleAttribute().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::Config::UnregisterRootNamespaceObject ( Ptr< Object obj)
Parameters
[in]objA new root object

This function undoes the work of Config::RegisterRootNamespaceObject.

Definition at line 866 of file config.cc.

References ns3::Singleton< ConfigImpl >::Get(), and NS_LOG_FUNCTION.

Referenced by ns3::BuildingListPriv::Delete(), ns3::ChannelListPriv::Delete(), and ns3::NodeListPriv::Delete().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: