Jpp  19.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JReaderObjectIterator.hh
Go to the documentation of this file.
1 #ifndef __JIO__JREADEROBJECTITERATOR__
2 #define __JIO__JREADEROBJECTITERATOR__
3 
5 #include "JLang/JConversion.hh"
6 #include "JLang/JBool.hh"
7 #include "JIO/JSerialisable.hh"
8 
9 
10 /**
11  * \author mdejong
12  */
13 
14 namespace JIO {}
15 namespace JPP { using namespace JIO; }
16 
17 namespace JIO {
18 
20 
21 
22  /**
23  * JReader object iterator.
24  *
25  * This class implements the JLANG::JObjectIterator interface.
26  */
27  template<class T>
29  public JAbstractObjectIterator<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.
Auxiliary template class for type bool.
Definition: JBool.hh:20
do set_variable OUTPUT_DIRECTORY $WORKDIR T
Template class test for polymorphism.
Definition: JConversion.hh:22
Interface for binary input.
bool setObject(T &object, JLANG::JBool< false >)
bool setObject(T &object, JLANG::JBool< true >)
JReader object iterator.