Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JReaderObjectIterator.hh
Go to the documentation of this file.
1#ifndef __JIO__JREADEROBJECTITERATOR__
2#define __JIO__JREADEROBJECTITERATOR__
3
6#include "JLang/JBool.hh"
8
9
10/**
11 * \author mdejong
12 */
13
14namespace JIO {}
15namespace JPP { using namespace JIO; }
16
17namespace JIO {
18
20
21
22 /**
23 * JReader object iterator.
24 *
25 * This class implements the JLANG::JObjectIterator interface.
26 */
27 template<class T>
30 {
31 public:
32 /**
33 * Constructor.
34 *
35 * \param reader reader input
36 */
38 in(reader)
39 {}
40
41
42 /**
43 * Set object.
44 *
45 * \param object reference to object to be set
46 * \return true if set; else false
47 */
48 virtual bool setObject(T& object) override
49 {
51 }
52
53 private:
54 bool setObject(T& object, JLANG::JBool<true>) { return (bool) object.read(in); }
55 bool setObject(T& object, JLANG::JBool<false>) { return (bool) (in >> object); }
56
58 };
59}
60
61#endif
virtual bool setObject(T &object) override
Set object.
JReaderObjectIterator(JReader &reader)
Constructor.
bool setObject(T &object, JLANG::JBool< true >)
bool setObject(T &object, JLANG::JBool< false >)
Interface for binary input.
Auxiliary classes and methods for binary I/O.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary template class for type bool.
Definition JBool.hh:21
Template class test for polymorphism.