Jpp
JDAQDataTypes.hh
Go to the documentation of this file.
1 #ifndef __JDAQDATATYPES__
2 #define __JDAQDATATYPES__
3 
4 /**
5  * \author mdejong
6  */
7 
8 namespace KM3NETDAQ {
9 
10  /**
11  * Auxiliary class for a DAQ type holder.\n
12  * This class can be used to transfer a template class to a method argument.
13  */
14  template<class T>
15  struct JDAQType {
16  typedef T data_type;
17  };
18 
19 
20  /**
21  * Template definition for method returning data type.\n
22  * The template argument refers to the data type for future I/O operations.
23  */
24  template<class T>
25  inline int getDataType()
26  {
27  return getDataType(JDAQType<T>());
28  }
29 
30 
31  /**
32  * Argument definition for method returning data type.\n
33  * The method argument refers to the data type for future I/O operations.\n
34  * This method should be overloaded for each corresponding class.
35  *
36  * \param type data type
37  */
38  template<class T>
39  inline int getDataType(const JDAQType<T>& type);
40 
41 
42  struct JDAQSuperFrame;
43  struct JDAQSummaryFrame;
44  struct JDAQTimeslice;
45  struct JDAQTimesliceL0;
46  struct JDAQTimesliceL1;
47  struct JDAQTimesliceL2;
48  struct JDAQTimesliceSN;
49  struct JDAQSummaryslice;
50  struct JDAQEvent;
51 
52 
53  inline int getDataType(const JDAQType<JDAQSuperFrame>&) { return 101; }
54  inline int getDataType(const JDAQType<JDAQSummaryFrame>&) { return 201; }
55  inline int getDataType(const JDAQType<JDAQTimeslice>&) { return 1001; }
56  inline int getDataType(const JDAQType<JDAQTimesliceL0>&) { return 1002; }
57  inline int getDataType(const JDAQType<JDAQTimesliceL1>&) { return 1003; }
58  inline int getDataType(const JDAQType<JDAQTimesliceL2>&) { return 1004; }
59  inline int getDataType(const JDAQType<JDAQTimesliceSN>&) { return 1005; }
60  inline int getDataType(const JDAQType<JDAQSummaryslice>&) { return 2001; }
61  inline int getDataType(const JDAQType<JDAQEvent>&) { return 10001; }
62 }
63 
64 #endif
KM3NETDAQ::JDAQType
Auxiliary class for a DAQ type holder.
Definition: JDAQDataTypes.hh:15
KM3NETDAQ::getDataType
int getDataType()
Template definition for method returning data type.
Definition: JDAQDataTypes.hh:25
KM3NETDAQ
KM3NeT DAQ data structures and auxiliaries.
Definition: DataQueue.cc:39
KM3NETDAQ::JDAQType::data_type
T data_type
Definition: JDAQDataTypes.hh:16