A Discrete-Event Network Simulator
API
Public Member Functions | Private Attributes | Friends | List of all members
ns3::ObjectFactory Class Reference

Instantiate subclasses of ns3::Object. More...

#include "object-factory.h"

Public Member Functions

 ObjectFactory ()
 Default constructor. More...
 
 ObjectFactory (std::string typeId)
 Construct a factory for a specific TypeId by name. More...
 
Ptr< ObjectCreate (void) const
 Create an Object instance of the configured TypeId. More...
 
template<typename T >
Ptr< T > Create (void) const
 Create an Object instance of the requested type. More...
 
TypeId GetTypeId (void) const
 Get the TypeId which will be created by this ObjectFactory. More...
 
void Set (std::string name, const AttributeValue &value)
 Set an attribute to be set during construction. More...
 
void SetTypeId (TypeId tid)
 Set the TypeId of the Objects to be created by this factory. More...
 
void SetTypeId (const char *tid)
 Set the TypeId of the Objects to be created by this factory. More...
 
void SetTypeId (std::string tid)
 Set the TypeId of the Objects to be created by this factory. More...
 

Private Attributes

AttributeConstructionList m_parameters
 The list of attributes and values to be used in constructing objects by this factory. More...
 
TypeId m_tid
 The TypeId this factory will create. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const ObjectFactory &factory)
 Print the factory configuration on an output stream. More...
 
std::istream & operator>> (std::istream &is, ObjectFactory &factory)
 Read a factory configuration from an input stream. More...
 

Detailed Description

Instantiate subclasses of ns3::Object.

This class can also hold a set of attributes to set automatically during the object construction.

See also
ObjectFactory Attribute

Definition at line 47 of file object-factory.h.

Constructor & Destructor Documentation

◆ ObjectFactory() [1/2]

ns3::ObjectFactory::ObjectFactory ( )

Default constructor.

This factory is not capable of constructing a real Object until it has at least a TypeId.

Definition at line 34 of file object-factory.cc.

References NS_LOG_FUNCTION.

◆ ObjectFactory() [2/2]

ns3::ObjectFactory::ObjectFactory ( std::string  typeId)

Construct a factory for a specific TypeId by name.

Parameters
[in]typeIdThe name of the TypeId this factory should create.

Definition at line 39 of file object-factory.cc.

References NS_LOG_FUNCTION, and SetTypeId().

Member Function Documentation

◆ Create() [1/2]

Ptr< Object > ns3::ObjectFactory::Create ( void  ) const

Create an Object instance of the configured TypeId.

Returns
A new object instance.

Definition at line 95 of file object-factory.cc.

References ns3::Object::Construct(), ns3::TypeId::GetConstructor(), m_parameters, m_tid, NS_ASSERT, NS_LOG_FUNCTION, and ns3::Object::SetTypeId().

