|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
20 #ifndef OBJECT_FACTORY_H
21 #define OBJECT_FACTORY_H
67 template <
typename... Args>
99 template <
typename... Args>
131 template <
typename T>
190 template <
typename T,
typename... Args>
206 template <
typename T>
211 return object->GetObject<T> ();
214 template <
typename... Args>
221 template <
typename... Args>
229 template <
typename T,
typename... Args>
235 factory.
Set (args...);
236 return factory.
Create<T> ();
a unique identifier for an interface.
ns3::AttributeConstructionList declaration.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void Set(void)
Base case to stop the recursion performed by the templated version of this method.
Hold a value for an Attribute.
bool IsTypeIdSet(void) const
Check if the ObjectFactory has been configured with a TypeId.
friend std::ostream & operator<<(std::ostream &os, const ObjectFactory &factory)
Print the factory configuration on an output stream.
friend std::istream & operator>>(std::istream &is, ObjectFactory &factory)
Read a factory configuration from an input stream.
TypeId m_tid
The TypeId this factory will create.
TypeId GetTypeId(void) const
Get the TypeId which will be created by this ObjectFactory.
Instantiate subclasses of ns3::Object.
void DoSet(const std::string &name, const AttributeValue &value)
Set an attribute to be set during construction.
Ptr< T > CreateObjectWithAttributes(Args... args)
Allocate an Object on the heap and initialize with a set of attributes.
ns3::TypeId declaration; inline and template implementations.
AttributeConstructionList m_parameters
The list of attributes and values to be used in constructing objects by this factory.
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
std::ostream & operator<<(std::ostream &os, const Angles &a)
ObjectFactory()
Default constructor.
List of Attribute name, value and checker triples used to construct Objects.
ns3::Object class declaration, which is the root of the Object hierarchy and Aggregation.
#define ATTRIBUTE_HELPER_HEADER(type)
Declare the attribute value, accessor and checkers for class type
std::istream & operator>>(std::istream &is, Angles &a)