20 #ifndef TPIE_COMPRESSED_STREAM_POSITION_H
21 #define TPIE_COMPRESSED_STREAM_POSITION_H
78 uint64_t m_readOffset;
94 std::numeric_limits<uint64_t>::max() - 1,
95 std::numeric_limits<uint64_t>::max() - 1);
102 : m_readOffset(std::numeric_limits<uint64_t>::max())
103 , m_offset(std::numeric_limits<uint64_t>::max())
110 : m_readOffset(readOffset)
115 stream_size_type read_offset()
const {
128 void advance_items(memory_size_type
offset) {
132 void advance_item() {
138 return m_readOffset == other.m_readOffset
139 && m_offset == other.m_offset;
143 return !(*
this == other);
152 return (m_offset != other.m_offset)
153 ? (m_offset < other.m_offset)
154 : (m_readOffset < other.m_readOffset);
157 friend std::ostream & operator<<(std::ostream & s,
const stream_position & p) {
158 return s <<
"(" << p.read_offset() <<
"," << p.
offset() <<
")";
164 #endif // TPIE_COMPRESSED_STREAM_POSITION_H
bool operator<(const stream_position &other) const
Total ordering of stream_position objects.
static stream_position beginning()
Convenience constructor returning a pointer to the beginning.
Base class containing the implementation details that are independent of the item type...
POD object indicating the position of an item in a stream.
Useful compressed stream predeclarations.
stream_size_type offset() const
The stream offset of the item pointed to.
static stream_position end()
Special-value constructor returning a pointer to the end.
stream_position()
Default constructor resulting in a not-a-stream_position.