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 38 of file JRootPrinter.hh.
◆ getEquationParameters()
Get equation parameters.
- Returns
- equation parameters
Definition at line 44 of file JRootPrinter.hh.
45 {
46 static JEquationParameters equation("=", "\n", ".", "");
47
48 return equation;
49 }
◆ setEquationParameters()
Set equation parameters.
- Parameters
-
equation | equation parameters |
Definition at line 57 of file JRootPrinter.hh.
58 {
60 }
static JEquationParameters & getEquationParameters()
Get equation parameters.
◆ print() [1/5]
Write class contents to output.
- Parameters
-
writer | ROOT writer |
cls | ROOT class |
Definition at line 69 of file JRootPrinter.hh.
70 {
71 if (cls.is_valid()) {
72 if (writer.getDictionary().find(cls.getTypename()) != writer.getDictionary().end())
73 writer.putObject(cls);
74 else
75 writer.put(cls);
76 }
77 }
◆ 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 90 of file JRootPrinter.hh.
95 {
98
100
101 for (string::size_type il = 0, ir = 0; ir != string::npos && cls.is_valid(); il = ir + 1) {
102 ir =
key.substr(il).find(parameters.getDefaultDivision());
103 cls = cls.find(
trim(
key.substr(il, ir - il)).c_str());
104 }
105
106 if (cls.is_valid()) {
107
109
111
112 } else {
113
115 }
116 }
#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 from 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 128 of file JRootPrinter.hh.
132 {
133 JRootWriter writer(out, parameters, dictionary);
134 JRootWritableClass cls(object);
135
137 }
◆ 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 149 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 166 of file JRootPrinter.hh.
The documentation for this struct was generated from the following file: