Jpp
18.2.1-ARCA-DF-PATCH
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
JStatic.cc
Go to the documentation of this file.
1
#include <string>
2
#include <iostream>
3
#include <iomanip>
4
5
#include "
JLang/JStatic.hh
"
6
7
#include "
JTools/JQuantile.hh
"
8
9
#include "
Jeep/JParser.hh
"
10
#include "
Jeep/JMessage.hh
"
11
12
namespace
{
13
14
using
JLANG::JStatic
;
15
using
JTOOLS::JQuantile
;
16
17
struct
__A__ {
18
19
static
JStatic<int, __A__, 1>
A
;
20
static
JStatic<int, __A__, 1> B;
// same as A
21
static
JStatic<int, __A__, 2>
C
;
// independent of A
22
static
JStatic<double, __A__>
D
;
// independent of A
23
24
struct
__E__;
// definition of new (dummy) parent
25
static
JStatic<int, __E__>
E
;
// independent of A
26
static
JStatic<std::string, __E__>
F
;
// independent of A and E
27
28
static
JStatic<JQuantile>
Q
;
29
};
30
}
31
32
/**
33
* \file
34
*
35
* Example program to test JLANG::JStatic class.
36
* \author mdejong
37
*/
38
int
main
(
int
argc,
char
**argv)
39
{
40
using namespace
std;
41
using namespace
JPP;
42
43
int
debug
;
44
45
try
{
46
47
JParser<>
zap(
"Example program to test static data member."
);
48
49
zap[
'd'
] =
make_field
(
debug
) = 3;
50
51
zap(argc, argv);
52
}
53
catch
(
const
exception &error) {
54
FATAL
(error.what() << endl);
55
}
56
57
__A__::A
= 888;
58
__A__::B = 0;
59
__A__::C
= 100;
60
__A__::D
= -11.11;
61
__A__::E
= 1;
62
__A__::F
=
"hello world"
;
63
64
int
i
=
__A__::A
;
65
66
DEBUG
(
i
<< endl);
67
68
__A__::B++;
69
__A__::B += 2;
70
71
DEBUG
(__A__::B << endl);
72
DEBUG
(
__A__::C
<< endl);
73
DEBUG
(
__A__::D
<< endl);
74
DEBUG
(
__A__::E
<< endl);
75
DEBUG
(
__A__::F
<< endl);
76
77
for
(
int
i
= 1;
i
!= 10; ++
i
) {
78
__A__::Q
->put(
i
);
79
}
80
81
DEBUG
(
__A__::Q
->
getMean
() << endl);
82
83
{
84
__A__
a
;
85
86
DEBUG
(a.F << endl);
87
}
88
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1514
Q
Q(UTCMax_s-UTCMin_s)-livetime_s
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
E
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
Definition:
JMuonPostfit.sh:40
JTOOLS::JQuantile
Auxiliary data structure for running average, standard deviation and quantiles.
Definition:
JQuantile.hh:43
JStatic.hh
getMean
double getMean(vector< double > &v)
get mean of vector content
Definition:
JBeaconSimulator.cc:56
JPHYSICS::C
static const double C
Physics constants.
Definition:
JPhysics/JConstants.hh:25
i
then rm i
Definition:
JEvtReweightMupageParameterScan.sh:309
JLANG::JStatic
Template data structure for static member declaration.
Definition:
JStatic.hh:20
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
F
then awk F
Definition:
getMIIseacurrent.sh:86
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JParser.hh
Utility class to parse command line options.
JQuantile.hh
A
source $JPP_DIR setenv csh $JPP_DIR &dev null eval JShellParser o a A
Definition:
JShellParser.csh:15
D
do echo Generating $dir eval D
Definition:
JDrawLED.sh:53
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
DEBUG
#define DEBUG(A)
Message macros.
Definition:
JMessage.hh:62
Generated by
1.8.5