/* */ #ifndef _D_SEGMENT_H_ #define _D_SEGMENT_H_ #include "common.h" class Piece; extern typedef SharedHandle PieceHandle; class Segment { public: virtual ~Segment() {} virtual bool complete() const = 0; virtual int32_t getIndex() const = 0; virtual int64_t getPosition() const = 0; virtual int64_t getPositionToWrite() const = 0; virtual int32_t getLength() const = 0; virtual int32_t getSegmentLength() const = 0; virtual int32_t getWrittenLength() const = 0; virtual int32_t getOverflowLength() const = 0; virtual void updateWrittenLength(int32_t bytes) = 0; virtual void clear() = 0; virtual PieceHandle getPiece() const = 0; }; typedef SharedHandle SegmentHandle; typedef deque Segments; #endif // _D_SEGMENT_H_