instantiate subclasses of ns3::Object. More...
#include <object-factory.h>
Public Member Functions | |
ObjectFactory () | |
void | SetTypeId (TypeId tid) |
void | SetTypeId (const char *tid) |
void | SetTypeId (std::string tid) |
void | Set (std::string name, const AttributeValue &value) |
void | Set (const AttributeList &list) |
TypeId | GetTypeId (void) const |
Ptr< Object > | Create (void) const |
template<typename T > | |
Ptr< T > | Create (void) const |
Private Attributes | |
TypeId | m_tid |
AttributeList | m_parameters |
Friends | |
std::ostream & | operator<< (std::ostream &os, const ObjectFactory &factory) |
std::istream & | operator>> (std::istream &is, ObjectFactory &factory) |
instantiate subclasses of ns3::Object.
This class can also hold a set of attributes to set automatically during the object construction.
Definition at line 39 of file object-factory.h.
ns3::ObjectFactory::ObjectFactory | ( | ) |
Definition at line 23 of file object-factory.cc.
Ptr<T> ns3::ObjectFactory::Create | ( | void | ) | const [inline] |
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.
Ptr< T > ns3::ObjectFactory::Create | ( | void | ) | const [inline] |
Definition at line 64 of file object-factory.cc.
References ns3::Object::Construct(), ns3::TypeId::GetConstructor(), m_parameters, m_tid, and ns3::Object::SetTypeId().
Referenced by ns3::WifiTest::CreateOne(), ns3::TcpL4Protocol::CreateSocket(), ns3::NscTcpL4Protocol::CreateSocket(), ns3::Ns2ExtWifiPhyHelper::EnablePcap(), ns3::GetImpl(), ns3::WifiHelper::Install(), ns3::MobilityHelper::Install(), ns3::CsmaHelper::Install(), ns3::BridgeHelper::Install(), ns3::V4PingHelper::InstallPriv(), ns3::EmuHelper::InstallPriv(), ns3::WifiTest::RunOne(), and ns3::MobilityHelper::SetPositionAllocator().
TypeId ns3::ObjectFactory::GetTypeId | ( | void | ) | const |
Definition at line 58 of file object-factory.cc.
References m_tid.
Referenced by ns3::MobilityHelper::GetMobilityModelType(), and ns3::MobilityHelper::Install().
void ns3::ObjectFactory::Set | ( | const AttributeList & | list | ) |
Definition at line 52 of file object-factory.cc.
References m_parameters.
void ns3::ObjectFactory::Set | ( | std::string | name, | |
const AttributeValue & | value | |||
) |
name | the name of the attribute to set during object construction | |
value | the value of the attribute to set during object construction |
Definition at line 42 of file object-factory.cc.
Referenced by ns3::OnOffHelper::OnOffHelper(), ns3::PacketSinkHelper::PacketSinkHelper(), ns3::V4PingHelper::SetAttribute(), ns3::EmuHelper::SetAttribute(), ns3::CsmaHelper::SetChannelParameter(), ns3::PointToPointHelper::SetDeviceAttribute(), ns3::CsmaHelper::SetDeviceAttribute(), ns3::BridgeHelper::SetDeviceAttribute(), ns3::WifiHelper::SetMac(), ns3::MobilityHelper::SetMobilityModel(), ns3::MobilityHelper::SetPositionAllocator(), ns3::EmuHelper::SetQueue(), ns3::WifiHelper::SetRemoteStationManager(), and ns3::V4PingHelper::V4PingHelper().
void ns3::ObjectFactory::SetTypeId | ( | std::string | tid | ) |
tid | the TypeId of the object to instantiate. |
Definition at line 32 of file object-factory.cc.
void ns3::ObjectFactory::SetTypeId | ( | const char * | tid | ) |
tid | the TypeId of the object to instantiate. |
Definition at line 37 of file object-factory.cc.
void ns3::ObjectFactory::SetTypeId | ( | TypeId | tid | ) |
tid | the TypeId of the object to instantiate. |
Definition at line 27 of file object-factory.cc.
References m_tid.
Referenced by ns3::BridgeHelper::BridgeHelper(), ns3::EmuHelper::EmuHelper(), ns3::TcpL4Protocol::GetDefaultRttEstimatorFactory(), ns3::NscTcpL4Protocol::GetDefaultRttEstimatorFactory(), ns3::GetImpl(), ns3::MobilityHelper::MobilityHelper(), ns3::OlsrHelper::OlsrHelper(), ns3::OnOffHelper::OnOffHelper(), ns3::PacketSinkHelper::PacketSinkHelper(), ns3::WifiTest::RunTests(), ns3::PointToPointHelper::SetDeviceAttribute(), ns3::CsmaHelper::SetDeviceAttribute(), ns3::WifiHelper::SetMac(), ns3::MobilityHelper::SetMobilityModel(), ns3::MobilityHelper::SetPositionAllocator(), ns3::PointToPointHelper::SetQueue(), ns3::EmuHelper::SetQueue(), ns3::CsmaHelper::SetQueue(), ns3::WifiHelper::SetRemoteStationManager(), ns3::UdpEchoServerHelper::UdpEchoServerHelper(), and ns3::V4PingHelper::V4PingHelper().
std::ostream& operator<< | ( | std::ostream & | os, | |
const ObjectFactory & | factory | |||
) | [friend] |
std::istream& operator>> | ( | std::istream & | is, | |
ObjectFactory & | factory | |||
) | [friend] |
Definition at line 89 of file object-factory.h.
TypeId ns3::ObjectFactory::m_tid [private] |
Definition at line 88 of file object-factory.h.
Referenced by Create(), GetTypeId(), and SetTypeId().