19 #ifndef OBJECT_FACTORY_H
20 #define OBJECT_FACTORY_H
67 template <
typename... Args>
98 template <
typename... Args>
131 template <
typename T>
189 template <
typename T,
typename... Args>
203 template <
typename T>
208 return object->GetObject<T>();
211 template <
typename... Args>
218 template <
typename... Args>
226 template <
typename T,
typename... Args>
233 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()
Base case to stop the recursion performed by the templated version of this method.
Ptr< Object > Create() const
Create an Object instance of the configured TypeId.
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() const
Get the TypeId which will be created by this ObjectFactory.
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.
bool IsTypeIdSet() const
Check if the ObjectFactory has been configured with a TypeId.
a unique identifier for an interface.
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.
ATTRIBUTE_HELPER_HEADER(ValueClassTest)
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.