CMS 3D CMS Logo

Public Types | Public Member Functions | Public Attributes | Private Attributes

LogicTool< GenLogic > Class Template Reference

#include <LogicTool.h>

List of all members.

Public Types

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

Public Member Functions

bool endjob ()
bool initialise ()
 LogicTool ()
 Standard constructor.
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: aosorio@uniandes.edu.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.

{ }; 
template<class GenLogic>
virtual LogicTool< GenLogic >::~LogicTool ( ) [inline, virtual]

Definition at line 27 of file LogicTool.h.

                        { 
    m_logkeys.clear();
  }; 

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().

  {
    bool status(true);
    typename std::vector<std::string>::iterator itr = m_logkeys.begin();
    while ( itr != m_logkeys.end() ) 
    {
      status = status && ( m_rbclogic.Unregister( (*itr) ) );
      ++itr;
    }
    return status;
    
  };
template<class GenLogic>
bool LogicTool< GenLogic >::initialise ( ) [inline]

Definition at line 39 of file LogicTool.h.

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

  {
    bool status(true);

    //...
    std::string key = std::string("ChamberORLogic");
    createlogic = (GenLogic * (*)()) &createChamberORLogic;
    status = m_rbclogic.Register( key , createlogic );
    
    m_logkeys.push_back( key );
        
    key = std::string("TestLogic");
    createlogic = (GenLogic * (*)()) &createTestLogic;
    status = m_rbclogic.Register( key , createlogic );
    
    m_logkeys.push_back( key );

    key = std::string("PatternLogic");
    createlogic = (GenLogic * (*)()) &createPatternLogic;
    status = m_rbclogic.Register( key , createlogic );
    //...
    
    m_logkeys.push_back( key );

    key = std::string("TrackingAlg");
    createlogic = (GenLogic * (*)()) &createTrackingAlg;
    status = m_rbclogic.Register( key , createlogic );

    m_logkeys.push_back( key );
    
    key = std::string("SectorORLogic");
    createlogic = (GenLogic * (*)()) &createSectorORLogic;
    status = m_rbclogic.Register( key , createlogic );
    
    m_logkeys.push_back( key );

    key = std::string("TwoORLogic");
    createlogic = (GenLogic * (*)()) &createTwoORLogic;
    status = m_rbclogic.Register( key , createlogic );

    m_logkeys.push_back( key );

    key = std::string("WedgeORLogic");
    createlogic = (GenLogic * (*)()) &createWedgeORLogic;
    status = m_rbclogic.Register( key , createlogic );
    
    m_logkeys.push_back( key );

    key = std::string("PointingLogic");
    createlogic = (GenLogic * (*)()) &createPointingLogic;
    status = m_rbclogic.Register( key , createlogic );
    
    m_logkeys.push_back( key );
    
    return status;
    
  };
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().

  {
    GenLogic * _obj;
    _obj = m_rbclogic.CreateObject( _logic_name );
    return _obj;
  };

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