Scarab
Project 8 C++ Utility Library
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
factory< XBaseType, XArgs > Class Template Reference

#include <factory.hh>

Inherits singleton< factory< XBaseType, XArgs... > >.

Public Types

typedef std::map< std::string, const base_registrar< XBaseType, XArgs... > * > FactoryMap
 
typedef FactoryMap::value_type FactoryEntry
 
typedef FactoryMap::iterator FactoryIt
 
typedef FactoryMap::const_iterator FactoryCIt
 

Public Member Functions

XBaseType * create (const std::string &a_class_name, XArgs...args)
 
XBaseType * create (const FactoryCIt &iter, XArgs...args)
 
void register_class (const std::string &a_class_name, const base_registrar< XBaseType, XArgs... > *base_registrar)
 
bool has_class (const std::string &a_class_name) const
 
void remove_class (const std::string &a_class_name)
 
FactoryCIt begin () const
 
FactoryCIt end () const
 

Protected Member Functions

 allow_singleton_access (factory)
 
 factory ()
 
 ~factory ()
 
- Protected Member Functions inherited from singleton< factory< XBaseType, XArgs... > >
 singleton ()
 
 ~singleton ()
 

Protected Attributes

FactoryMapfMap
 
std::mutex f_factory_mutex
 

Additional Inherited Members

- Static Public Member Functions inherited from singleton< factory< XBaseType, XArgs... > >
static factory< XBaseType, XArgs... > * get_instance ()
 
static void kill_instance ()
 
static factory< XBaseType, XArgs... > * create_instance (x_args...args)
 

Detailed Description

template<class XBaseType, typename... XArgs>
class scarab::factory< XBaseType, XArgs >

Definition at line 28 of file factory.hh.

Member Typedef Documentation

typedef FactoryMap::const_iterator FactoryCIt

Definition at line 73 of file factory.hh.

typedef FactoryMap::value_type FactoryEntry

Definition at line 71 of file factory.hh.

typedef FactoryMap::iterator FactoryIt

Definition at line 72 of file factory.hh.

typedef std::map< std::string, const base_registrar< XBaseType, XArgs... >* > FactoryMap

Definition at line 70 of file factory.hh.

Constructor & Destructor Documentation

factory ( )
protected

Definition at line 229 of file factory.hh.

~factory ( )
protected

Definition at line 235 of file factory.hh.

Member Function Documentation

allow_singleton_access ( factory< XBaseType, XArgs >  )
protected
factory< XBaseType, XArgs... >::FactoryCIt begin ( ) const

Definition at line 241 of file factory.hh.

XBaseType * create ( const std::string &  a_class_name,
XArgs...  args 
)

Definition at line 178 of file factory.hh.

XBaseType * create ( const FactoryCIt iter,
XArgs...  args 
)

Definition at line 171 of file factory.hh.

factory< XBaseType, XArgs... >::FactoryCIt end ( ) const

Definition at line 248 of file factory.hh.

bool has_class ( const std::string &  a_class_name) const

Definition at line 214 of file factory.hh.

void register_class ( const std::string &  a_class_name,
const base_registrar< XBaseType, XArgs... > *  base_registrar 
)

Definition at line 197 of file factory.hh.

void remove_class ( const std::string &  a_class_name)

Definition at line 220 of file factory.hh.

Member Data Documentation

std::mutex f_factory_mutex
protected

Definition at line 88 of file factory.hh.

FactoryMap* fMap
protected

Definition at line 87 of file factory.hh.


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