Factory

class Factory

Generic factory class for building objects.

Public Functions

inline Parameters *get_parameters(const std::string &class_name)

Get valid parameters for the object.

Parameters:

class_name – Name of the object whose parameter we are requesting

Returns:

Parameters of the object

template<typename T>
inline T *create(const std::string &name, Parameters &parameters)

Build an object (must be registered in Registry)

Parameters:
  • name – Name for the object

  • parametersParameters this object should have

Returns:

The created object

template<typename T>
inline T *create(const std::string &name, Parameters *parameters)

Build an object (must be registered in Registry)

Parameters:
  • name – Name for the object

  • parametersParameters this object should have

Returns:

The created object

inline bool is_registered(const std::string &class_name) const

Check if class is registered.

Parameters:

class_name – Class name to check

Returns:

true if class name is known, false otherwise

void destroy()

Destroy all object build by this factory.