Referenced by ns3::GnuplotHelper::AddProbe(), ns3::FileHelper::AddProbe(), ns3::SpectrumChannelHelper::AddPropagationLoss(), ns3::SpectrumChannelHelper::AddSpectrumPropagationLoss(), ns3::LteUeRrc::ApplyRadioResourceConfigDedicated(), ns3::LteHelper::ChannelModelInitialization(), ns3::PfifoFastQueueDisc::CheckConfig(), ns3::PrioQueueDisc::CheckConfig(), ns3::TbfQueueDisc::CheckConfig(), PowerRateAdaptationTest::ConfigureNode(), ns3::AodvHelper::Create(), ns3::DsdvHelper::Create(), ns3::Ipv4NixVectorHelper::Create(), ns3::GridBuildingAllocator::Create(), ns3::RipHelper::Create(), ns3::RipNgHelper::Create(), ns3::SpectrumWifiPhyHelper::Create(), ns3::OlsrHelper::Create(), ns3::DsrHelper::Create(), Create(), ns3::WifiMacHelper::Create(), ns3::YansWifiChannelHelper::Create(), ns3::YansWifiPhyHelper::Create(), ns3::SpectrumChannelHelper::Create(), ns3::SpectrumPhyHelper::Create(), ns3::InternetStackHelper::CreateAndAggregateObjectFromTypeId(), ns3::MeshHelper::CreateInterface(), UanTest::CreateNode(), ns3::CreateObjectWithAttributes(), WifiTest::CreateOne(), InterferenceHelperSequenceTest::CreateOne(), ns3::TcpOption::CreateOption(), ns3::QueueDiscFactory::CreateQueueDisc(), ns3::TcpL4Protocol::CreateSocket(), ns3::TcpGeneralTest::CreateSocket(), ns3::FqCoDelQueueDisc::DoEnqueue(), ns3::RvBatteryModelHelper::DoInstall(), ns3::BasicEnergySourceHelper::DoInstall(), ns3::BasicEnergyHarvesterHelper::DoInstall(), ns3::LiIonEnergySourceHelper::DoInstall(), ns3::AcousticModemEnergyModelHelper::DoInstall(), ns3::WifiRadioEnergyModelHelper::DoInstall(), BasicEnergyHarvesterTestCase::DoRun(), AmpduAggregationTest::DoRun(), SteadyStateRandomWaypointTest::DoRun(), WaypointMobilityModelNotifyTest::DoRun(), WaypointMobilityModelAddWaypointTest::DoRun(), InterferenceHelperSequenceTest::DoRun(), TwoLevelAggregationTest::DoRun(), ns3::tests::ObjectFactoryTestCase::DoRun(), DcfImmediateAccessBroadcastTestCase::DoRun(), PointerAttributeTestCase::DoRun(), Bug2831TestCase::DoRun(), ns3::GetImpl(), ns3::FlowMonitorHelper::GetMonitor(), ns3::BridgeHelper::Install(), ns3::Ping6Helper::Install(), ns3::UdpServerHelper::Install(), ns3::EnergyHarvesterHelper::Install(), ns3::EnergySourceHelper::Install(), ns3::TapBridgeHelper::Install(), ns3::SixLowPanHelper::Install(), ns3::RadvdHelper::Install(), ns3::CsmaHelper::Install(), ns3::PointToPointHelper::Install(), ns3::WaveformGeneratorHelper::Install(), ns3::TvSpectrumTransmitterHelper::Install(), ns3::AdhocAlohaNoackIdealPhyHelper::Install(), ns3::SpectrumAnalyzerHelper::Install(), ns3::SimpleNetDeviceHelper::Install(), ns3::UdpClientHelper::Install(), ns3::InternetStackHelper::Install(), ns3::MobilityHelper::Install(), ns3::UdpTraceClientHelper::Install(), ns3::WaveHelper::Install(), ns3::UanHelper::Install(), ns3::WifiHelper::Install(), ns3::TrafficControlHelper::Install(), ns3::TvSpectrumTransmitterHelper::InstallAdjacent(), ns3::DhcpHelper::InstallDhcpClientPriv(), ns3::DhcpHelper::InstallDhcpServer(), ns3::V4PingHelper::InstallPriv(), ns3::PacketSinkHelper::InstallPriv(), ns3::ThreeGppHttpClientHelper::InstallPriv(), ns3::UdpEchoServerHelper::InstallPriv(), ns3::FdNetDeviceHelper::InstallPriv(), ns3::BulkSendHelper::InstallPriv(), ns3::OnOffHelper::InstallPriv(), ns3::WaveBsmHelper::InstallPriv(), ns3::ThreeGppHttpServerHelper::InstallPriv(), ns3::SimpleNetDeviceHelper::InstallPriv(), ns3::CsmaHelper::InstallPriv(), ns3::UdpEchoClientHelper::InstallPriv(), ns3::LteSimpleHelper::InstallSingleEnbDevice(), ns3::LteHelper::InstallSingleEnbDevice(), ns3::LteSimpleHelper::InstallSingleUeDevice(), ns3::LteHelper::InstallSingleUeDevice(), ns3::VisualSimulatorImpl::NotifyConstructionCompleted(), RoutingExperiment::Run(), WifiTest::RunOne(), ns3::MobilityHelper::SetPositionAllocator(), ns3::NullMessageSimulatorImpl::SetScheduler(), ns3::DefaultSimulatorImpl::SetScheduler(), ns3::RealtimeSimulatorImpl::SetScheduler(), ns3::DistributedSimulatorImpl::SetScheduler(), ns3::MeshHelper::SetStackInstaller(), VanetRoutingExperiment::SetupAdhocMobilityNodes(), ns3::UeManager::SetupDataRadioBearer(), and DsdvManetExample::SetupMobility().

