CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Public Attributes | Private Attributes
LogicTool< GenLogic > Class Template Reference

#include <LogicTool.h>

Public Types

typedef LogicFactory< GenLogic,
std::string > 
RBCLogicType
 Destructor. More...
 

Public Member Functions

bool endjob ()
 
bool initialise ()
 
 LogicTool ()
 Standard constructor. More...
 
GenLogic * retrieve (const std::string &_logic_name)
 
virtual ~LogicTool ()
 

Public Attributes

GenLogic *(* createlogic )()
 
RBCLogicType m_rbclogic
 

Private Attributes

std::vector< std::string > m_logkeys
 

Detailed Description

template<class GenLogic>
class LogicTool< GenLogic >

Author
Andres Osorio

email: aosor.nosp@m.io@u.nosp@m.niand.nosp@m.es.e.nosp@m.du.co

Date
2008-10-12

Definition at line 22 of file LogicTool.h.

Member Typedef Documentation

template<class GenLogic>
typedef LogicFactory< GenLogic, std::string> LogicTool< GenLogic >::RBCLogicType

Destructor.

...

Definition at line 29 of file LogicTool.h.

Constructor & Destructor Documentation

template<class GenLogic>
LogicTool< GenLogic >::LogicTool ( )
inline

Standard constructor.

Definition at line 25 of file LogicTool.h.

25 { };
template<class GenLogic>
virtual LogicTool< GenLogic >::~LogicTool ( )
inlinevirtual

Definition at line 27 of file LogicTool.h.

27  {
28  m_logkeys.clear();
29  };
std::vector< std::string > m_logkeys
Definition: LogicTool.h:116

Member Function Documentation

template<class GenLogic>
bool LogicTool< GenLogic >::endjob ( )
inline

Definition at line 105 of file LogicTool.h.

Referenced by RBCLogicUnit::~RBCLogicUnit(), and TTULogicUnit::~TTULogicUnit().

106  {
107  bool status(true);
108  typename std::vector<std::string>::iterator itr = m_logkeys.begin();
109  while ( itr != m_logkeys.end() )
110  {
111  status = status && ( m_rbclogic.Unregister( (*itr) ) );
112  ++itr;
113  }
114  return status;
115 
116  };
bool Unregister(const Identifier &id)
Definition: LogicFactory.h:29
std::vector< std::string > m_logkeys
Definition: LogicTool.h:116
tuple status
Definition: ntuplemaker.py:245
RBCLogicType m_rbclogic
Definition: LogicTool.h:37
template<class GenLogic>
bool LogicTool< GenLogic >::initialise ( )
inline

Definition at line 39 of file LogicTool.h.

Referenced by RBCLogicUnit::initialise(), and TTULogicUnit::initialise().

40  {
41  bool status(true);
42 
43  //...
44  std::string key = std::string("ChamberORLogic");
45  createlogic = (GenLogic * (*)()) &createChamberORLogic;
47 
48  m_logkeys.push_back( key );
49 
50  key = std::string("TestLogic");
51  createlogic = (GenLogic * (*)()) &createTestLogic;
53 
54  m_logkeys.push_back( key );
55 
56  key = std::string("PatternLogic");
57  createlogic = (GenLogic * (*)()) &createPatternLogic;
59  //...
60 
61  m_logkeys.push_back( key );
62 
63  key = std::string("TrackingAlg");
64  createlogic = (GenLogic * (*)()) &createTrackingAlg;
66 
67  m_logkeys.push_back( key );
68 
69  key = std::string("SectorORLogic");
70  createlogic = (GenLogic * (*)()) &createSectorORLogic;
72 
73  m_logkeys.push_back( key );
74 
75  key = std::string("TwoORLogic");
76  createlogic = (GenLogic * (*)()) &createTwoORLogic;
78 
79  m_logkeys.push_back( key );
80 
81  key = std::string("WedgeORLogic");
82  createlogic = (GenLogic * (*)()) &createWedgeORLogic;
84 
85  m_logkeys.push_back( key );
86 
87  key = std::string("PointingLogic");
88  createlogic = (GenLogic * (*)()) &createPointingLogic;
90 
91  m_logkeys.push_back( key );
92 
93  return status;
94 
95  };
TTUWedgeORLogic * createWedgeORLogic()
Definition: LogicImp.cc:19
RBCChamberORLogic * createChamberORLogic()
Definition: LogicImp.cc:14
TTUSectorORLogic * createSectorORLogic()
Definition: LogicImp.cc:17
bool Register(const Identifier &id, LogicCreator creator)
Definition: LogicFactory.h:24
GenLogic *(* createlogic)()
Definition: LogicTool.h:35
RBCTestLogic * createTestLogic()
Definition: LogicImp.cc:13
TTUPointingLogic * createPointingLogic()
Definition: LogicImp.cc:20
TTUTwoORLogic * createTwoORLogic()
Definition: LogicImp.cc:18
std::vector< std::string > m_logkeys
Definition: LogicTool.h:116
list key
Definition: combine.py:13
TTUTrackingAlg * createTrackingAlg()
Definition: LogicImp.cc:16
RBCPatternLogic * createPatternLogic()
Definition: LogicImp.cc:15
tuple status
Definition: ntuplemaker.py:245
RBCLogicType m_rbclogic
Definition: LogicTool.h:37
template<class GenLogic>
GenLogic* LogicTool< GenLogic >::retrieve ( const std::string &  _logic_name)
inline

Definition at line 98 of file LogicTool.h.

Referenced by RBCLogicUnit::initialise(), and TTULogicUnit::initialise().

99  {
100  GenLogic * _obj;
101  _obj = m_rbclogic.CreateObject( _logic_name );
102  return _obj;
103  };
Ilogic * CreateObject(const Identifier &id)
Definition: LogicFactory.h:39
RBCLogicType m_rbclogic
Definition: LogicTool.h:37

Member Data Documentation

template<class GenLogic>
GenLogic*(* LogicTool< GenLogic >::createlogic)()

Definition at line 35 of file LogicTool.h.

Referenced by LogicTool< RBCLogic >::initialise().

template<class GenLogic>
std::vector<std::string> LogicTool< GenLogic >::m_logkeys
private
template<class GenLogic>
RBCLogicType LogicTool< GenLogic >::m_rbclogic