Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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.
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.
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
33  * The method argument refers to the data type for future I/O operations.
34  * This method should be overloaded for each corresponding class.
35  */
36  template<class T>
37  inline int getDataType(JDAQType<T>);
38 
39 
40  struct JDAQSuperFrame;
41  struct JDAQSummaryFrame;
42  struct JDAQTimeslice;
43  struct JDAQTimesliceL0;
44  struct JDAQTimesliceL1;
45  struct JDAQTimesliceL2;
46  struct JDAQTimesliceSN;
47  struct JDAQSummaryslice;
48  struct JDAQEvent;
49 
50 
51  inline int getDataType(JDAQType<JDAQSuperFrame>) { return 101; }
52  inline int getDataType(JDAQType<JDAQSummaryFrame>) { return 201; }
53  inline int getDataType(JDAQType<JDAQTimeslice>) { return 1001; }
54  inline int getDataType(JDAQType<JDAQTimesliceL0>) { return 1002; }
55  inline int getDataType(JDAQType<JDAQTimesliceL1>) { return 1003; }
56  inline int getDataType(JDAQType<JDAQTimesliceL2>) { return 1004; }
57  inline int getDataType(JDAQType<JDAQTimesliceSN>) { return 1005; }
58  inline int getDataType(JDAQType<JDAQSummaryslice>) { return 2001; }
59  inline int getDataType(JDAQType<JDAQEvent>) { return 10001; }
60 }
61 
62 #endif
Auxiliary class for a DAQ type holder.
int getDataType()
Template definition for method returning data type.