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