CMS 3D CMS Logo

List of all members | Classes | Public Types | Protected Member Functions | Static Protected Member Functions | Private Types | Static Private Member Functions | Private Attributes | Friends
PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t > Class Template Referenceabstract

Generic registry template for polymorphic processor implementations. More...

#include <ProcessRegistry.h>

Inheritance diagram for PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >:
PhysicsTools::ProcessRegistryImpl< Base_t, CalibBase_t, Parent_t, Instance_t, Calibration_t >

Classes

class  Factory
 Factory helper class to instantiate a processor. More...
 

Public Types

template<class Instance_t , class Calibration_t >
using Registry = ProcessRegistryImpl< Base_t, CalibBase_t, Parent_t, Instance_t, Calibration_t >
 

Protected Member Functions

virtual Base_t * instance (const char *name, const CalibBase_t *calib, Parent_t *parent) const =0
 virtual method to implement by respective processor instance classes More...
 
 ProcessRegistry (const char *name)
 instantiate registry and registers itself with name More...
 
virtual ~ProcessRegistry ()
 

Static Protected Member Functions

static Base_t * create (const char *name, const CalibBase_t *calib, Parent_t *parent)
 create an instance of name, given a calibration calib and parent parent More...
 

Private Types

typedef tbb::concurrent_unordered_map< std::string, const ProcessRegistry * > RegistryMap
 

Static Private Member Functions

static RegistryMapgetRegistry ()
 return map of all registered processes, allocate if necessary More...
 
static void registerProcess (const char *name, const ProcessRegistry *process)
 
static void unregisterProcess (const char *name)
 

Private Attributes

const char * name
 

Friends

class Factory
 

Detailed Description

template<class Base_t, class CalibBase_t, class Parent_t>
class PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >

Generic registry template for polymorphic processor implementations.

template parameters are: base class, calibration base class and a pointer to a user-definable "parent type". Template allows registration by name of a given base type using the factory. The variable processors can register themselves with the registry of the common base class.

Definition at line 39 of file ProcessRegistry.h.

Member Typedef Documentation

◆ Registry

template<class Base_t , class CalibBase_t , class Parent_t >
template<class Instance_t , class Calibration_t >
using PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::Registry = ProcessRegistryImpl<Base_t, CalibBase_t, Parent_t, Instance_t, Calibration_t>

Definition at line 45 of file ProcessRegistry.h.

◆ RegistryMap

template<class Base_t , class CalibBase_t , class Parent_t >
typedef tbb::concurrent_unordered_map<std::string, const ProcessRegistry *> PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::RegistryMap
private

Definition at line 80 of file ProcessRegistry.h.

Constructor & Destructor Documentation

◆ ProcessRegistry()

template<class Base_t , class CalibBase_t , class Parent_t >
PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::ProcessRegistry ( const char *  name)
inlineprotected

◆ ~ProcessRegistry()

template<class Base_t , class CalibBase_t , class Parent_t >
virtual PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::~ProcessRegistry ( )
inlineprotectedvirtual

Member Function Documentation

◆ create()

template<class Base_t , class CalibBase_t , class Parent_t >
static Base_t* PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::create ( const char *  name,
const CalibBase_t *  calib,
Parent_t *  parent 
)
staticprotected

create an instance of name, given a calibration calib and parent parent

Referenced by PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::Factory::create().

◆ getRegistry()

template<class Base_t , class CalibBase_t , class Parent_t >
static RegistryMap* PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::getRegistry ( )
staticprivate

return map of all registered processes, allocate if necessary

◆ instance()

template<class Base_t , class CalibBase_t , class Parent_t >
virtual Base_t* PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::instance ( const char *  name,
const CalibBase_t *  calib,
Parent_t *  parent 
) const
protectedpure virtual

virtual method to implement by respective processor instance classes

Implemented in PhysicsTools::ProcessRegistryImpl< Base_t, CalibBase_t, Parent_t, Instance_t, Calibration_t >.

◆ registerProcess()

template<class Base_t , class CalibBase_t , class Parent_t >
template void PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::registerProcess ( const char *  name,
const ProcessRegistry< Base_t, CalibBase_t, Parent_t > *  process 
)
staticprivate

◆ unregisterProcess()

template<class Base_t , class CalibBase_t , class Parent_t >
template void PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::unregisterProcess ( const char *  name)
staticprivate

Friends And Related Function Documentation

◆ Factory

template<class Base_t , class CalibBase_t , class Parent_t >
friend class Factory
friend

Definition at line 64 of file ProcessRegistry.h.

Member Data Documentation

◆ name

template<class Base_t , class CalibBase_t , class Parent_t >
const char* PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::name
private
PhysicsTools::ProcessRegistry::name
const char * name
Definition: ProcessRegistry.h:85
PhysicsTools::ProcessRegistry::unregisterProcess
static void unregisterProcess(const char *name)
PhysicsTools::ProcessRegistry::registerProcess
static void registerProcess(const char *name, const ProcessRegistry *process)