◆ Create() [2/2]

template<typename T >
Ptr< T > ns3::ObjectFactory::Create ( void  ) const

Create an Object instance of the requested type.

This method performs an extra call to ns3::Object::GetObject before returning a pointer of the requested type to the user. This method is really syntactical sugar.

Template Parameters
T[explicit] The requested Object type.
Returns
A new object instance.

Definition at line 198 of file object-factory.h.

References Create().

◆ GetTypeId()

TypeId ns3::ObjectFactory::GetTypeId ( void  ) const

◆ Set()

void ns3::ObjectFactory::Set ( std::string  name,
const AttributeValue value 
)

Set an attribute to be set during construction.

Parameters
[in]nameThe name of the attribute to set.
[in]valueThe value of the attribute to set.

Definition at line 64 of file object-factory.cc.

References ns3::AttributeConstructionList::Add(), ns3::TypeId::AttributeInformation::checker, ns3::AttributeValue::Copy(), ns3::TypeId::GetName(), ns3::TypeId::LookupAttributeByName(), m_parameters, m_tid, NS_FATAL_ERROR, and NS_LOG_FUNCTION.

Referenced by ns3::TrafficControlHelper::AddInternalQueues(), ns3::YansWifiChannelHelper::AddPropagationLoss(), ns3::SpectrumChannelHelper::AddPropagationLoss(), ns3::SpectrumChannelHelper::AddSpectrumPropagationLoss(), ns3::BulkSendHelper::BulkSendHelper(), ns3::PfifoFastQueueDisc::CheckConfig(), ns3::GridBuildingAllocator::Create(), ns3::CreateObjectWithAttributes(), UanTest::DoPhyTests(), SteadyStateRandomWaypointTest::DoRun(), AmpduAggregationTest::DoRun(), WaypointMobilityModelNotifyTest::DoRun(), WaypointMobilityModelAddWaypointTest::DoRun(), TwoLevelAggregationTest::DoRun(), PointerAttributeTestCase::DoRun(), ns3::FqCoDelQueueDisc::InitializeParams(), ns3::TapBridgeHelper::Install(), ns3::DhcpHelper::InstallDhcpServer(), ns3::OnOffHelper::OnOffHelper(), ns3::PacketSinkHelper::PacketSinkHelper(), RoutingExperiment::Run(), ns3::RvBatteryModelHelper::Set(), ns3::BasicEnergySourceHelper::Set(), ns3::BasicEnergyHarvesterHelper::Set(), ns3::LiIonEnergySourceHelper::Set(), ns3::WifiRadioEnergyModelHelper::Set(), ns3::AcousticModemEnergyModelHelper::Set(), ns3::AodvHelper::Set(), ns3::WifiPhyHelper::Set(), ns3::DsdvHelper::Set(), ns3::RipHelper::Set(), ns3::RipNgHelper::Set(), ns3::DsrHelper::Set(), ns3::OlsrHelper::Set(), ns3::SpectrumAnalyzerHelper::SetAntenna(), ns3::WaveformGeneratorHelper::SetAntenna(), ns3::AdhocAlohaNoackIdealPhyHelper::SetAntenna(), ns3::UdpEchoServerHelper::SetAttribute(), ns3::PacketSinkHelper::SetAttribute(), ns3::ThreeGppHttpClientHelper::SetAttribute(), ns3::WaveBsmHelper::SetAttribute(), ns3::UdpServerHelper::SetAttribute(), ns3::Ping6Helper::SetAttribute(), ns3::TapBridgeHelper::SetAttribute(), ns3::OnOffHelper::SetAttribute(), ns3::FdNetDeviceHelper::SetAttribute(), ns3::BulkSendHelper::SetAttribute(), ns3::V4PingHelper::SetAttribute(), ns3::RadvdHelper::SetAttribute(), ns3::TvSpectrumTransmitterHelper::SetAttribute(), ns3::ThreeGppHttpServerHelper::SetAttribute(), ns3::UdpClientHelper::SetAttribute(), ns3::UdpEchoClientHelper::SetAttribute(), ns3::UdpTraceClientHelper::SetAttribute(), ns3::GridBuildingAllocator::SetBuildingAttribute(), ns3::CcHelper::SetCcAttribute(), ns3::SpectrumChannelHelper::SetChannel(), ns3::SimpleNetDeviceHelper::SetChannel(), ns3::CsmaHelper::SetChannelAttribute(), ns3::PointToPointHelper::SetChannelAttribute(), ns3::SimpleNetDeviceHelper::SetChannelAttribute(), ns3::WaveHelper::SetChannelScheduler(), ns3::DhcpHelper::SetClientAttribute(), ns3::OnOffHelper::SetConstantRate(), ns3::BridgeHelper::SetDeviceAttribute(), ns3::SixLowPanHelper::SetDeviceAttribute(), ns3::SpectrumAnalyzerHelper::SetDeviceAttribute(), ns3::CsmaHelper::SetDeviceAttribute(), ns3::WaveformGeneratorHelper::SetDeviceAttribute(), ns3::PointToPointHelper::SetDeviceAttribute(), ns3::AdhocAlohaNoackIdealPhyHelper::SetDeviceAttribute(), ns3::SimpleNetDeviceHelper::SetDeviceAttribute(), ns3::LteHelper::SetEnbAntennaModelAttribute(), ns3::LteHelper::SetEnbComponentCarrierManagerAttribute(), ns3::LteHelper::SetEnbDeviceAttribute(), ns3::WifiPhyHelper::SetErrorRateModel(), ns3::LteHelper::SetFadingModelAttribute(), ns3::LteHelper::SetFfrAlgorithmAttribute(), ns3::LteHelper::SetHandoverAlgorithmAttribute(), ns3::UanHelper::SetMac(), ns3::MeshHelper::SetMacType(), ns3::MobilityHelper::SetMobilityModel(), ns3::FlowMonitorHelper::SetMonitorAttribute(), ns3::LteHelper::SetPathlossModelAttribute(), ns3::UanHelper::SetPhy(), ns3::SpectrumPhyHelper::SetPhy(), ns3::SpectrumAnalyzerHelper::SetPhyAttribute(), ns3::WaveformGeneratorHelper::SetPhyAttribute(), ns3::AdhocAlohaNoackIdealPhyHelper::SetPhyAttribute(), ns3::SpectrumPhyHelper::SetPhyAttribute(), ns3::MobilityHelper::SetPositionAllocator(), ns3::YansWifiChannelHelper::SetPropagationDelay(), ns3::SpectrumChannelHelper::SetPropagationDelay(), ns3::SimpleNetDeviceHelper::SetQueue(), ns3::CsmaHelper::SetQueue(), ns3::PointToPointHelper::SetQueue(), ns3::TrafficControlHelper::SetQueueLimits(), ns3::MeshHelper::SetRemoteStationManager(), ns3::WaveHelper::SetRemoteStationManager(), ns3::WifiHelper::SetRemoteStationManager(), ns3::LteHelper::SetSchedulerAttribute(), ns3::DhcpHelper::SetServerAttribute(), ns3::LteHelper::SetSpectrumChannelAttribute(), ns3::MeshHelper::SetStackInstaller(), ns3::InternetStackHelper::SetTcp(), ns3::UanHelper::SetTransducer(), ns3::WifiRadioEnergyModelHelper::SetTxCurrentModel(), ns3::WifiMacHelper::SetType(), ns3::LteHelper::SetUeAntennaModelAttribute(), ns3::LteHelper::SetUeComponentCarrierManagerAttribute(), ns3::LteHelper::SetUeDeviceAttribute(), VanetRoutingExperiment::SetupAdhocMobilityNodes(), DsdvManetExample::SetupMobility(), ns3::ThreeGppHttpClientHelper::ThreeGppHttpClientHelper(), ns3::ThreeGppHttpServerHelper::ThreeGppHttpServerHelper(), and ns3::V4PingHelper::V4PingHelper().

