Grid 0.7.0
Grid::Factory< T, CreatorInput > Class Template Referenceabstract

#include <Factory.h>

Public Types

typedef std::function< std::unique_ptr< T >(const CreatorInput &) > Func

Public Member Functions

 Factory (void)=default
virtual ~Factory (void)=default
void registerBuilder (const std::string type, const Func &f)
std::vector< std::string > getBuilderList (void) const
std::unique_ptr< T > create (const std::string type, const CreatorInput &input) const

Private Member Functions

virtual std::string obj_type () const =0

Private Attributes

std::map< std::string, Funcbuilder_

Detailed Description

template<typename T, typename CreatorInput>
class Grid::Factory< T, CreatorInput >

Definition at line 39 of file Factory.h.

Member Typedef Documentation

◆ Func

template<typename T, typename CreatorInput>
typedef std::function< std::unique_ptr<T>(const CreatorInput&) > Grid::Factory< T, CreatorInput >::Func

Definition at line 42 of file Factory.h.

Constructor & Destructor Documentation

◆ Factory()

template<typename T, typename CreatorInput>
Grid::Factory< T, CreatorInput >::Factory ( void )
default

◆ ~Factory()

template<typename T, typename CreatorInput>
virtual Grid::Factory< T, CreatorInput >::~Factory ( void )
virtualdefault

Member Function Documentation

◆ registerBuilder()

template<typename T, typename CreatorInput>
void Factory::registerBuilder ( const std::string type,
const Func & f )

Definition at line 65 of file Factory.h.

References builder_.

◆ getBuilderList()

template<typename T, typename CreatorInput>
std::vector< std::string > Factory::getBuilderList ( void ) const

Definition at line 72 of file Factory.h.

References builder_.

◆ create()

template<typename T, typename CreatorInput>
std::unique_ptr< T > Factory::create ( const std::string type,
const CreatorInput & input ) const

Definition at line 86 of file Factory.h.

References builder_, GridLogDebug, GridLogError, and obj_type().

◆ obj_type()

template<typename T, typename CreatorInput>
virtual std::string Grid::Factory< T, CreatorInput >::obj_type ( ) const
privatepure virtual

Referenced by create().

Field Documentation

◆ builder_

template<typename T, typename CreatorInput>
std::map<std::string, Func> Grid::Factory< T, CreatorInput >::builder_
private

Definition at line 56 of file Factory.h.

Referenced by create(), getBuilderList(), and registerBuilder().


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