15 #ifndef THRILL_CORE_DELTA_STREAM_HEADER 16 #define THRILL_CORE_DELTA_STREAM_HEADER 26 template <
typename StreamWriter,
typename Type, Type offset_ = Type()>
31 StreamWriter& writer,
const Type& initial =
Type())
35 assert(value >=
delta_ + offset_);
51 template <
typename StreamReader,
typename Type, Type offset_ = Type()>
56 StreamReader& reader,
const Type& initial =
Type())
57 : reader_(reader),
delta_(initial) { }
60 return reader_.HasNext();
63 template <
typename Type2>
66 Type value = reader_.template Next<Type>();
84 #endif // !THRILL_CORE_DELTA_STREAM_HEADER
StreamReader & reader_
output reader
DeltaStreamReader(StreamReader &reader, const Type &initial=Type())
void Put(const Type &value)
DeltaStreamWriter(StreamWriter &writer, const Type &initial=Type())
Type delta_
delta for output
StreamWriter & writer_
output writer