31 template <typename Adapter, typename AP> // Adapter and AllocationPolicy |
31 template <typename Adapter, typename AP> // Adapter and AllocationPolicy |
32 class StreamWriterHost : public MemoryWriterHost<Adapter, AP> { |
32 class StreamWriterHost : public MemoryWriterHost<Adapter, AP> { |
33 public: |
33 public: |
34 typedef typename Adapter::StorageType StorageType; |
34 typedef typename Adapter::StorageType StorageType; |
35 private: |
35 private: |
36 intptr_t _stream_pos; |
36 int64_t _stream_pos; |
37 fio_fd _fd; |
37 fio_fd _fd; |
38 intptr_t current_stream_position() const; |
38 int64_t current_stream_position() const; |
39 |
39 |
40 protected: |
40 protected: |
41 StreamWriterHost(StorageType* storage, Thread* thread); |
41 StreamWriterHost(StorageType* storage, Thread* thread); |
42 StreamWriterHost(StorageType* storage, size_t size); |
42 StreamWriterHost(StorageType* storage, size_t size); |
43 StreamWriterHost(Thread* thread); |
43 StreamWriterHost(Thread* thread); |
45 void bytes(void* dest, const void* src, size_t len); |
45 void bytes(void* dest, const void* src, size_t len); |
46 void flush(size_t size); |
46 void flush(size_t size); |
47 bool has_valid_fd() const; |
47 bool has_valid_fd() const; |
48 |
48 |
49 public: |
49 public: |
50 intptr_t current_offset() const; |
50 int64_t current_offset() const; |
51 void seek(intptr_t offset); |
51 void seek(int64_t offset); |
52 void flush(); |
52 void flush(); |
53 void write_unbuffered(const void* src, size_t len); |
53 void write_unbuffered(const void* src, size_t len); |
54 bool is_valid() const; |
54 bool is_valid() const; |
55 void close_fd(); |
55 void close_fd(); |
56 void reset(fio_fd fd); |
56 void reset(fio_fd fd); |