MarlinTrk  02.08
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
MarlinTrk::Factory Class Reference

Factory methods for creating the MarlinTrkSystem of a certain type: DDKalTest, aidaTT,...
Currently implemented: DDKalTest, aidaTT. More...

#include <Factory.h>

Public Member Functions

virtual ~Factory ()
 
 Factory (const Factory &)=delete
 
Factory const & operator= (const Factory &)=delete
 

Static Public Member Functions

static IMarlinTrkSystemcreateMarlinTrkSystem (const std::string &systemType, const gear::GearMgr *gearMgr, const std::string &options)
 Create the MarlinTrkSystem instance of the specified type:
DDKalTest, aidaTT,...
Returns 0 if type not implemented... More...
 
static IMarlinTrkSystemgetMarlinTrkSystem (const std::string &systemType)
 Return the MarlinTrkSystem of the given type - only valid after a preceeding call to createMarlinTrkSystem() for that type, otherwise an exception is thrown. More...
 
static IMarlinTrkSystemgetCurrentMarlinTrkSystem ()
 Return the current MarlinTrkSystem, i.e. More...
 
static Factoryinstance ()
 

Protected Types

typedef std::map< std::string,
IMarlinTrkSystem * > 
TrkSystemMap
 

Protected Member Functions

 Factory ()
 

Protected Attributes

IMarlinTrkSystem_currentTrkSystem =nullptr
 
TrkSystemMap _map {}
 

Detailed Description

Factory methods for creating the MarlinTrkSystem of a certain type: DDKalTest, aidaTT,...
Currently implemented: DDKalTest, aidaTT.

The returned instance for a given type is cached, thus:

DO NOT DELETE THE POINTER at the end of your software module (Marlin processor) !

Author
F.Gaede, DESY
Version
$Id$

Definition at line 28 of file Factory.h.

Member Typedef Documentation

Definition at line 80 of file Factory.h.

Constructor & Destructor Documentation

virtual MarlinTrk::Factory::~Factory ( )
inlinevirtual

Definition at line 32 of file Factory.h.

References _map.

MarlinTrk::Factory::Factory ( const Factory )
delete
MarlinTrk::Factory::Factory ( )
inlineprotected

Definition at line 82 of file Factory.h.

Member Function Documentation

IMarlinTrkSystem * MarlinTrk::Factory::createMarlinTrkSystem ( const std::string systemType,
const gear::GearMgr *  gearMgr,
const std::string options 
)
static

Create the MarlinTrkSystem instance of the specified type:
DDKalTest, aidaTT,...
Returns 0 if type not implemented...

DO NOT DELETE THE POINTER at the end of your software module (Marlin processor) !

Definition at line 14 of file Factory.cc.

References _currentTrkSystem, _map, std::map< K, T >::end(), std::endl(), std::map< K, T >::find(), std::map< K, T >::insert(), instance(), std::make_pair(), and std::stringstream::str().

IMarlinTrkSystem * MarlinTrk::Factory::getCurrentMarlinTrkSystem ( )
static

Return the current MarlinTrkSystem, i.e.

the one returned in the last call to createMarlinTrkSystem() or getMarlinTrkSystem() preceeding this call. To be used in cases where the concrete type of the tracking system does not matter - or when it is savely initialized in the enclosing software module (e.e. the Marlin processor).

DO NOT DELETE THE POINTER at the end of your software module (Marlin processor) !

Definition at line 87 of file Factory.cc.

References _currentTrkSystem, std::endl(), instance(), and std::stringstream::str().

Referenced by MarlinTrk::finaliseLCIOTrack().

IMarlinTrkSystem * MarlinTrk::Factory::getMarlinTrkSystem ( const std::string systemType)
static

Return the MarlinTrkSystem of the given type - only valid after a preceeding call to createMarlinTrkSystem() for that type, otherwise an exception is thrown.

This is useful for several modules (e.g. Marlin processors) using the same IMarlinTrkSystem. It is the users responsibility to make sure one module has created it.

DO NOT DELETE THE POINTER at the end of your software module (Marlin processor) !

Definition at line 65 of file Factory.cc.

References _currentTrkSystem, _map, std::map< K, T >::end(), std::endl(), std::map< K, T >::find(), instance(), and std::stringstream::str().

Factory * MarlinTrk::Factory::instance ( )
static
Factory const& MarlinTrk::Factory::operator= ( const Factory )
delete

Member Data Documentation

IMarlinTrkSystem* MarlinTrk::Factory::_currentTrkSystem =nullptr
protected

Definition at line 84 of file Factory.h.

Referenced by createMarlinTrkSystem(), getCurrentMarlinTrkSystem(), and getMarlinTrkSystem().

TrkSystemMap MarlinTrk::Factory::_map {}
protected

Definition at line 86 of file Factory.h.

Referenced by createMarlinTrkSystem(), getMarlinTrkSystem(), and ~Factory().


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