Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
EngineCore::Factory Class Reference

#include <Factory.h>

Public Types

using CreateFunction = std::function<std::unique_ptr<Serializable>()>
using JsonFactory = std::function<nlohmann::json()>

Static Public Member Functions

static void registerType (const std::string &typeName, CreateFunction creator, JsonFactory jsonFactory)
template<typename T = Serializable>
static std::unique_ptr< T > create (const std::string &typeName)
static nlohmann::json createJson (const std::string &typeName)
static const std::vector< std::string > & getRegisteredTypes ()

Static Private Member Functions

static std::map< std::string, CreateFunction > & getCreators ()
static std::map< std::string, JsonFactory > & getJsonFactories ()
static std::vector< std::string > & getTypesList ()
static void addRegisteredType (const std::string &typeName)

Friends

template<typename T>
class Registrar

Detailed Description

Definition at line 15 of file Factory.h.

Member Typedef Documentation

◆ CreateFunction

using EngineCore::Factory::CreateFunction = std::function<std::unique_ptr<Serializable>()>

Definition at line 17 of file Factory.h.

◆ JsonFactory

using EngineCore::Factory::JsonFactory = std::function<nlohmann::json()>

Definition at line 18 of file Factory.h.

Member Function Documentation

◆ addRegisteredType()

void EngineCore::Factory::addRegisteredType ( const std::string & typeName)
inlinestaticprivate

Definition at line 83 of file Factory.h.

References getTypesList().

Referenced by EngineCore::Registrar< T >::Registrar().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create()

template<typename T = Serializable>
std::unique_ptr< T > EngineCore::Factory::create ( const std::string & typeName)
inlinestatic

Definition at line 27 of file Factory.h.

References getCreators().

Referenced by EngineCore::Serializable::create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createJson()

nlohmann::json EngineCore::Factory::createJson ( const std::string & typeName)
inlinestatic

Definition at line 53 of file Factory.h.

References getJsonFactories().

Referenced by EngineCore::Serializable::createDefaultJson().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCreators()

std::map< std::string, CreateFunction > & EngineCore::Factory::getCreators ( )
inlinestaticprivate

Definition at line 67 of file Factory.h.

Referenced by create(), and registerType().

Here is the caller graph for this function:

◆ getJsonFactories()

std::map< std::string, JsonFactory > & EngineCore::Factory::getJsonFactories ( )
inlinestaticprivate

Definition at line 72 of file Factory.h.

Referenced by createJson(), and registerType().

Here is the caller graph for this function:

◆ getRegisteredTypes()

const std::vector< std::string > & EngineCore::Factory::getRegisteredTypes ( )
inlinestatic

Definition at line 61 of file Factory.h.

References getTypesList().

Referenced by EngineCore::Serializable::getRegisteredClasses().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTypesList()

std::vector< std::string > & EngineCore::Factory::getTypesList ( )
inlinestaticprivate

Definition at line 77 of file Factory.h.

Referenced by addRegisteredType(), and getRegisteredTypes().

Here is the caller graph for this function:

◆ registerType()

void EngineCore::Factory::registerType ( const std::string & typeName,
CreateFunction creator,
JsonFactory jsonFactory )
inlinestatic

Definition at line 20 of file Factory.h.

References getCreators(), and getJsonFactories().

Referenced by EngineCore::Registrar< T >::Registrar().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Registrar

template<typename T>
friend class Registrar
friend

Definition at line 88 of file Factory.h.

References Registrar.

Referenced by Registrar.


The documentation for this class was generated from the following file:
  • /home/magerbeton/Documents/gl3-vulkan/Engine/include/Engine/Serialization/Factory.h