TriggerWrapper.h

00001 #ifndef SCTAPIIPC_TRIGGERWRAPPER_H
00002 #define SCTAPIIPC_TRIGGERWRAPPER_H
00003 
00018 //Forward declaration
00019 class TriggerWrapper;
00020 
00021 // Need complete types for public inheritence
00022 #include "SctApi/Trigger.h" 
00023 #include "Sct_SctApi/SctApi.hh" // for Trigger{_var,_ptr} interface 
00024 #include <string>
00025 
00026 class TriggerWrapper : public ::SctApi::Trigger {
00027  public:
00028   typedef enum MemoryPolicy_enum { 
00029     takeOwnershipOfObjectReference, 
00030     doNotTakeOwnershipOfObjectReference
00031   } MemoryPolicy;
00032  private:
00033   const MemoryPolicy m_memoryPolicy;
00034   typedef Sct_SctApi::Trigger_ptr WorkerType;
00035   WorkerType m_worker;
00036   const WorkerType worker() const { return m_worker; };
00037   WorkerType worker() { return m_worker; };
00038  public:
00039   typedef ::SctApi::Trigger::RODTriggers RODTriggers;  
00040   typedef ::SctApi::Trigger::TIMTriggers TIMTriggers;
00041  public:
00042   TriggerWrapper(const WorkerType & w, const MemoryPolicy memoryPolicy) :
00043     m_memoryPolicy(memoryPolicy),
00044     m_worker(w) {
00045   };
00046   virtual ~TriggerWrapper() {
00047     if (m_memoryPolicy==takeOwnershipOfObjectReference) {
00048       CORBA::release(m_worker);
00049     };
00050   };
00051   void singleL1A() { 
00052     return worker()->singleL1A(); };
00053   void doubleL1A(unsigned short delay) { 
00054     return worker()->doubleL1A(delay); };
00055   void delayedL1A(unsigned short delay) { 
00056     return worker()->delayedL1A(delay); };
00057   void calL1A(unsigned short delay) { 
00058     return worker()->calL1A(delay); };
00059   void pulseL1A(unsigned short delay) { 
00060     return worker()->pulseL1A(delay); };
00061   void softL1A(unsigned short delay) { 
00062     return worker()->softL1A(delay); };
00063   void softCalL1A(unsigned short delay, unsigned short delay2) { 
00064     return worker()->softCalL1A(delay, delay2); };
00065   void softPulseL1A(unsigned short delay, unsigned short delay2) { 
00066     return worker()->softPulseL1A(delay, delay2); };
00067   void softBc(unsigned short delay) { 
00068     return worker()->softBc(delay); };
00069   void soft() { 
00070     return worker()->soft(); };
00071   void bc() { 
00072     return worker()->bc(); };
00073   void bcL1A(unsigned short delay) { 
00074     return worker()->bcL1A(delay); };
00075   void bcCalL1A(unsigned short delay, unsigned short delay2) { 
00076     return worker()->bcCalL1A(delay, delay2); };
00077   void bcPulseL1A(unsigned short delay, unsigned short delay2) { 
00078     return worker()->bcPulseL1A(delay, delay2); };
00079   void setCommIncr(unsigned short command, unsigned short incr) { 
00080     return worker()->setCommIncr(command, incr); };
00081   void getCommIncr(unsigned short &command, unsigned short &incr) const { 
00082     return worker()->getCommIncr(command, incr); };
00083 
00084   void setFrequency(double freq){
00085     worker()->setFrequency(freq); }
00086   double getFrequency() const{
00087     return worker()->getFrequency(); }
00088 
00089   int getRandom() const{
00090     return worker()->getRandom();}
00091   void setRandom(int random){
00092     worker()->setRandom(random);}
00093 
00094   ::SctApi::Trigger::Source getSource() const{
00095     return (::SctApi::Trigger::Source)(int) worker()->getSource();}
00096   void setSource(::SctApi::Trigger::Source s){
00097     worker()->setSource((::Sct_SctApi::Trigger::Source)(int)s);}
00098 
00099   void clear(){
00100     return worker()->clear();}
00101   void addCommand(UINT16 first, UINT32 second){
00102     return worker()->addCommand(first, second);}
00103 
00104   const RODTriggers getRODTriggers(int scan_point) const;
00105 
00106   const TIMTriggers getTIMTriggers(int scan_point) const;
00107 
00108   bool isValidRODTrigger() const{
00109     return worker()->isValidRODTrigger();
00110   }
00111   bool isValidTIMTrigger() const{
00112     return worker()->isValidTIMTrigger();
00113   }
00114   bool timNeedsSequencer() const{
00115     return worker()->timNeedsSequencer();
00116   }
00117 
00118   std::string print() const;
00119 };
00120 
00121 #endif

Generated on Mon Feb 6 14:01:36 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6