◆ SetTypeId() [1/3]

void ns3::ObjectFactory::SetTypeId ( TypeId  tid)

Set the TypeId of the Objects to be created by this factory.

Parameters
[in]tidThe TypeId of the object to instantiate.

Definition at line 46 of file object-factory.cc.

References ns3::TypeId::GetName(), m_tid, and NS_LOG_FUNCTION.

Referenced by ns3::AcousticModemEnergyModelHelper::AcousticModemEnergyModelHelper(), ns3::TrafficControlHelper::AddChildQueueDisc(), ns3::TrafficControlHelper::AddInternalQueues(), ns3::TrafficControlHelper::AddPacketFilter(), ns3::GnuplotHelper::AddProbe(), ns3::FileHelper::AddProbe(), ns3::YansWifiChannelHelper::AddPropagationLoss(), ns3::SpectrumChannelHelper::AddPropagationLoss(), ns3::TrafficControlHelper::AddQueueDiscClasses(), ns3::SpectrumChannelHelper::AddSpectrumPropagationLoss(), ns3::AdhocAlohaNoackIdealPhyHelper::AdhocAlohaNoackIdealPhyHelper(), ns3::AodvHelper::AodvHelper(), ns3::LteUeRrc::ApplyRadioResourceConfigDedicated(), ns3::BasicEnergyHarvesterHelper::BasicEnergyHarvesterHelper(), ns3::BasicEnergySourceHelper::BasicEnergySourceHelper(), ns3::BridgeHelper::BridgeHelper(), ns3::BulkSendHelper::BulkSendHelper(), ns3::CcHelper::CcHelper(), ns3::PfifoFastQueueDisc::CheckConfig(), ns3::PrioQueueDisc::CheckConfig(), ns3::TbfQueueDisc::CheckConfig(), ns3::InternetStackHelper::CreateAndAggregateObjectFromTypeId(), ns3::CreateObjectWithAttributes(), ns3::TcpOption::CreateOption(), ns3::TcpL4Protocol::CreateSocket(), ns3::TcpGeneralTest::CreateSocket(), ns3::CsmaHelper::CsmaHelper(), ns3::DhcpHelper::DhcpHelper(), UanTest::DoPhyTests(), BasicEnergyHarvesterTestCase::DoRun(), SteadyStateRandomWaypointTest::DoRun(), AmpduAggregationTest::DoRun(), WaypointMobilityModelNotifyTest::DoRun(), WifiTest::DoRun(), WaypointMobilityModelAddWaypointTest::DoRun(), InterferenceHelperSequenceTest::DoRun(), TwoLevelAggregationTest::DoRun(), ns3::tests::ObjectFactoryTestCase::DoRun(), DcfImmediateAccessBroadcastTestCase::DoRun(), PointerAttributeTestCase::DoRun(), Bug2831TestCase::DoRun(), ns3::DsdvHelper::DsdvHelper(), ns3::DsrHelper::DsrHelper(), ns3::FdNetDeviceHelper::FdNetDeviceHelper(), ns3::FlowMonitorHelper::FlowMonitorHelper(), anonymous_namespace{test-string-value-formatting.cc}::FormattingTestObjectHelper::FormattingTestObjectHelper(), ns3::anonymous_namespace{visual-simulator-impl.cc}::GetDefaultSimulatorImplFactory(), ns3::GetImpl(), ns3::GridBuildingAllocator::GridBuildingAllocator(), ns3::FqCoDelQueueDisc::InitializeParams(), ns3::EnergySourceHelper::Install(), ns3::EnergyHarvesterHelper::Install(), ns3::Ipv4NixVectorHelper::Ipv4NixVectorHelper(), ns3::LiIonEnergySourceHelper::LiIonEnergySourceHelper(), ns3::LteSimpleHelper::LteSimpleHelper(), ns3::MobilityHelper::MobilityHelper(), ObjectFactory(), ns3::OlsrHelper::OlsrHelper(), ns3::OnOffHelper::OnOffHelper(), ns3::operator>>(), ns3::PacketSinkHelper::PacketSinkHelper(), ns3::Ping6Helper::Ping6Helper(), ns3::PointToPointHelper::PointToPointHelper(), ns3::RadvdHelper::RadvdHelper(), ns3::RipHelper::RipHelper(), ns3::RipNgHelper::RipNgHelper(), RoutingExperiment::Run(), FifoQueueDiscTestCase::RunFifoTest(), ns3::RvBatteryModelHelper::RvBatteryModelHelper(), ns3::SpectrumAnalyzerHelper::SetAntenna(), ns3::WaveformGeneratorHelper::SetAntenna(), ns3::AdhocAlohaNoackIdealPhyHelper::SetAntenna(), ns3::SpectrumChannelHelper::SetChannel(), ns3::SimpleNetDeviceHelper::SetChannel(), ns3::WaveHelper::SetChannelScheduler(), ns3::LteHelper::SetEnbAntennaModelType(), ns3::LteHelper::SetEnbComponentCarrierManagerType(), ns3::WifiPhyHelper::SetErrorRateModel(), ns3::LteHelper::SetFadingModel(), ns3::LteHelper::SetFfrAlgorithmType(), ns3::LteHelper::SetHandoverAlgorithmType(), ns3::Simulator::SetImplementation(), ns3::UanHelper::SetMac(), ns3::MeshHelper::SetMacType(), ns3::MobilityHelper::SetMobilityModel(), ns3::LteHelper::SetPathlossModelType(), ns3::UanHelper::SetPhy(), ns3::SpectrumPhyHelper::SetPhy(), ns3::MobilityHelper::SetPositionAllocator(), ns3::YansWifiChannelHelper::SetPropagationDelay(), ns3::SpectrumChannelHelper::SetPropagationDelay(), ns3::SimpleNetDeviceHelper::SetQueue(), ns3::CsmaHelper::SetQueue(), ns3::PointToPointHelper::SetQueue(), ns3::TrafficControlHelper::SetQueueLimits(), ns3::MeshHelper::SetRemoteStationManager(), ns3::WaveHelper::SetRemoteStationManager(), ns3::WifiHelper::SetRemoteStationManager(), ns3::TrafficControlHelper::SetRootQueueDisc(), ns3::LteHelper::SetSchedulerType(), ns3::LteHelper::SetSpectrumChannelType(), ns3::MeshHelper::SetStackInstaller(), ns3::InternetStackHelper::SetTcp(), ns3::UanHelper::SetTransducer(), ns3::WifiRadioEnergyModelHelper::SetTxCurrentModel(), ns3::WifiMacHelper::SetType(), ns3::LteHelper::SetUeAntennaModelType(), ns3::LteHelper::SetUeComponentCarrierManagerType(), VanetRoutingExperiment::SetupAdhocMobilityNodes(), ns3::UeManager::SetupDataRadioBearer(), DsdvManetExample::SetupMobility(), ns3::SimpleNetDeviceHelper::SimpleNetDeviceHelper(), SimulatorTestSuite::SimulatorTestSuite(), ns3::SixLowPanHelper::SixLowPanHelper(), ns3::SpectrumAnalyzerHelper::SpectrumAnalyzerHelper(), ns3::SpectrumWifiPhyHelper::SpectrumWifiPhyHelper(), ns3::TapBridgeHelper::TapBridgeHelper(), PowerRateAdaptationTest::TestAparf(), PowerRateAdaptationTest::TestParf(), PowerRateAdaptationTest::TestRrpaa(), ThreadedSimulatorTestSuite::ThreadedSimulatorTestSuite(), ns3::ThreeGppHttpClientHelper::ThreeGppHttpClientHelper(), ns3::ThreeGppHttpServerHelper::ThreeGppHttpServerHelper(), ns3::TvSpectrumTransmitterHelper::TvSpectrumTransmitterHelper(), ns3::UanHelper::UanHelper(), ns3::UdpClientHelper::UdpClientHelper(), ns3::UdpEchoClientHelper::UdpEchoClientHelper(), ns3::UdpEchoServerHelper::UdpEchoServerHelper(), ns3::UdpServerHelper::UdpServerHelper(), ns3::UdpTraceClientHelper::UdpTraceClientHelper(), ns3::V4PingHelper::V4PingHelper(), ns3::WaveBsmHelper::WaveBsmHelper(), ns3::WaveformGeneratorHelper::WaveformGeneratorHelper(), ns3::WifiRadioEnergyModelHelper::WifiRadioEnergyModelHelper(), and ns3::YansWifiPhyHelper::YansWifiPhyHelper().

