Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JMonteCarloFileWriter.hh
Go to the documentation of this file.
1#ifndef __JSUPPORT__JMONTECARLOFILEWRITER__
2#define __JSUPPORT__JMONTECARLOFILEWRITER__
3
4#include <ostream>
5
9#include "JLang/JTypeList.hh"
10#include "JLang/JNullType.hh"
11
12
13/**
14 * \author mdejong
15 */
16
17namespace JSUPPORT {}
18namespace JPP { using namespace JSUPPORT; }
19
20namespace JSUPPORT {
21
26 using JLANG::JTypeList;
27 using JLANG::JNullType;
28
29
30 /**
31 * Template definition of Monte Carlo stream output for single data type.
32 *
33 * This class provides for a null implementation of the JLANG::JObjectOutput interface.
34 * It should be specialised for the data types that will be written to a Monte Carlo file.
35 */
36 template<class T>
38 public virtual JObjectOutput<T>,
39 public virtual JNullOutput<T>
40 {
41 protected:
42 /**
43 * Constructor.
44 *
45 * \param out output stream
46 */
48 {}
49 };
50
51
52 /**
53 * Template specialisation of Monte Carlo stream object output for multiple data types.
54 *
55 * This class recursively implements the JLANG::JObjectOutput interface
56 * for all data types by deriving from:
57 * - JMonteCarloStreamObjectOutput<JHead_t>; and
58 * - JMonteCarloStreamObjectOutput<JTail_t>.
59 */
60 template<class JHead_t, class JTail_t>
61 class JMonteCarloStreamObjectOutput< JTypeList<JHead_t, JTail_t> > :
62 public virtual JObjectOutput< JTypeList<JHead_t, JTail_t> >,
63 public JMonteCarloStreamObjectOutput<JHead_t>,
64 public JMonteCarloStreamObjectOutput<JTail_t>
65
66 {
67 protected:
68 /**
69 * Constructor.
70 *
71 * \param out output stream
72 */
73 JMonteCarloStreamObjectOutput(std::ostream& out) :
76 {}
77 };
78
79
80 /**
81 * Terminator class of recursive JMonteCarloStreamObjectOutput class.
82 */
83 template<class JHead_t>
85 public JMonteCarloStreamObjectOutput<JHead_t>
86 {
87 protected:
88 /**
89 * Constructor.
90 *
91 * \param out output stream
92 */
93 JMonteCarloStreamObjectOutput(std::ostream& out) :
95 {}
96 };
97
98
99 /**
100 * Object(s) writing to Monte Carlo ASCII file (i.e.\ .evt)
101 *
102 * This class implements the JLANG::JAccessibleObjectOutput interface.
103 */
104 template<class T>
108 public JAccessibleObjectOutput <T>
109 {
110 public:
111 /**
112 * Default constructor.
113 */
116 JMonteCarloStreamObjectOutput<T>(static_cast<std::ostream&>(*this))
117 {}
118 };
119}
120
121#endif
Interface for object output with named access.
Accessible output stream.
Template interface of object output for single data type.
Object(s) writing to Monte Carlo ASCII file (i.e. .evt)
Template definition of Monte Carlo stream output for single data type.
JMonteCarloStreamObjectOutput(std::ostream &out)
Constructor.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Support classes and methods for experiment specific I/O.
Implementation of null output for single data type.
Auxiliary class for no type definition.
Definition JNullType.hh:19
Type list.
Definition JTypeList.hh:23