Generic registry template for polymorphic processor implementations. More...
#include <ProcessRegistry.h>
Classes | |
class | Factory |
Factory helper class to instantiate a processor. More... | |
class | Registry |
template to generate a registry singleton for a type. More... | |
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 | |
ProcessRegistry (const char *name) | |
instantiate registry and registers itself with name | |
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 | |
Private Types | |
typedef std::map< std::string, const ProcessRegistry * > | RegistryMap |
Static Private Member Functions | |
static RegistryMap * | getRegistry () |
return map of all registered processes, allocate if necessary | |
static void | registerProcess (const char *name, const ProcessRegistry *process) |
static void | unregisterProcess (const char *name) |
Private Attributes | |
const char * | name |
Friends | |
class | Factory |
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 32 of file ProcessRegistry.h.
typedef std::map<std::string, const ProcessRegistry*> PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::RegistryMap [private] |
Definition at line 96 of file ProcessRegistry.h.
PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::ProcessRegistry | ( | const char * | name | ) | [inline, protected] |
instantiate registry and registers itself with name
Definition at line 79 of file ProcessRegistry.h.
References PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::registerProcess().
: name(name) { registerProcess(name, this); }
virtual PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::~ProcessRegistry | ( | ) | [inline, protected, virtual] |
Definition at line 81 of file ProcessRegistry.h.
References PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::name, and PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::unregisterProcess().
{ unregisterProcess(name); }
static Base_t* PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::create | ( | const char * | name, |
const CalibBase_t * | calib, | ||
Parent_t * | parent | ||
) | [static, protected] |
create an instance of name, given a calibration calib and parent parent
Referenced by PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::Factory::create().
static RegistryMap* PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::getRegistry | ( | ) | [static, private] |
return map of all registered processes, allocate if necessary
virtual Base_t* PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::instance | ( | const char * | name, |
const CalibBase_t * | calib, | ||
Parent_t * | parent | ||
) | const [protected, pure virtual] |
virtual method to implement by respective processor instance classes
Implemented in PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::Registry< Instance_t, Calibration_t >.
template void PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::registerProcess | ( | const char * | name, |
const ProcessRegistry< Base_t, CalibBase_t, Parent_t > * | process | ||
) | [static, private] |
template void PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::unregisterProcess | ( | const char * | name | ) | [static, private] |
friend class Factory [friend] |
Definition at line 76 of file ProcessRegistry.h.
const char* PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::name [private] |
Definition at line 101 of file ProcessRegistry.h.
Referenced by PhysicsTools::ProcessRegistry< Base_t, CalibBase_t, Parent_t >::~ProcessRegistry().