Auxiliary class for printing objects in ASCII format using JRootWriter.
More...
#include <JRootPrinter.hh>
|
static JEquationParameters & | getEquationParameters () |
| Get equation parameters.
|
|
static void | setEquationParameters (const JEquationParameters &equation) |
| Set equation parameters.
|
|
static void | print (JRootWriter &writer, const JRootWritableClass &cls) |
| Write class contents to output.
|
|
template<class T > |
static void | print (std::ostream &out, const T &object, const std::string &key, const JEquationParameters ¶meters, const JRootDictionary_t &dictionary=JRootDictionary::getInstance()) |
| Write part of object to output using ROOT dictionary.
|
|
template<class T > |
static void | print (std::ostream &out, const T &object, const JEquationParameters ¶meters, const JRootDictionary_t &dictionary=JRootDictionary::getInstance()) |
| Write object to output using ROOT dictionary.
|
|
template<class T > |
static void | print (std::ostream &out, const T &object, const std::string &key, const JRootDictionary_t &dictionary=JRootDictionary::getInstance()) |
| Write part of object to output using ROOT dictionary.
|
|
template<class T > |
static void | print (std::ostream &out, const T &object, const JRootDictionary_t &dictionary=JRootDictionary::getInstance()) |
| Write object to output using ROOT dictionary.
|
|
Auxiliary class for printing objects in ASCII format using JRootWriter.
Definition at line 31 of file JRootPrinter.hh.
◆ getEquationParameters()
Get equation parameters.
- Returns
- equation parameters
Definition at line 37 of file JRootPrinter.hh.
38 {
39 static JEquationParameters equation("=", "\n", ".", "");
40
41 return equation;
42 }
◆ setEquationParameters()
Set equation parameters.
- Parameters
-
equation | equation parameters |
Definition at line 50 of file JRootPrinter.hh.
51 {
53 }
static JEquationParameters & getEquationParameters()
Get equation parameters.
◆ print() [1/5]
Write class contents to output.
- Parameters
-
writer | ROOT writer |
cls | ROOT class |
Definition at line 62 of file JRootPrinter.hh.
63 {
64 if (cls.is_valid()) {
65 if (writer.getDictionary().find(cls.getTypename()) != writer.getDictionary().end())
66 writer.putObject(cls);
67 else
68 writer.put(cls);
69 }
70 }
◆ print() [2/5]
Write part of object to output using ROOT dictionary.
- Parameters
-
out | output stream |
object | object |
key | data member name, optionally separated by division character |
parameters | equation parameters |
dictionary | dictionary |
Definition at line 83 of file JRootPrinter.hh.
88 {
91
93
94 for (string::size_type il = 0, ir = 0; ir != string::npos && cls.is_valid(); il = ir + 1) {
95 ir = key.substr(il).find(parameters.getDefaultDivision());
96 cls = cls.find(
trim(key.substr(il, ir - il)).c_str());
97 }
98
99 if (cls.is_valid()) {
100
102
104
105 } else {
106
108 }
109 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Exception for parsing value.
Implementation for ASCII output of objects with ROOT dictionary.
std::string trim(const std::string &buffer)
Trim string.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
static void print(JRootWriter &writer, const JRootWritableClass &cls)
Write class contents to output.
ROOT class for writing object.
◆ print() [3/5]
Write object to output using ROOT dictionary.
- Parameters
-
out | output stream |
object | object |
parameters | equation parameters |
dictionary | dictionary |
Definition at line 121 of file JRootPrinter.hh.
125 {
126 JRootWriter writer(out, parameters, dictionary);
127 JRootWritableClass cls(object);
128
130 }
◆ print() [4/5]
Write part of object to output using ROOT dictionary.
- Parameters
-
out | output stream |
object | object |
key | data member name, optionally separated by division character '.' |
dictionary | dictionary |
Definition at line 142 of file JRootPrinter.hh.
◆ print() [5/5]
Write object to output using ROOT dictionary.
- Parameters
-
out | output stream |
object | object |
dictionary | dictionary |
Definition at line 159 of file JRootPrinter.hh.
The documentation for this struct was generated from the following file: