Jpp  19.1.0-rc.1
the software that should make you happy
JBinaryFileReader.hh
Go to the documentation of this file.
1 #ifndef __JIO__JBINARYFILEREADER__
2 #define __JIO__JBINARYFILEREADER__
3 
4 #include <istream>
5 
8 #include "JLang/JConversion.hh"
9 
10 #include "JIO/JStreamIO.hh"
12 
13 
14 /**
15  * \author mdejong
16  */
17 
18 namespace JIO {}
19 namespace JPP { using namespace JIO; }
20 
21 namespace JIO {
22 
25  using JLANG::JNullAccess;
27 
28 
29  /**
30  * Object reading from binary file (i.e.\ .jpp).
31  */
32  template<class T, const bool = JLANG::JConversion<T,JSerialisable>::is_derived>
34 
35  /**
36  * Template specialisation of JBinaryFileReader for serialisable data types.
37  *
38  * This class provides for an implementation of the JLANG::JAccessibleObjectIterator interface.
39  */
40  template<class T>
41  class JBinaryFileReader<T, true> :
42  public JAccessibleObjectIterator<T>,
44  public JStreamReader,
45  public JReaderObjectIterator<T>
46  {
47  public:
48  /**
49  * Default constructor.
50  */
53  JStreamReader (static_cast<std::istream&> (*this)),
54  JReaderObjectIterator<T>(static_cast<JStreamReader&>(*this))
55  {}
56  };
57 
58 
59  /**
60  * Template specialisation of JBinaryFileReader for unserialisable data types.
61  *
62  * This class provides for a null implementation of the JLANG::JAccessibleObjectIterator interface.
63  */
64  template<class T>
65  class JBinaryFileReader<T, false> :
66  public JAccessibleObjectIterator<T>,
67  public JNullAccess,
68  public JNullIterator<T>
69  {};
70 }
71 
72 #endif
JBinaryFileReader()
Default constructor.
Object reading from binary file (i.e. .jpp).
JReader object iterator.
Binary input based on std::istream.
Definition: JStreamIO.hh:26
Accessible binary input stream.
Interface for object iteration with named access.
Interface for null access.
Definition: JAccessible.hh:67
Auxiliary classes and methods for binary I/O.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JSTDTypes.hh:14
Implementation for null iteration.