CoriEngine
Loading...
Searching...
No Matches
Cori::Core::Factory< BaseType, KeyType, CtorArgs > Class Template Reference

#include <AutoRegisteringFactory.hpp>

Public Types

using SharedCreator = std::function<std::shared_ptr<BaseType>(CtorArgs...)>
using UniqueCreator = std::function<std::unique_ptr<BaseType>(CtorArgs...)>

Public Member Functions

 Factory (const Factory &)=delete
Factoryoperator= (const Factory &)=delete
 Factory (Factory &&)=delete
Factoryoperator= (Factory &&)=delete
bool RegisterShared (const KeyType &key, SharedCreator creator)
bool RegisterUnique (const KeyType &key, UniqueCreator creator)

Static Public Member Functions

static FactoryInstance ()
static std::shared_ptr< BaseType > CreateShared (const KeyType &key, CtorArgs... ctorArgs)
static std::unique_ptr< BaseType > CreateUnique (const KeyType &key, CtorArgs... ctorArgs)

Detailed Description

template<typename BaseType, typename KeyType, typename... CtorArgs>
class Cori::Core::Factory< BaseType, KeyType, CtorArgs >

Definition at line 6 of file AutoRegisteringFactory.hpp.

Member Typedef Documentation

◆ SharedCreator

template<typename BaseType, typename KeyType, typename... CtorArgs>
using Cori::Core::Factory< BaseType, KeyType, CtorArgs >::SharedCreator = std::function<std::shared_ptr<BaseType>(CtorArgs...)>

Definition at line 8 of file AutoRegisteringFactory.hpp.

◆ UniqueCreator

template<typename BaseType, typename KeyType, typename... CtorArgs>
using Cori::Core::Factory< BaseType, KeyType, CtorArgs >::UniqueCreator = std::function<std::unique_ptr<BaseType>(CtorArgs...)>

Definition at line 9 of file AutoRegisteringFactory.hpp.

Constructor & Destructor Documentation

◆ Factory() [1/2]

template<typename BaseType, typename KeyType, typename... CtorArgs>
Cori::Core::Factory< BaseType, KeyType, CtorArgs >::Factory ( const Factory< BaseType, KeyType, CtorArgs > & )
delete
Here is the call graph for this function:

◆ Factory() [2/2]

template<typename BaseType, typename KeyType, typename... CtorArgs>
Cori::Core::Factory< BaseType, KeyType, CtorArgs >::Factory ( Factory< BaseType, KeyType, CtorArgs > && )
delete
Here is the call graph for this function:

Member Function Documentation

◆ CreateShared()

template<typename BaseType, typename KeyType, typename... CtorArgs>
std::shared_ptr< BaseType > Cori::Core::Factory< BaseType, KeyType, CtorArgs >::CreateShared ( const KeyType & key,
CtorArgs... ctorArgs )
inlinestatic

Definition at line 40 of file AutoRegisteringFactory.hpp.

Here is the call graph for this function:

◆ CreateUnique()

template<typename BaseType, typename KeyType, typename... CtorArgs>
std::unique_ptr< BaseType > Cori::Core::Factory< BaseType, KeyType, CtorArgs >::CreateUnique ( const KeyType & key,
CtorArgs... ctorArgs )
inlinestatic

Definition at line 48 of file AutoRegisteringFactory.hpp.

Here is the call graph for this function:

◆ Instance()

template<typename BaseType, typename KeyType, typename... CtorArgs>
Factory & Cori::Core::Factory< BaseType, KeyType, CtorArgs >::Instance ( )
inlinestatic

Definition at line 11 of file AutoRegisteringFactory.hpp.

Here is the call graph for this function:

◆ operator=() [1/2]

template<typename BaseType, typename KeyType, typename... CtorArgs>
Factory & Cori::Core::Factory< BaseType, KeyType, CtorArgs >::operator= ( const Factory< BaseType, KeyType, CtorArgs > & )
delete
Here is the call graph for this function:

◆ operator=() [2/2]

template<typename BaseType, typename KeyType, typename... CtorArgs>
Factory & Cori::Core::Factory< BaseType, KeyType, CtorArgs >::operator= ( Factory< BaseType, KeyType, CtorArgs > && )
delete
Here is the call graph for this function:

◆ RegisterShared()

template<typename BaseType, typename KeyType, typename... CtorArgs>
bool Cori::Core::Factory< BaseType, KeyType, CtorArgs >::RegisterShared ( const KeyType & key,
SharedCreator creator )
inline

Definition at line 21 of file AutoRegisteringFactory.hpp.

◆ RegisterUnique()

template<typename BaseType, typename KeyType, typename... CtorArgs>
bool Cori::Core::Factory< BaseType, KeyType, CtorArgs >::RegisterUnique ( const KeyType & key,
UniqueCreator creator )
inline

Definition at line 31 of file AutoRegisteringFactory.hpp.


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