Auxiliary class for ROOT I/O of application specific meta data.
More...
#include <JMeta.hh>
|
| JMeta () |
| Default constructor.
|
|
| JMeta (const int argc, const char *const argv[]) |
| Constructor.
|
|
| operator JComment_t () const |
| Type conversion operator.
|
|
std::string | toString () const |
| Convert meta data to string.
|
|
|
std::ostream & | operator<< (std::ostream &out, const JMeta &meta) |
| Write meta data to output.
|
|
Auxiliary class for ROOT I/O of application specific meta data.
Definition at line 70 of file JMeta.hh.
◆ JMeta() [1/2]
JSUPPORT::JMeta::JMeta |
( |
| ) |
|
|
inline |
Default constructor.
Definition at line 76 of file JMeta.hh.
◆ JMeta() [2/2]
JSUPPORT::JMeta::JMeta |
( |
const int | argc, |
|
|
const char *const | argv[] ) |
|
inline |
Constructor.
- Parameters
-
argc | number of command line arguments |
argv | array of command line arguments |
Definition at line 86 of file JMeta.hh.
87 {
90
91 if (argc > 0) {
92
98
99 for (int i = 1; i != argc; ++i) {
102 else
104 }
105
107
109 << buffer.sysname << ' '
110 << buffer.nodename << ' '
111 << buffer.release << ' '
112 << buffer.version << ' '
113 << buffer.machine);
114 }
115 }
#define MAKE_STRING(A)
Make string.
std::string getGITVersion(const std::string &tag)
Get GIT version for given GIT tag.
std::string getPath(const std::string &file_name)
Get path, i.e. part before last JEEP::PATHNAME_SEPARATOR if any.
size_t get_number_of_tokens(const std::string &buffer)
Count number of white space separated tokens.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
static const char *const command_t
Linux command.
static const char *const GITrelease_t
GIT release.
static const char *const application_t
Definition of meta data parameters.
static const char *const namespace_t
name space
static const char *const ROOTrelease_t
ROOT release.
static const char *const system_t
system information
Auxiliary class for operating system information.
◆ operator JComment_t()
Type conversion operator.
- Returns
- comment
Definition at line 123 of file JMeta.hh.
124 {
126
127 for (const_iterator i = this->begin(); i != this->end(); ++i) {
128 comment.push_back(i->first + ' ' + i->second);
129 }
130
131 return comment;
132 }
std::vector< std::string > JComment_t
Type definition of comment block.
◆ copy()
void JSUPPORT::JMeta::copy |
( |
const char *const | file_name, |
|
|
TFile & | out ) |
|
static |
Copy meta data.
- Parameters
-
file_name | name of input file |
out | output file |
Definition at line 421 of file JMeta.hh.
422 {
424
426
427 while (in.hasNext()) {
428
429 const JMeta* p = in.next();
430
432 }
433 }
bool putObject(TDirectory &dir, const JMeta &meta)
Write meta data to ROOT directory.
◆ getEquationParameters()
Get equation parameters.
- Returns
- equation parameters
Definition at line 149 of file JMeta.hh.
150 {
151 static const JEquationParameters parameters("=", "\n", "", "");
152
153 return parameters;
154 }
◆ valueOf()
static JMeta JSUPPORT::JMeta::valueOf |
( |
const std::string & | buffer | ) |
|
|
inlinestatic |
Extract meta data.
- Parameters
-
- Returns
- meta data
Definition at line 163 of file JMeta.hh.
164 {
167
169
170 istringstream is(buffer);
171
173
174 for (
JEquation equation; is >> equation; ) {
175 meta[equation.getKey()] = equation.getValue();
176 }
177
178 return meta;
179 }
Facet class to specify parsing of equations in currect locale (see class JLANG::JEquation).
General purpose equation class.
◆ toString()
std::string JSUPPORT::JMeta::toString |
( |
| ) |
const |
|
inline |
Convert meta data to string.
- Returns
- string
Definition at line 187 of file JMeta.hh.
188 {
191
192 ostringstream os;
193
195
196 for (JMeta::const_iterator i = this->begin(); i != this->end(); ++i) {
197 os << JEquation::make_equation(i->first, i->second);
198 }
199
200 return os.str();
201 }
◆ operator<<
std::ostream & operator<< |
( |
std::ostream & | out, |
|
|
const JMeta & | meta ) |
|
friend |
Write meta data to output.
- Parameters
-
out | output stream |
meta | meta data |
- Returns
- output stream
Definition at line 211 of file JMeta.hh.
212 {
214
216
217 if (p != meta.end()) {
218 for (const_iterator i = meta.begin(); i != meta.end(); ++i) {
219 if (i != p) {
220 out << p->second << ' ' << i->second << endl;
221 }
222 }
223 }
224
225 return out;
226 }
The documentation for this struct was generated from the following file: