Jpp
18.3.1
the software that should make you happy
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
JLang
JPrintHelper.cc
Go to the documentation of this file.
1
#include <iostream>
2
#include <iomanip>
3
4
#include "
Jeep/JParser.hh
"
5
#include "
Jeep/JMessage.hh
"
6
7
#include "
JLang/JPrintHelper.hh
"
8
#include "
JLang/JStreamAvailable.hh
"
9
10
11
namespace
{
12
13
struct
__A__ {
14
const
char
* __str__()
const
15
{
16
return
"__A__::__str__()"
;
17
}
18
};
19
20
struct
__B__ {
21
friend
std::ostream&
operator<<
(std::ostream& out,
const
__B__&
object
)
22
{
23
return
out <<
"__B__::operator<<()"
;
24
}
25
};
26
27
struct
__C__ {
28
const
char
* __str__()
const
29
{
30
return
"__C__::__str__()"
;
31
}
32
33
friend
std::ostream&
operator<<
(std::ostream& out,
const
__C__&
object
)
34
{
35
return
out <<
"__C__::operator<<()"
;
36
}
37
};
38
39
struct
__D__ {};
40
}
41
42
43
/**
44
* \file
45
*
46
* Example program to test JLANG::JPrintHelper class.
47
* \author mdejong
48
*/
49
int
main
(
int
argc,
char
**argv)
50
{
51
using namespace
std;
52
53
int
debug
;
54
55
try
{
56
57
JParser<>
zap(
"Example program to test print helper."
);
58
59
zap[
'd'
] =
make_field
(
debug
) = 0;
60
61
zap(argc, argv);
62
}
63
catch
(
const
exception &error) {
64
FATAL
(error.what() << endl);
65
}
66
67
68
__A__
a
;
69
__B__ b;
70
__C__
c
;
71
//__D__ d;
72
73
cout << JStreamAvailable<__A__>::has_ostream << endl;
74
cout << JStreamAvailable<__B__>::has_ostream << endl;
75
cout << JStreamAvailable<__C__>::has_ostream << endl;
76
cout << JStreamAvailable<__D__>::has_ostream << endl;
77
78
cout <<
a
<< endl;
79
cout << b << endl;
80
cout <<
c
<< endl;
81
//cout << d << endl; // compiler error
82
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1514
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
JStreamAvailable.hh
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1989
a
then JCalibrateToT a
Definition:
JTuneHV.sh:113
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JPrintHelper.hh
c
$WORKDIR ev_configure_dqsimulator txt echo process $DQ_SIMULATOR $i $SOURCE_HOST[$index] csh c(setenv ROOTSYS $ROOTSYS &&source $JPP_DIR/setenv.csh $JPP_DIR &&($DQ_SIMULATOR\-u\$NAME\$\-H\$SERVER\$\-M\$LOGGER\$\-d $DEBUG</dev/null > &/dev/null &))'
JParser.hh
Utility class to parse command line options.
operator<<
std::ostream & operator<<(std::ostream &stream, const CLBCommonHeader &header)
Definition:
clb_common_header.hh:72
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
Generated by
1.8.5