Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
getTag.cc
Go to the documentation of this file.
1#include <string>
2#include <iostream>
3#include <iomanip>
4
5#include "JLang/JType.hh"
6#include "JLang/JBool.hh"
7
8#include "JNet/JTag.hh"
9
11#include "JDAQ/JDAQTags.hh"
12
13#include "Jeep/JPrint.hh"
14#include "Jeep/JParser.hh"
15#include "Jeep/JMessage.hh"
16
17namespace {
18
19 using JLANG::JType;
20 using JLANG::JBool;
21
22 /**
23 * Print data type.
24 *
25 * \param out output stream
26 * \param type data type
27 * \param option option
28 */
29 template<class T>
30 inline void print(std::ostream& out, const JType<T>& type, const JBool<true>& opton)
31 {
32 using namespace std;
33
34 out << getTag<T>() << endl;
35 }
36
37 /**
38 * Print data type.
39 *
40 * \param out output stream
41 * \param type data type
42 * \param option option
43 */
44 template<class T>
45 inline void print(std::ostream& out, const JType<T>& type, const JBool<false>& opton)
46 {}
47
48 /**
49 * Print data type.
50 *
51 * \param out output stream
52 * \param type data type
53 */
54 template<class T>
55 inline void print(std::ostream& out, const JType<T>& type)
56 {
57 print(out, type, JBool<JTagAvailable<T>::value>());
58 }
59}
60
61
62/**
63 * \file
64 *
65 * Program to test JTagAvailable.
66 * \author mdejong
67 */
68int main(int argc, char **argv)
69{
70 using namespace std;
71 using namespace JPP;
72
73 int debug;
74
75 try {
76
77 JParser<> zap("Program to test JTagAvailable.");
78
79 zap['d'] = make_field(debug) = 3;
80
81 zap(argc, argv);
82 }
83 catch(const exception& error) {
84 FATAL(error.what() << endl);
85 }
86
87 print(cout, JType<JDAQEvent>());
88 print(cout, JType<double>());
89
90 return 0;
91}
Fixed parameters and ControlHost tags for KM3NeT DAQ.
General purpose messaging.
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
I/O formatting auxiliaries.
ControlHost tag.
Utility class to parse command line options.
Definition JParser.hh:1698
Test availability of JNET::JTag value for given class.
Definition JTag.hh:344
int main(int argc, char **argv)
Definition getTag.cc:68
std::ostream & print(std::ostream &out, const JTestSummary &summary, const char delimiter=' ', const bool useColors=true)
Print test summary.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary template class for type bool.
Definition JBool.hh:21
Auxiliary class for a type holder.
Definition JType.hh:19