EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHGenericFactoryT< AbstractProduct, FactoryErrorPolicy > Class Template Reference

#include <fun4all_coresoftware/blob/master/offline/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.
 
void print (std::ostream &os=std::cout) const
 Print the list of creators we have.
 
bool registerCreator (const IdentifierType &id, ProductCreator creator, const char *productname)
 Register a creator function for id.
 
bool unregisterCreator (const IdentifierType &id)
 Unregister a creator.
 

Static Public Member Functions

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

Private Types

typedef std::map
< IdentifierType,
ProductCreatorPair
CreatorMap
 

Private Member Functions

 PHGenericFactoryT ()
 
 PHGenericFactoryT (const PHGenericFactoryT< AbstractProduct > &)
 
PHGenericFactoryT
< AbstractProduct > & 
operator= (const PHGenericFactoryT< AbstractProduct > &)
 
 ~PHGenericFactoryT ()
 

Private Attributes

CreatorMap fCreators
 

Detailed Description

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

Definition at line 37 of file PHGenericFactoryT.h.

View newest version in sPHENIX GitHub at line 37 of file PHGenericFactoryT.h

Member Typedef Documentation

template<class AbstractProduct, template< class > class FactoryErrorPolicy = DefaultFactoryError>
typedef std::map<IdentifierType,ProductCreatorPair> PHGenericFactoryT< AbstractProduct, FactoryErrorPolicy >::CreatorMap
private

Definition at line 144 of file PHGenericFactoryT.h.

View newest version in sPHENIX GitHub at line 144 of file PHGenericFactoryT.h

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

Definition at line 42 of file PHGenericFactoryT.h.

View newest version in sPHENIX GitHub at line 42 of file PHGenericFactoryT.h

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

Definition at line 41 of file PHGenericFactoryT.h.

View newest version in sPHENIX GitHub at line 41 of file PHGenericFactoryT.h

Constructor & Destructor Documentation

template<class AbstractProduct, template< class > class FactoryErrorPolicy = DefaultFactoryError>
PHGenericFactoryT< AbstractProduct, FactoryErrorPolicy >::PHGenericFactoryT ( )
inlineprivate

Definition at line 138 of file PHGenericFactoryT.h.

View newest version in sPHENIX GitHub at line 138 of file PHGenericFactoryT.h

template<class AbstractProduct, template< class > class FactoryErrorPolicy = DefaultFactoryError>
PHGenericFactoryT< AbstractProduct, FactoryErrorPolicy >::PHGenericFactoryT ( const PHGenericFactoryT< AbstractProduct > &  )
private
template<class AbstractProduct, template< class > class FactoryErrorPolicy = DefaultFactoryError>
PHGenericFactoryT< AbstractProduct, FactoryErrorPolicy >::~PHGenericFactoryT ( )
inlineprivate

Definition at line 142 of file PHGenericFactoryT.h.

View newest version in sPHENIX GitHub at line 142 of file PHGenericFactoryT.h

Member Function Documentation

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.

View newest version in sPHENIX GitHub at line 70 of file PHGenericFactoryT.h

References PHGenericFactoryT< AbstractProduct, FactoryErrorPolicy >::fCreators, and it.

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

The factory is a singleton.

Definition at line 63 of file PHGenericFactoryT.h.

View newest version in sPHENIX GitHub at line 63 of file PHGenericFactoryT.h

template<class AbstractProduct, template< class > class FactoryErrorPolicy = DefaultFactoryError>
PHGenericFactoryT<AbstractProduct>& PHGenericFactoryT< AbstractProduct, FactoryErrorPolicy >::operator= ( const PHGenericFactoryT< AbstractProduct > &  )
private
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.

View newest version in sPHENIX GitHub at line 95 of file PHGenericFactoryT.h

References PHGenericFactoryT< AbstractProduct, FactoryErrorPolicy >::fCreators, and it.

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.

View newest version in sPHENIX GitHub at line 107 of file PHGenericFactoryT.h

References PHGenericFactoryT< AbstractProduct, FactoryErrorPolicy >::fCreators.

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.

View newest version in sPHENIX GitHub at line 131 of file PHGenericFactoryT.h

References PHGenericFactoryT< AbstractProduct, FactoryErrorPolicy >::fCreators.

Member Data Documentation

template<class AbstractProduct, template< class > class FactoryErrorPolicy = DefaultFactoryError>
CreatorMap PHGenericFactoryT< AbstractProduct, FactoryErrorPolicy >::fCreators
private

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