Jpp 21.0.0-rc.1
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#include <type_traits>
5
6#include "JLang/JType.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
21 /**
22 * Print data type.
23 *
24 * \param out output stream
25 * \param type data type
26 * \param option option
27 */
28 template<class T>
29 inline void print(std::ostream& out, const JType<T>& type, const std::true_type opton)
30 {
31 using namespace std;
32
33 out << getTag<T>() << endl;
34 }
35
36 /**
37 * Print data type.
38 *
39 * \param out output stream
40 * \param type data type
41 * \param option option
42 */
43 template<class T>
44 inline void print(std::ostream& out, const JType<T>& type, const std::false_type opton)
45 {}
46
47 /**
48 * Print data type.
49 *
50 * \param out output stream
51 * \param type data type
52 */
53 template<class T>
54 inline void print(std::ostream& out, const JType<T>& type)
55 {
56 print(out, type, std::bool_constant<JTagAvailable<T>::value>());
57 }
58}
59
60
61/**
62 * \file
63 *
64 * Program to test JTagAvailable.
65 * \author mdejong
66 */
67int main(int argc, char **argv)
68{
69 using namespace std;
70 using namespace JPP;
71
72 int debug;
73
74 try {
75
76 JParser<> zap("Program to test JTagAvailable.");
77
78 zap['d'] = make_field(debug) = 3;
79
80 zap(argc, argv);
81 }
82 catch(const exception& error) {
83 FATAL(error.what() << endl);
84 }
85
86 print(cout, JType<JDAQEvent>());
87 print(cout, JType<double>());
88
89 return 0;
90}
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:74
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2140
I/O formatting auxiliaries.
ControlHost tag.
Utility class to parse command line options.
Definition JParser.hh:1697
Test availability of JNET::JTag value for given class.
Definition JTag.hh:344
int main(int argc, char **argv)
Definition getTag.cc:67
std::ostream & print(std::ostream &out, const JTestSummary &summary, T __begin, T __end, const bool useColors=true, const JFormat_t &formatting=JFormat_t(18, 3, std::ios::fixed))
Print test summary.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary class for a type holder.
Definition JType.hh:19