29 #ifndef CDPL_UTIL_COMPRESSEDDATAREADER_HPP
30 #define CDPL_UTIL_COMPRESSEDDATAREADER_HPP
58 template <
typename ReaderImpl,
typename DecompStream,
typename DataType =
typename ReaderImpl::DataType>
120 operator const void*()
const;
143 template <
typename ReaderImpl,
typename DecompStream,
typename DataType>
145 stream(is), reader(stream)
147 reader.setParent(
this);
151 template <
typename ReaderImpl,
typename DecompStream,
typename DataType>
155 reader.
read(obj, overwrite);
160 template <
typename ReaderImpl,
typename DecompStream,
typename DataType>
164 reader.
read(idx, obj, overwrite);
169 template <
typename ReaderImpl,
typename DecompStream,
typename DataType>
178 template <
typename ReaderImpl,
typename DecompStream,
typename DataType>
181 return reader.hasMoreData();
184 template <
typename ReaderImpl,
typename DecompStream,
typename DataType>
187 return reader.getRecordIndex();
190 template <
typename ReaderImpl,
typename DecompStream,
typename DataType>
193 reader.setRecordIndex(idx);
196 template <
typename ReaderImpl,
typename DecompStream,
typename DataType>
199 return reader.getNumRecords();
202 template <
typename ReaderImpl,
typename DecompStream,
typename DataType>
205 return reader.operator
const void*();
208 template <
typename ReaderImpl,
typename DecompStream,
typename DataType>
211 return reader.operator!();
214 template <
typename ReaderImpl,
typename DecompStream,
typename DataType>
Definition of I/O-stream classes capable of performing compression and decompression.
Definition of class CDPL::Base::DataReader.
void invokeIOCallbacks(double progress) const
Invokes all registered I/O callback functions with the argument *this.
Interface for reading data objects of a given type from an arbitrary data source.
Definition: DataReader.hpp:73
typename ReaderImpl::DataType DataType
The type of the read data objects.
Definition: DataReader.hpp:79
Adapter that wraps a stream-based reader with a decompression stream to read records from a compresse...
Definition: CompressedDataReader.hpp:60
CompressedDataReader & read(DataType &obj, bool overwrite=true)
Reads the next data record into obj.
Definition: CompressedDataReader.hpp:153
bool hasMoreData()
Tells whether more records are available.
Definition: CompressedDataReader.hpp:179
void setRecordIndex(std::size_t idx)
Sets the index of the next data record to be read.
Definition: CompressedDataReader.hpp:191
CompressedDataReader & skip()
Skips the next data record.
Definition: CompressedDataReader.hpp:171
bool operator!() const
Tells whether the reader is in a bad state.
Definition: CompressedDataReader.hpp:209
CompressedDataReader(std::istream &is)
Constructs a CompressedDataReader instance reading from the input stream is.
Definition: CompressedDataReader.hpp:144
void close()
Closes the wrapped reader and the decompression stream.
Definition: CompressedDataReader.hpp:215
std::size_t getNumRecords()
Returns the total number of records in the input stream.
Definition: CompressedDataReader.hpp:197
std::size_t getRecordIndex() const
Returns the index of the current data record.
Definition: CompressedDataReader.hpp:185
The namespace of the Chemical Data Processing Library.