Scarab  v3.1.0
Project 8 C++ Utility Library
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
indexed_factory< XIndexType, XBaseType, XArgs > Class Template Reference

#include <indexed_factory.hh>

Inheritance diagram for indexed_factory< XIndexType, XBaseType, XArgs >:
Inheritance graph

Public Types

typedef std::map< XIndexType, 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 XIndexType &a_index, XArgs ... args)
 
XBaseType * create (const FactoryCIt &iter, XArgs ... args)
 
void register_class (const XIndexType &a_index, const base_registrar< XBaseType, XArgs... > *base_registrar)
 
bool has_class (const XIndexType &a_index) const
 
void remove_class (const XIndexType &a_index)
 
FactoryCIt begin () const
 
FactoryCIt end () const
 

Protected Member Functions

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

Protected Attributes

FactoryMapfMap
 
std::mutex f_factory_mutex
 

Friends

class scarab::singleton< indexed_factory >
 
class scarab::destroyer< indexed_factory >
 

Additional Inherited Members

- Static Public Member Functions inherited from singleton< indexed_factory< XIndexType, XBaseType, XArgs... > >
static indexed_factory< XIndexType, XBaseType, XArgs... > * get_instance ()
 
static void kill_instance ()
 
static indexed_factory< XIndexType, XBaseType, XArgs... > * create_instance (x_args... args)
 
- Static Protected Attributes inherited from singleton< indexed_factory< XIndexType, XBaseType, XArgs... > >
static std::mutex f_mutex
 

Detailed Description

template<class XIndexType, class XBaseType, typename ... XArgs>
class scarab::indexed_factory< XIndexType, XBaseType, XArgs >

Definition at line 36 of file indexed_factory.hh.

Member Typedef Documentation

◆ FactoryCIt

typedef FactoryMap::const_iterator FactoryCIt

Definition at line 77 of file indexed_factory.hh.

◆ FactoryEntry

typedef FactoryMap::value_type FactoryEntry

Definition at line 75 of file indexed_factory.hh.

◆ FactoryIt

typedef FactoryMap::iterator FactoryIt

Definition at line 76 of file indexed_factory.hh.

◆ FactoryMap

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

Definition at line 74 of file indexed_factory.hh.

Constructor & Destructor Documentation

◆ indexed_factory()

indexed_factory ( )
protected

Definition at line 227 of file indexed_factory.hh.

◆ ~indexed_factory()

~indexed_factory ( )
protected

Definition at line 233 of file indexed_factory.hh.

Member Function Documentation

◆ begin()

indexed_factory< XIndexType, XBaseType, XArgs... >::FactoryCIt begin ( ) const

Definition at line 239 of file indexed_factory.hh.

◆ create() [1/2]

XBaseType * create ( const XIndexType &  a_index,
XArgs ...  args 
)

Definition at line 177 of file indexed_factory.hh.

◆ create() [2/2]

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

Definition at line 170 of file indexed_factory.hh.

◆ end()

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

Definition at line 246 of file indexed_factory.hh.

◆ has_class()

bool has_class ( const XIndexType &  a_index) const

Definition at line 212 of file indexed_factory.hh.

◆ register_class()

void register_class ( const XIndexType &  a_index,
const base_registrar< XBaseType, XArgs... > *  base_registrar 
)

Definition at line 196 of file indexed_factory.hh.

◆ remove_class()

void remove_class ( const XIndexType &  a_index)

Definition at line 218 of file indexed_factory.hh.

Friends And Related Function Documentation

◆ scarab::destroyer< indexed_factory >

friend class scarab::destroyer< indexed_factory >
friend

Definition at line 95 of file indexed_factory.hh.

◆ scarab::singleton< indexed_factory >

friend class scarab::singleton< indexed_factory >
friend

Definition at line 95 of file indexed_factory.hh.

Member Data Documentation

◆ f_factory_mutex

std::mutex f_factory_mutex
mutableprotected

Definition at line 92 of file indexed_factory.hh.

◆ fMap

FactoryMap* fMap
protected

Definition at line 91 of file indexed_factory.hh.


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