ifw-sup 4.0.0
Loading...
Searching...
No Matches
Classes | Static Public Member Functions | Public Attributes | List of all members
sup::syssup::common::Factory< Base, Args > Class Template Reference

#include <subsysFactory.hpp>

Classes

struct  Registrar
 

Static Public Member Functions

template<class ... T>
static std::unique_ptr< BaseCreate (const std::string &s, T &&... args)
 create subsystem object instance
 

Public Attributes

friend Base
 

Detailed Description

template<class Base, class... Args>
class sup::syssup::common::Factory< Base, Args >

This class implements a factory. It has been suggested by Nir Friedman www.nirfriedman.com/2018/04/29/unforgettable-factory/

The innovative solution from Nir is that you can register the class without macros.

See also
Generic

Member Function Documentation

◆ Create()

template<class Base , class... Args>
template<class ... T>
static std::unique_ptr< Base > sup::syssup::common::Factory< Base, Args >::Create ( const std::string &  s,
T &&...  args 
)
inlinestatic

create subsystem object instance

Parameters
sname of the subsystem
argsarguments passed to the created instance
Returns
unique_ptr for the given object instance or nullptr in case instance could not be created. Applications should always check whether the return value is different from nullptr.

Member Data Documentation

◆ Base

template<class Base , class... Args>
friend sup::syssup::common::Factory< Base, Args >::Base

The documentation for this class was generated from the following file: