Class Reference for E1039 Core & Analysis Software
PHGenericFactoryT< AbstractProduct, FactoryErrorPolicy > Class Template Reference

#include </dev/shm/kenichi/update-github-e1039-doc/e1039-core/database/pdbcal/base/PHGenericFactoryT.h>

+ Inheritance diagram for PHGenericFactoryT< AbstractProduct, FactoryErrorPolicy >:
+ Collaboration diagram for PHGenericFactoryT< AbstractProduct, FactoryErrorPolicy >:

Classes

class  ProductCreatorPair
 

Public Types

typedef AbstractProduct *(* ProductCreator) ()
 
typedef std::string IdentifierType
 

Public Member Functions

AbstractProduct * create (const char *id)
 Create an object identified by the string id. More...
 
void print (std::ostream &os=std::cout) const
 Print the list of creators we have. More...
 
bool registerCreator (const IdentifierType &id, ProductCreator creator, const char *productname)
 Register a creator function for id. More...
 
bool unregisterCreator (const IdentifierType &id)
 Unregister a creator. More...
 

Static Public Member Functions

static PHGenericFactoryT< AbstractProduct, FactoryErrorPolicy > & instance ()
 The factory is a singleton. More...
 

Additional Inherited Members

- Protected Member Functions inherited from DefaultFactoryError< AbstractProduct >
AbstractProduct * OnUnknownType (const std::string &id)
 

Detailed Description

template<class AbstractProduct, template< class > class FactoryErrorPolicy = DefaultFactoryError>
class PHGenericFactoryT< AbstractProduct, FactoryErrorPolicy >

Definition at line 37 of file PHGenericFactoryT.h.

Member Typedef Documentation

◆ IdentifierType

template<class AbstractProduct , template< class > class FactoryErrorPolicy = DefaultFactoryError>
typedef std::string PHGenericFactoryT< AbstractProduct, FactoryErrorPolicy >::IdentifierType

Definition at line 42 of file PHGenericFactoryT.h.

◆ ProductCreator

template<class AbstractProduct , template< class > class FactoryErrorPolicy = DefaultFactoryError>
typedef AbstractProduct*(* PHGenericFactoryT< AbstractProduct, FactoryErrorPolicy >::ProductCreator) ()

Definition at line 41 of file PHGenericFactoryT.h.

Member Function Documentation

◆ create()

template<class AbstractProduct , template< class > class FactoryErrorPolicy = DefaultFactoryError>
AbstractProduct* PHGenericFactoryT< AbstractProduct, FactoryErrorPolicy >::create ( const char *  id)
inline

Create an object identified by the string id.

Definition at line 70 of file PHGenericFactoryT.h.

References DefaultFactoryError< AbstractProduct >::OnUnknownType().

+ Here is the call graph for this function:

◆ instance()

template<class AbstractProduct , template< class > class FactoryErrorPolicy = DefaultFactoryError>
static PHGenericFactoryT<AbstractProduct,FactoryErrorPolicy>& PHGenericFactoryT< AbstractProduct, FactoryErrorPolicy >::instance ( )
inlinestatic

The factory is a singleton.

Definition at line 63 of file PHGenericFactoryT.h.

◆ print()

template<class AbstractProduct , template< class > class FactoryErrorPolicy = DefaultFactoryError>
void PHGenericFactoryT< AbstractProduct, FactoryErrorPolicy >::print ( std::ostream &  os = std::cout) const
inline

Print the list of creators we have.

Definition at line 95 of file PHGenericFactoryT.h.

◆ registerCreator()

template<class AbstractProduct , template< class > class FactoryErrorPolicy = DefaultFactoryError>
bool PHGenericFactoryT< AbstractProduct, FactoryErrorPolicy >::registerCreator ( const IdentifierType id,
ProductCreator  creator,
const char *  productname 
)
inline

Register a creator function for id.

Definition at line 107 of file PHGenericFactoryT.h.

◆ unregisterCreator()

template<class AbstractProduct , template< class > class FactoryErrorPolicy = DefaultFactoryError>
bool PHGenericFactoryT< AbstractProduct, FactoryErrorPolicy >::unregisterCreator ( const IdentifierType id)
inline

Unregister a creator.

Definition at line 131 of file PHGenericFactoryT.h.


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