Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JTriggerInterface.hh File Reference

Go to the source code of this file.

Classes

class  JTRIGGER::JTriggerInterface
 Trigger interface. More...
 
struct  JTRIGGER::JTriggerInterface::JBit< N >
 Auxiliary class for type definition of specific trigger bit. More...
 
struct  JTRIGGER::JTriggerBit< JTrigger_t >
 This class is used to map trigger class to trigger bit. More...
 
struct  JTRIGGER::JAssertBit< N, true >
 Implementation of a valid trigger bit. More...
 

Namespaces

namespace  JTRIGGER
 Auxiliary classes and methods for triggering.
 
namespace  JPP
 This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
 

Macros

#define setTriggerBit(JTrigger_t, N)
 Macro to set trigger bit of a given trigger class.
 

Typedefs

typedef unsigned int JTRIGGER::JTriggerbit_t
 Type definition of trigger bit.
 

Functions

template<class JTrigger_t >
JTriggerbit_t JTRIGGER::getTriggerBit ()
 Get the trigger bit.
 
template<class JTrigger_t >
JTriggerbit_t JTRIGGER::getTriggerBit (const JTrigger_t &event)
 Get the trigger bit.
 
const char * JTRIGGER::getTriggerName (JTriggerbit_t bit)
 Get trigger name.
 

Macro Definition Documentation

◆ setTriggerBit

#define setTriggerBit ( JTrigger_t,
N )
Value:
\
\
template<> \
struct JTriggerBit<JTrigger_t> : \
JAssertConversion<JTrigger_t, JTriggerInterface>, \
{ \
static const JTriggerbit_t value = N; \
}; \
\
\
template<> \
{ \
return dynamic_cast<const JTrigger_t*>(this) != NULL; \
} \
\
\
template<> \
{ \
return #JTrigger_t; \
}
Auxialiary class to assert type conversion.
bool checkTriggerBit() const
Test whether specific trigger bit correponds to derived trigger class.
static const char * getTriggerName()
Get trigger name.
unsigned int JTriggerbit_t
Type definition of trigger bit.
This class will generate a compiler error if trigger bit is out of range.
This class is used to map trigger class to trigger bit.

Macro to set trigger bit of a given trigger class.

This macro should be called for each trigger class. As a result, the trigger class is mapped to a unique bit. This mapping is then avaiable in the following ways:

  1. The member method JTriggerInterface::getTriggerBit() will return the specified trigger bit of the derived class; and
  2. The trigger bit is stored as a static data member value of the template class JTRIGGER::JTriggerBit.

By using this macro, it is verified -at compile time- that:

  1. The trigger bit is unique;
  2. The trigger class derives from JTRIGGER::JTriggerInterface; and
  3. The trigger class has not been associated to another trigger bit;
Parameters
JTrigger_ttrigger class
Ntrigger bit

Definition at line 271 of file JTriggerInterface.hh.

271#define setTriggerBit(JTrigger_t, N) \
272 \
273 \
274 template<> \
275 struct JTriggerBit<JTrigger_t> : \
276 JAssertConversion<JTrigger_t, JTriggerInterface>, \
277 JAssertBit<N> \
278 { \
279 static const JTriggerbit_t value = N; \
280 }; \
281 \
282 \
283 template<> \
284 inline bool JTriggerInterface::checkTriggerBit<N>() const \
285 { \
286 return dynamic_cast<const JTrigger_t*>(this) != NULL; \
287 } \
288 \
289 \
290 template<> \
291 const char* JTriggerInterface::getTriggerName<N>() \
292 { \
293 return #JTrigger_t; \
294 }