Go to the documentation of this file.00001
00002 #ifndef vil_stream_h_
00003 #define vil_stream_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007
00008
00009
00010
00011
00012
00013 #include <vxl_config.h>
00014 #include <vcl_atomic_count.h>
00015
00016 #if VXL_HAS_INT_64
00017 typedef vxl_int_64 vil_streampos;
00018 #else //VXL_HAS_INT_64
00019 typedef vxl_int_32 vil_streampos;
00020 #endif //VXL_HAS_INT_64
00021
00022
00023
00024 class vil_stream
00025 {
00026 public:
00027
00028 virtual bool ok() const = 0;
00029
00030
00031
00032 virtual vil_streampos write(void const* buf, vil_streampos n) = 0;
00033
00034
00035
00036 virtual vil_streampos read(void* buf, vil_streampos n) = 0;
00037
00038
00039 virtual vil_streampos tell() const = 0;
00040
00041
00042 virtual void seek(vil_streampos position) = 0;
00043
00044
00045 virtual vil_streampos file_size() const = 0;
00046
00047
00048 void ref() { ++refcount_; }
00049
00050 void unref();
00051
00052 protected:
00053 vil_stream();
00054 virtual ~vil_stream();
00055
00056 private:
00057 vcl_atomic_count refcount_;
00058 };
00059
00060 #endif // vil_stream_h_