Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
sese::plugin::ClassFactory Class Referenceabstract

Class factory built-in implementation. More...

#include <ClassFactory.h>

Classes

struct  RegisterInfo
 Registration Information. More...
 

Public Types

using RegisterInfoMapType = std::map<std::string, RegisterInfo>
 

Public Member Functions

 ClassFactory () noexcept=default
 
 ClassFactory (ClassFactory &&class_factory)=delete
 
 ClassFactory (const ClassFactory &class_factory)=delete
 
virtual ~ClassFactory ()=default
 
virtual void init ()=0
 
BaseClass::Ptr createClassWithName (const std::string &id) noexcept
 Create an instance of a registered class.
 
Result< BaseClass::Ptr, ErrorCodecreateClassWithNameEx (const std::string &id) noexcept
 
const RegisterInfoMapTypegetRegisterClassInfo () noexcept
 Get the type information of a registered class.
 

Protected Attributes

RegisterInfoMapType infoMap {}
 

Detailed Description

Class factory built-in implementation.

Member Typedef Documentation

◆ RegisterInfoMapType

Constructor & Destructor Documentation

◆ ClassFactory() [1/3]

sese::plugin::ClassFactory::ClassFactory ( )
defaultnoexcept

◆ ClassFactory() [2/3]

sese::plugin::ClassFactory::ClassFactory ( ClassFactory && class_factory)
delete

◆ ClassFactory() [3/3]

sese::plugin::ClassFactory::ClassFactory ( const ClassFactory & class_factory)
delete

◆ ~ClassFactory()

virtual sese::plugin::ClassFactory::~ClassFactory ( )
virtualdefault

Member Function Documentation

◆ createClassWithName()

sese::plugin::BaseClass::Ptr sese::plugin::ClassFactory::createClassWithName ( const std::string & id)
noexcept

Create an instance of a registered class.

Parameters
idClass registration name
Return values
nullptrClass not found
Returns
Class instance

◆ createClassWithNameEx()

sese::Result< sese::plugin::BaseClass::Ptr, sese::ErrorCode > sese::plugin::ClassFactory::createClassWithNameEx ( const std::string & id)
noexcept

◆ getRegisterClassInfo()

const sese::plugin::ClassFactory::RegisterInfoMapType & sese::plugin::ClassFactory::getRegisterClassInfo ( )
noexcept

Get the type information of a registered class.

Returns
Class information map

References infoMap.

◆ init()

virtual void sese::plugin::ClassFactory::init ( )
pure virtual

Member Data Documentation

◆ infoMap

RegisterInfoMapType sese::plugin::ClassFactory::infoMap {}
protected

Referenced by getRegisterClassInfo().


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