Jpp
JRootStreamer.hh
Go to the documentation of this file.
1 #ifndef __JROOT__JROOTSTREAMER__
2 #define __JROOT__JROOTSTREAMER__
3 
4 #include <string>
5 #include <istream>
6 #include <ostream>
7 
8 #include "JLang/JEquation.hh"
10 #include "JLang/JEquationFacet.hh"
12 #include "JLang/JBool.hh"
13 #include "JLang/JRedirectString.hh"
14 #include "JLang/JStreamState.hh"
16 #include "JROOT/JRootClass.hh"
18 
19 
20 /**
21  * \file
22  *
23  * ASCII I/O of objects with ROOT dictionary.
24  * \author mdejong
25  */
26 namespace JROOT {}
27 namespace JPP { using namespace JROOT; }
28 
29 namespace JROOT {
30 
32  using JLANG::JBool;
33  using JLANG::JStreamState;
34  using JLANG::JException;
35 
36 
37  /**
38  * Implementation for ASCII input of objects with ROOT dictionary.
39  *
40  * The method JRootReader::get is compatible with equation formatting, i.e:
41  *
42  * <pre><key><separator><value>[<white space><value>]*<end of line></pre>
43  *
44  * and method JRootReader::getObject with simple formatting, i.e:
45  *
46  * <pre><value>[<white space><value>]*</pre>
47  *
48  * The default format for input of <tt>std::vector<T></tt> is
49  *
50  * <pre><number of elements>[<white space><value>]*</pre>
51  */
52  class JRootReader :
53  public std::istream,
54  private JStreamState
55  {
56  private:
57  /**
58  * Default helper class for formatting.
59  */
60  template<class T>
61  struct JDefaultHelper {
62  /**
63  * Read object.
64  *
65  * This method transfers the reading of the given object to the given ROOT reader.
66  *
67  * \param reader ROOT reader
68  * \param object object
69  * \return ROOT reader
70  */
71  static JRootReader& getObject(JRootReader& reader, T& object)
72  {
73  return reader.getObject(object);
74  }
75  };
76 
77  public:
78  /**
79  * Helper class for user formatting.
80  *
81  * This class should be specialised for implementing a different format.
82  */
83  template<class T>
84  struct JHelper :
85  public JDefaultHelper<T>
86  {};
87 
88 
89  /**
90  * Constructor.
91  *
92  * \param in input stream
93  * \param parameters equation parameters
94  * \param dictionary dictionary
95  */
96  JRootReader(std::istream& in,
97  const JEquationParameters& parameters,
99  std::istream(in.rdbuf()),
100  JStreamState(in, static_cast<std::istream&>(*this)),
102  {
103  imbue(std::locale(in.getloc(), new JLANG::JEquationFacet(parameters)));
104  }
105 
106 
107  /**
108  * Get dictionary.
109  *
110  * \return dictionary
111  */
113  {
114  return dictionary;
115  }
116 
117 
118  /**
119  * Read object.
120  *
121  * This method transfers the reading of the given object to the template JHelper class
122  * so that the default format can be changed through specialisation of this class.
123  *
124  * \param reader ROOT reader
125  * \param object object
126  * \return ROOT reader
127  */
128  template<class T>
129  static JRootReader& getObject(JRootReader& reader, T& object)
130  {
131  return JRootReader::JHelper<T>::getObject(reader, object);
132  }
133 
134 
135  /**
136  * Read object according equation format.
137  *
138  * \param object object
139  * \return this ROOT reader
140  */
141  template<class T>
142  JRootReader& get(T& object)
143  {
144  return this->get(JRootReadableClass(object));
145  }
146 
147 
148  /**
149  * Read object.
150  *
151  * \param object object
152  * \return this ROOT reader
153  */
154  template<class T>
155  JRootReader& getObject(T& object)
156  {
157  return this->getObject(object, JBool<JStreamAvailable<T>::has_istream>());
158  }
159 
160 
161  /**
162  * Read ROOT class according equation format.
163  *
164  * \param cls ROOT class
165  * \return this ROOT reader
166  */
168  {
169  using namespace std;
170  using namespace JLANG;
171 
172  if (cls.is_valid()) {
173 
174  const JEquationFacet& facet = use_facet<JEquationFacet>(this->getloc());
175 
176  for (JEquation equation; *this >> equation; ) {
177 
178  const JRootReadableClass abc = cls.find(equation.getKey().c_str());
179 
180  bool okay = abc.is_valid();
181 
182  if (okay) {
183 
184  JRedirectString redirect(*this, equation.getValue());
185 
186  if (facet.isDivision (equation.getSeparator()))
187  this->get(abc);
188  else if (facet.isSeparator(equation.getSeparator()))
189  this->getObject(abc);
190  else
191  okay = false;
192 
193  okay &= (!this->fail() || this->eof());
194  }
195 
196  if (!okay) {
197  throw JException("Error parsing: " + equation.toString());
198  }
199  }
200  }
201 
202  return *this;
203  }
204 
205 
206  /**
207  * Read ROOT class.
208  *
209  * \param cls ROOT class
210  * \return this ROOT reader
211  */
213  {
214  if (cls.is_valid()) {
215 
216  JRootDictionary_t::const_iterator i = this->getDictionary().find(cls.getTypename());
217 
218  if (i != this->getDictionary().end()) {
219 
220  i->second->getObject(*this, cls.getAddress());
221 
222  } else if (cls.getClass() != NULL) {
223 
224  if (cls.getClass()->GetListOfBases() != NULL) {
225 
226  TIterator* i = cls.getClass()->GetListOfBases()->MakeIterator();
227 
228  for (const TBaseClass* p; (p = (const TBaseClass*) i->Next()) != NULL && (bool) (*this); ) {
229  this->getObject(cls.get(*p));
230  }
231  }
232 
233  if (cls.getClass()->GetListOfDataMembers() != NULL) {
234 
235  TIterator* i = cls.getClass()->GetListOfDataMembers()->MakeIterator();
236 
237  for (const TDataMember* p; (p = (const TDataMember*) i->Next()) != NULL && (bool) (*this); ) {
238  this->getObject(cls.get(*p));
239  }
240  }
241  }
242  }
243 
244  return *this;
245  }
246 
247 
248  /**
249  * Read ROOT class according equation format.
250  *
251  * \param cls ROOT class
252  * \return this ROOT reader
253  */
255  {
256  return getObject(const_cast<const JRootReadableClass&>(cls));
257  }
258 
259 
260  protected:
261  /**
262  * Read object.
263  *
264  * \param object object
265  * \param option true
266  * \return this ROOT reader
267  */
268  template<class T>
269  JRootReader& getObject(T& object, const JBool<true>& option)
270  {
271  *this >> object;
272 
273  return *this;
274  }
275 
276 
277  /**
278  * Read object.
279  *
280  * \param object object
281  * \param option false
282  * \return this ROOT reader
283  */
284  template<class T>
285  JRootReader& getObject(T& object, const JBool<false>& option)
286  {
287  return this->getObject(JRootReadableClass(object));
288  }
289 
290 
291  /**
292  * Read object.
293  *
294  * \param object object
295  * \param option false
296  * \return this ROOT reader
297  */
298  template<class JElement_t, class JAllocator_t>
300  {
301  int n = 0;
302 
303  this->getObject(n);
304 
305  for (JElement_t element; n != 0 && this->getObject(element); --n) {
306  object.push_back(element);
307  }
308 
309  return *this;
310  }
311 
312 
314  };
315 
316 
317  /**
318  * Implementation for ASCII output of objects with ROOT dictionary.
319  *
320  * The method JRootReader::put is compatible with equation formatting, i.e:
321  *
322  * <pre><key><separator><value>[<white space><value>]*<end of line></pre>
323  *
324  * and method JRootReader::putObject with simple formatting, i.e:
325  *
326  * <pre><value>[<white space><value>]*</pre>
327  *
328  * The default format for input of <tt>std::vector<T></tt> is
329  *
330  * <pre><number of elements>[<white space><value>]*</pre>
331  */
332  class JRootWriter :
333  public std::ostream,
334  private JStreamState
335  {
336  private:
337  /**
338  * Default helper class for formatting.
339  */
340  template<class T>
341  struct JDefaultHelper {
342  /**
343  * Write object.
344  *
345  * This method transfers the writing of the given object to the given ROOT writer.
346  *
347  * \param writer ROOT writer
348  * \param object object
349  * \return ROOT writer
350  */
351  static JRootWriter& putObject(JRootWriter& writer, const T& object)
352  {
353  return writer.putObject(object);
354  }
355 
356 
357  /**
358  * Write given key and value according equation format.
359  *
360  * \param writer ROOT writer
361  * \param key key
362  * \param value value
363  * \return ROOT writer
364  */
365  static JRootWriter& put(JRootWriter& writer, const std::string& key, const T& value)
366  {
367  return writer.put(key, value);
368  }
369  };
370 
371  public:
372  /**
373  * Helper class for user formatting.
374  *
375  * This class should be specialised for implementing a different format.
376  */
377  template<class T>
378  struct JHelper :
379  public JDefaultHelper<T>
380  {};
381 
382 
383  /**
384  * Constructor.
385  *
386  * \param out output stream
387  * \param parameters equation parameters
388  * \param dictionary dictionary
389  */
390  JRootWriter(std::ostream& out,
391  const JEquationParameters& parameters,
392  const JRootDictionary_t& dictionary) :
393  std::ostream(out.rdbuf()),
394  JStreamState(out, static_cast<std::ostream&>(*this)),
396  {
397  imbue(std::locale(out.getloc(), new JLANG::JEquationFacet(parameters)));
398 
399  flags (out.flags());
400  width (out.width());
401  precision(out.precision());
402  }
403 
404 
405  /**
406  * Get dictictionary.
407  *
408  * \return dictionary
409  */
411  {
412  return dictionary;
413  }
414 
415 
416  /**
417  * Write object.
418  *
419  * This method transfers the writing of the given object to the template JHelper class
420  * so that the default format can be changed through specialisation of this class.
421  *
422  * \param writer ROOT writer
423  * \param object object
424  * \return ROOT writer
425  */
426  template<class T>
427  static JRootWriter& putObject(JRootWriter& writer, const T& object)
428  {
429  return JRootWriter::JHelper<T>::putObject(writer, object);
430  }
431 
432 
433  /**
434  * Write given key and value according equation format.
435  *
436  * \param writer ROOT writer
437  * \param key key
438  * \param value value
439  * \return ROOT writer
440  */
441  template<class T>
442  static JRootWriter& put(JRootWriter& writer, const std::string& key, const T& value)
443  {
444  return JRootWriter::JHelper<T>::put(writer, key, value);
445  }
446 
447 
448  /**
449  * Write object according equation format.
450  *
451  * \param object object
452  * \return this ROOT writer
453  */
454  template<class T>
455  JRootWriter& put(const T& object)
456  {
457  return this->put(JRootWritableClass(object));
458  }
459 
460 
461  /**
462  * Write object according equation format.
463  *
464  * \param cls ROOT class
465  * \return this ROOT writer
466  */
468  {
469  return this->put("", cls, false);
470  }
471 
472 
473  /**
474  * Write object according equation format.
475  *
476  * \param cls ROOT class
477  * \return this ROOT writer
478  */
480  {
481  return this->put(const_cast<const JRootWritableClass&>(cls));
482  }
483 
484 
485  /**
486  * Write object.
487  *
488  * \param object object
489  * \return this ROOT writer
490  */
491  template<class T>
492  JRootWriter& putObject(const T& object)
493  {
494  return this->putObject(object, JBool<JStreamAvailable<T>::has_ostream>());
495  }
496 
497 
498  /**
499  * ROOT class output.
500  *
501  * \param prefix prefix
502  * \param cls ROOT class
503  * \param eol end-of-line
504  * \return object output
505  */
506  JRootWriter& put(const std::string& prefix, const JRootWritableClass& cls, bool eol)
507  {
508  using namespace std;
509  using namespace JLANG;
510 
511  if (cls.is_valid()) {
512 
513  const JEquationFacet& facet = use_facet<JEquationFacet>(this->getloc());
514 
515  JRootDictionary_t::const_iterator i = this->getDictionary().find(cls.getTypename());
516 
517  if (i != this->getDictionary().end()) {
518 
519  i->second->put(*this, prefix, cls.getAddress());
520 
521  } else if (eol) {
522 
523  *this << prefix;
524  *this << separator;
525 
526  this->putObject(cls);
527 
528  *this << end_of_line;
529 
530  } else if (cls.getClass() != NULL) {
531 
532  if (cls.getClass()->GetListOfBases() != NULL) {
533 
534  TIterator* i = cls.getClass()->GetListOfBases()->MakeIterator();
535 
536  for (const TBaseClass* p; (p = (const TBaseClass*) i->Next()) != NULL; ) {
537  this->put(prefix, cls.get(*p), false);
538  }
539  }
540 
541  if (cls.getClass()->GetListOfDataMembers() != NULL) {
542 
543  TIterator* i = cls.getClass()->GetListOfDataMembers()->MakeIterator();
544 
545  for (const TDataMember* p; (p = (const TDataMember*) i->Next()) != NULL; ) {
546  if (!JRootClass::is_static(*p)) {
547  this->put(facet.getPrefix(prefix,p->GetName()), cls.get(*p), false);
548  }
549  }
550  }
551  }
552  }
553 
554  return *this;
555  }
556 
557 
558  /**
559  * ROOT class output.
560  *
561  * \param cls ROOT class
562  * \return object output
563  */
565  {
566  using namespace std;
567 
568  if (cls.is_valid()) {
569 
570  JRootDictionary_t::const_iterator i = this->getDictionary().find(cls.getTypename());
571 
572  if (i != this->getDictionary().end()) {
573 
574  i->second->putObject(*this, cls.getAddress());
575 
576  } else if (cls.getClass() != NULL) {
577 
578  if (cls.getClass()->GetListOfBases() != NULL) {
579 
580  TIterator* i = cls.getClass()->GetListOfBases()->MakeIterator();
581 
582  for (const TBaseClass* p; (p = (const TBaseClass*) i->Next()) != NULL; ) {
583  this->putObject(cls.get(*p));
584  }
585  }
586 
587  if (cls.getClass()->GetListOfDataMembers() != NULL) {
588 
589  TIterator* i = cls.getClass()->GetListOfDataMembers()->MakeIterator();
590 
591  for (const TDataMember* p; (p = (const TDataMember*) i->Next()) != NULL; ) {
592  if (!JRootClass::is_static(*p)) {
593  this->putObject(cls.get(*p));
594  }
595  }
596  }
597  }
598  }
599 
600  return *this;
601  }
602 
603 
604  /**
605  * Write given key and value according equation format.
606  *
607  * \param key key
608  * \param value value
609  * \return this ROOT writer
610  */
611  template<class T>
612  JRootWriter& put(const std::string& key, const T& value)
613  {
614  return this->put(key, value, JLANG::JBool<JStreamAvailable<T>::has_ostream>());
615  }
616 
617  protected:
618  /**
619  * Write given key and value according equation format.
620  *
621  * \param key key
622  * \param value value
623  * \param option true
624  * \return this ROOT writer
625  */
626  template<class T>
627  JRootWriter& put(const std::string& key, const T& value, const JBool<true> option)
628  {
629  using namespace JLANG;
630 
631  *this << key;
632  *this << separator;
633  *this << white_space;
634  *this << value;
635  *this << end_of_line;
636 
637  return *this;
638  }
639 
640 
641  /**
642  * Write given key and value according equation format.
643  *
644  * \param key key
645  * \param value value
646  * \param option false
647  * \return this ROOT writer
648  */
649  template<class T>
650  JRootWriter& put(const std::string& key, const T& value, const JBool<false> option)
651  {
652  using namespace JLANG;
653 
654  *this << key;
655  *this << separator;
656 
657  this->putObject(value);
658 
659  *this << end_of_line;
660 
661  return *this;
662  }
663 
664 
665  /**
666  * Write given key and value according equation format.
667  *
668  * \param key key
669  * \param value value
670  * \param option false
671  * \return this ROOT writer
672  */
673  template<class JElement_t, class JAllocator_t>
674  JRootWriter& put(const std::string& key, const std::vector<JElement_t, JAllocator_t>& value, const JBool<false> option)
675  {
676  for (typename std::vector<JElement_t, JAllocator_t>::const_iterator i = value.begin(); i != value.end(); ++i) {
677  this->put(key, *i);
678  }
679 
680  return *this;
681  }
682 
683 
684  /**
685  * Write object.
686  *
687  * \param object object
688  * \param option true
689  * \return this ROOT writer
690  */
691  template<class T>
692  JRootWriter& putObject(const T& object, const JBool<true>& option)
693  {
694  using namespace JLANG;
695 
696  *this << white_space;
697  *this << object;
698 
699  return *this;
700  }
701 
702 
703  /**
704  * Write object.
705  *
706  * \param object object
707  * \param option false
708  * \return this ROOT writer
709  */
710  template<class T>
711  JRootWriter& putObject(const T& object, const JBool<false>& option)
712  {
713  return this->putObject(JRootWritableClass(object));
714  }
715 
716 
717  /**
718  * Write object.
719  *
720  * \param object object
721  * \param option false
722  * \return this ROOT writer
723  */
724  template<class JElement_t, class JAllocator_t>
726  {
727  this->putObject(object.size());
728 
729  for (typename std::vector<JElement_t, JAllocator_t>::const_iterator i = object.begin(); i != object.end(); ++i) {
730  this->putObject(*i);
731  }
732 
733  return *this;
734  }
735 
736 
738  };
739 
740 
741  /**
742  * JObjectStreamer class.
743  *
744  * This class implements the JAstractStreamer interface for the given template class.
745  * The I/O functionality is transferred to the JRootReader and JRootWriter class, respectively.
746  */
747  template<class T>
749  public JAbstractStreamer
750  {
751  public:
752  /**
753  * Stream input.
754  *
755  * \param in object reader
756  * \param address pointer to object
757  * \return object reader
758  */
759  virtual JRootReader& getObject(JRootReader& in, void* address) const
760  {
761  return JRootReader::getObject(in, * ((T*) address));
762  }
763 
764 
765  /**
766  * Stream output.
767  *
768  * \param out object writer
769  * \param address pointer to object
770  * \return object writer
771  */
772  virtual JRootWriter& putObject(JRootWriter& out, const void* address) const
773  {
774  return JRootWriter::putObject(out, * ((const T*) address));
775  }
776 
777 
778  /**
779  * Stream output.
780  *
781  * \param out object writer
782  * \param prefix prefix
783  * \param address pointer to object
784  * \return object writer
785  */
786  virtual JRootWriter& put(JRootWriter& out, const std::string& prefix, const void* address) const
787  {
788  return JRootWriter::put(out, prefix, * ((const T*) address));
789  }
790  };
791 }
792 
793 #endif
JROOT::JRootReader::getObject
JRootReader & getObject(T &object, const JBool< false > &option)
Read object.
Definition: JRootStreamer.hh:285
JROOT::JRootWriter::dictionary
const JRootDictionary_t & dictionary
Definition: JRootStreamer.hh:737
JROOT::JRootWriter::put
JRootWriter & put(const JRootWritableClass &cls)
Write object according equation format.
Definition: JRootStreamer.hh:467
JROOT::JRootWriter::putObject
JRootWriter & putObject(const std::vector< JElement_t, JAllocator_t > &object, const JBool< false > option)
Write object.
Definition: JRootStreamer.hh:725
JROOT::JRootAddressableClass::is_valid
bool is_valid() const
Check validity of this addressable class.
Definition: JRootClass.hh:459
JROOT::JRootReader::get
JRootReader & get(T &object)
Read object according equation format.
Definition: JRootStreamer.hh:142
JROOT::JRootWriter::put
JRootWriter & put(const std::string &key, const T &value, const JBool< false > option)
Write given key and value according equation format.
Definition: JRootStreamer.hh:650
JROOT::JRootWriter::putObject
JRootWriter & putObject(const T &object, const JBool< true > &option)
Write object.
Definition: JRootStreamer.hh:692
JROOT
Auxiliary classes and methods for ROOT I/O.
Definition: JAbstractStreamer.hh:13
JBool.hh
JLANG::JStreamState
This class can be used to temporarily exchange the states between streams.
Definition: JStreamState.hh:23
JROOT::JRootWriter::getDictionary
const JRootDictionary_t & getDictionary() const
Get dictictionary.
Definition: JRootStreamer.hh:410
JROOT::JRootAddressableClass::getAddress
pointer_type getAddress() const
Get address.
Definition: JRootClass.hh:448
JROOT::JRootWritableClass
ROOT class for writing object.
Definition: JRootClass.hh:586
JROOT::JRootClass::getClass
TClass * getClass() const
Get class.
Definition: JRootClass.hh:181
JLANG::end_of_line
static const JLANG::JEndOfLine end_of_line
Print end of line.
Definition: JEquationFacet.hh:568
JAbstractStreamer.hh
JLANG::JEquationParameters::isSeparator
bool isSeparator(const char c) const
Test for separator character.
Definition: JEquationParameters.hh:369
JLANG::JEquationParameters::isDivision
bool isDivision(const char c) const
Test for division character.
Definition: JEquationParameters.hh:390
JROOT::JRootWriter::JRootWriter
JRootWriter(std::ostream &out, const JEquationParameters &parameters, const JRootDictionary_t &dictionary)
Constructor.
Definition: JRootStreamer.hh:390
JROOT::JRootReader::JDefaultHelper::getObject
static JRootReader & getObject(JRootReader &reader, T &object)
Read object.
Definition: JRootStreamer.hh:71
JTOOLS::n
const int n
Definition: JPolint.hh:628
std::vector
Definition: JSTDTypes.hh:12
JROOT::JRootReader::getObject
JRootReader & getObject(std::vector< JElement_t, JAllocator_t > &object, const JBool< false > &option)
Read object.
Definition: JRootStreamer.hh:299
JROOT::JRootReader::JDefaultHelper
Default helper class for formatting.
Definition: JRootStreamer.hh:61
JROOT::JRootClass::is_static
static bool is_static(const TDataMember &data_member)
Check if data member is static.
Definition: JRootClass.hh:124
JROOT::JRootReader::dictionary
const JRootDictionary_t & dictionary
Definition: JRootStreamer.hh:313
JROOT::JRootWriter::putObject
JRootWriter & putObject(const T &object, const JBool< false > &option)
Write object.
Definition: JRootStreamer.hh:711
JEquationParameters.hh
JROOT::JObjectStreamer::putObject
virtual JRootWriter & putObject(JRootWriter &out, const void *address) const
Stream output.
Definition: JRootStreamer.hh:772
JLANG::white_space
std::ostream & white_space(std::ostream &out)
Print white space.
Definition: JEquationFacet.hh:511
JStreamAvailable.hh
JROOT::putObject
bool putObject(TDirectory *dir, const T &object)
Write object to ROOT directory.
Definition: JRootFileWriter.hh:38
JROOT::JRootWriter
Implementation for ASCII output of objects with ROOT dictionary.
Definition: JRootStreamer.hh:332
JROOT::JRootWriter::put
JRootWriter & put(const std::string &prefix, const JRootWritableClass &cls, bool eol)
ROOT class output.
Definition: JRootStreamer.hh:506
JROOT::JRootWriter::put
JRootWriter & put(JRootWritableClass &cls)
Write object according equation format.
Definition: JRootStreamer.hh:479
JROOT::JAbstractStreamer
Forward declaration of writer object.
Definition: JAbstractStreamer.hh:25
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JROOT::JRootReader::getObject
static JRootReader & getObject(JRootReader &reader, T &object)
Read object.
Definition: JRootStreamer.hh:129
JROOT::JRootAddressableClass::get
JRootAddressableClass get(const TDataMember &data_member) const
Get addressable class of given data member.
Definition: JRootClass.hh:481
JROOT::JRootReader::JRootReader
JRootReader(std::istream &in, const JEquationParameters &parameters, const JRootDictionary_t &dictionary)
Constructor.
Definition: JRootStreamer.hh:96
JROOT::JRootWriter::JHelper
Helper class for user formatting.
Definition: JRootStreamer.hh:378
JROOT::JRootWriter::JDefaultHelper::putObject
static JRootWriter & putObject(JRootWriter &writer, const T &object)
Write object.
Definition: JRootStreamer.hh:351
JROOT::JObjectStreamer::getObject
virtual JRootReader & getObject(JRootReader &in, void *address) const
Stream input.
Definition: JRootStreamer.hh:759
JLANG::JEquation
General purpose equation class.
Definition: JEquation.hh:47
JROOT::JRootReader::getObject
JRootReader & getObject(JRootReadableClass &cls)
Read ROOT class according equation format.
Definition: JRootStreamer.hh:254
JLANG::JRedirectString
This class can be used to temporarily redirect an input stream to an input string.
Definition: JRedirectString.hh:26
JRedirectString.hh
JLANG::JEquationFacet
Facet class to specify parsing of equations in currect locale (see class JLANG::JEquation).
Definition: JEquationFacet.hh:32
JROOT::JRootWriter::putObject
JRootWriter & putObject(const T &object)
Write object.
Definition: JRootStreamer.hh:492
JROOT::JRootWriter::put
JRootWriter & put(const T &object)
Write object according equation format.
Definition: JRootStreamer.hh:455
JStreamState.hh
JStreamAvailable
Test availability of stream operators.
Definition: JStreamAvailable.hh:46
JROOT::JRootWriter::put
JRootWriter & put(const std::string &key, const T &value, const JBool< true > option)
Write given key and value according equation format.
Definition: JRootStreamer.hh:627
JROOT::JRootReader::getObject
JRootReader & getObject(T &object)
Read object.
Definition: JRootStreamer.hh:155
JROOT::JRootReader::get
JRootReader & get(const JRootReadableClass &cls)
Read ROOT class according equation format.
Definition: JRootStreamer.hh:167
JROOT::JRootReader::getObject
JRootReader & getObject(T &object, const JBool< true > &option)
Read object.
Definition: JRootStreamer.hh:269
JROOT::JRootWriter::JDefaultHelper
Default helper class for formatting.
Definition: JRootStreamer.hh:341
JROOT::JRootDictionary_t
Type definition of ROOT based dictionary for ASCII O.
Definition: JRootDictionary_t.hh:30
JROOT::JRootReader::getDictionary
const JRootDictionary_t & getDictionary() const
Get dictionary.
Definition: JRootStreamer.hh:112
JLANG::JBool
Auxiliary template class for type bool.
Definition: JBool.hh:20
JRootDictionary_t.hh
JEquation.hh
JLANG::JEquationParameters
Simple data structure to support I/O of equations (see class JLANG::JEquation).
Definition: JEquationParameters.hh:20
JROOT::JObjectStreamer::put
virtual JRootWriter & put(JRootWriter &out, const std::string &prefix, const void *address) const
Stream output.
Definition: JRootStreamer.hh:786
JROOT::JRootReader::JHelper
Helper class for user formatting.
Definition: JRootStreamer.hh:84
JROOT::JRootReader
Implementation for ASCII input of objects with ROOT dictionary.
Definition: JRootStreamer.hh:52
JPARSER::fail
bool fail(std::istream &in)
Check for stream state.
Definition: JParser.hh:93
JROOT::JRootClass::getTypename
const char * getTypename() const
Get type name.
Definition: JRootClass.hh:192
JLANG::separator
std::ostream & separator(std::ostream &out)
Print separator.
Definition: JEquationFacet.hh:551
std
Definition: jaanetDictionary.h:36
JROOT::JRootWriter::put
JRootWriter & put(const std::string &key, const T &value)
Write given key and value according equation format.
Definition: JRootStreamer.hh:612
JROOT::JObjectStreamer
JObjectStreamer class.
Definition: JRootStreamer.hh:748
JROOT::JRootReader::getObject
JRootReader & getObject(const JRootReadableClass &cls)
Read ROOT class.
Definition: JRootStreamer.hh:212
JROOT::JRootWriter::putObject
JRootWriter & putObject(const JRootWritableClass &cls)
ROOT class output.
Definition: JRootStreamer.hh:564
JROOT::JRootWriter::put
JRootWriter & put(const std::string &key, const std::vector< JElement_t, JAllocator_t > &value, const JBool< false > option)
Write given key and value according equation format.
Definition: JRootStreamer.hh:674
JROOT::JRootReadableClass
ROOT class for reading object.
Definition: JRootClass.hh:526
JROOT::JRootWriter::JDefaultHelper::put
static JRootWriter & put(JRootWriter &writer, const std::string &key, const T &value)
Write given key and value according equation format.
Definition: JRootStreamer.hh:365
JLANG
Auxiliary classes and methods for language specific functionality.
Definition: JAbstractClass.hh:10
JROOT::JRootWriter::put
static JRootWriter & put(JRootWriter &writer, const std::string &key, const T &value)
Write given key and value according equation format.
Definition: JRootStreamer.hh:442
JEquationFacet.hh
JROOT::JRootWriter::putObject
static JRootWriter & putObject(JRootWriter &writer, const T &object)
Write object.
Definition: JRootStreamer.hh:427
JLANG::JEquationFacet::getPrefix
const std::string getPrefix(const std::string &prefix, const std::string &name) const
Get combined prefix for output.
Definition: JEquationFacet.hh:118
JLANG::JException
General exception.
Definition: JException.hh:23
JRootClass.hh
JROOT::JRootAddressableClass::find
JRootAddressableClass find(const char *name) const
Find addressable base class or data member with given name within current class.
Definition: JRootClass.hh:470