1 #ifndef __JSUPPORT__JMETA__
2 #define __JSUPPORT__JMETA__
34 namespace JPP {
using namespace JSUPPORT; }
72 public std::map<std::string, std::string>
87 JMeta(
const int argc,
const char*
const argv[])
100 for (
int i = 1; i != argc; ++i) {
107 const JUTSName buffer;
110 << buffer.sysname <<
' '
111 << buffer.nodename <<
' '
112 << buffer.release <<
' '
113 << buffer.version <<
' '
128 for (const_iterator i = this->begin(); i != this->end(); ++i) {
129 comment.
add(i->first +
' ' + i->second);
142 static void copy(
const char*
const file_name, TFile& out);
171 istringstream
is(buffer);
175 for (JEquation equation; is >> equation; ) {
176 meta[equation.getKey()] = equation.getValue();
197 for (JMeta::const_iterator i = this->begin(); i != this->end(); ++i) {
218 if (p != meta.end()) {
219 for (const_iterator i = meta.begin(); i != meta.end(); ++i) {
221 out << p->second <<
' ' << i->second << endl;
260 file->GetObject(key, __p);
266 const TString title = __p->GetTitle();
270 const string::size_type pos = buffer.find(
';');
272 if (pos != string::npos) {
276 istringstream(buffer.substr(pos + 1)) >> cycle;
278 buffer = buffer.substr(0, pos);
280 for (
int i = 1; i < cycle; ++i) {
284 if (__p != NULL && __p->GetTitle() == title) {
319 if (number_of_cycles != 0) {
347 inline bool putMeta(TDirectory* dir,
const std::string key,
const std::string buffer)
349 static TNamed object;
359 object.SetName (key.c_str());
360 object.SetTitle(buffer.c_str());
362 return (dir->WriteTObject(&
object) > 0);
380 if (p != meta.end()) {
400 JRootFileReader<JMeta>
in(file_name);
402 while (in.hasNext()) {
404 const JMeta* p = in.next();
448 const char* buffer[number_of_items] = {
468 if (number_of_cycles != 0) {
472 file->GetObject(key, __p);
478 for (
int i = 1; i != number_of_items; ++i) {
483 (*ps)[buffer[i]] = __p->GetTitle();
501 return putObject(dir, static_cast<const JMeta&>(meta));
static const char *const application_t
Definition of meta data parameters.
TObject * getObject(const JRootObjectID &id)
Get TObject.
static const char *const GITrelease_t
GIT release.
bool putMeta(TDirectory *dir, const std::string key, const std::string buffer)
Write meta data as ROOT TNamed object.
std::string getPath(const std::string &file_name)
Get path, i.e. part before last JEEP::PATHNAME_SEPARATOR if any.
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
#define MAKE_CSTRING(A)
Make C-string.
static equation_type< T > make_equation(const std::string &key, const T &value)
Auxiliary method to create equation type.
Simple data structure to support I/O of equations (see class JLANG::JEquation).
Jpp environment information.
Auxiliary class for a type holder.
std::string getNamespace(const std::string &type_name)
Get name space, i.e. part before JEEP::TYPENAME_SEPARATOR.
static const char *const ROOTrelease_t
ROOT release.
static const char *const SVNrelease_t
SVN release.
#define MAKE_STRING(A)
Make string.
I/O formatting auxiliaries.
std::string getGITVersion(const std::string &tag)
Get GIT version for given GIT tag.
size_t get_number_of_tokens(const std::string &buffer)
Count number of white space separated tokens.
static const char *const system_t
system information
static const char *const namespace_t
name space
JLANG::JEquationFacet setequation
Type definition of stream manipulator for equational I/O.
static const char *const META_NAME
ROOT name for meta data.
std::string getFilename(const std::string &file_name)
Get file name part, i.e. part after last JEEP::PATHNAME_SEPARATOR if any.
const char * getName()
Get ROOT name of given data type.
static const char *const command_t
Linux command.
int getNumberOfCycles(TFile *file, const TString key)
Get number of cycles of named objects with same title as given key.
static const char *const PATH
binary file paths
static const char *const META_DIRECTORY
ROOT sub-directory for meta data.
bool putObject(TDirectory *dir, const T &object)
Write object to ROOT directory.