◆ SetTypeId() [2/3]

void ns3::ObjectFactory::SetTypeId ( const char *  tid)

Set the TypeId of the Objects to be created by this factory.

Parameters
[in]tidThe TypeId of the object to instantiate.

Definition at line 58 of file object-factory.cc.

References ns3::TypeId::LookupByName(), m_tid, and NS_LOG_FUNCTION.

◆ SetTypeId() [3/3]

void ns3::ObjectFactory::SetTypeId ( std::string  tid)

Set the TypeId of the Objects to be created by this factory.

Parameters
[in]tidThe TypeId of the object to instantiate.

Definition at line 52 of file object-factory.cc.

References ns3::TypeId::LookupByName(), m_tid, and NS_LOG_FUNCTION.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const ObjectFactory factory 
)
friend

Print the factory configuration on an output stream.

The configuration will be printed as a string with the form "<TypeId-name>[<attribute-name>=<attribute-value>|...]"

Parameters
[in,out]osThe stream.
[in]factoryThe ObjectFactory.
Returns
The stream.

Definition at line 108 of file object-factory.cc.

◆ operator>>

std::istream& operator>> ( std::istream &  is,
ObjectFactory factory 
)
friend

Read a factory configuration from an input stream.

The configuration should be in the form "<TypeId-name>[<attribute-name>=<attribute-value>|...]"

Parameters
[in,out]isThe input stream.
[out]factoryThe factory to configure as described by the stream.
Returns
The stream.

Definition at line 123 of file object-factory.cc.

Member Data Documentation

◆ m_parameters

AttributeConstructionList ns3::ObjectFactory::m_parameters
private

The list of attributes and values to be used in constructing objects by this factory.

Definition at line 138 of file object-factory.h.

Referenced by Create(), ns3::operator<<(), ns3::operator>>(), and Set().

◆ m_tid

TypeId ns3::ObjectFactory::m_tid
private

The TypeId this factory will create.

Definition at line 133 of file object-factory.h.

Referenced by Create(), GetTypeId(), ns3::operator<<(), ns3::operator>>(), Set(), and SetTypeId().


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