DataIO.h

00001 /* This file is Copyright 2000-2008 Meyer Sound Laboratories Inc.  See the included LICENSE.txt file for details. */
00002 
00003 #ifndef MuscleDataIO_h
00004 #define MuscleDataIO_h
00005 
00006 #include "util/Socket.h"
00007 
00008 BEGIN_NAMESPACE(muscle);
00009  
00011 class DataIO : public RefCountable
00012 {
00013 public:
00015    enum {
00016       IO_SEEK_SET = 0,  
00017       IO_SEEK_CUR,      
00018       IO_SEEK_END,      
00019       NUM_IO_SEEKS      
00020    };
00021 
00023    DataIO() {/* empty */}
00024 
00026    virtual ~DataIO() {/* empty */}
00027 
00035    virtual int32 Read(void * buffer, uint32 size) = 0;
00036 
00045    virtual int32 Write(const void * buffer, uint32 size) = 0;
00046 
00059    virtual status_t Seek(int64 offset, int whence) = 0;
00060 
00065    virtual int64 GetPosition() const = 0;
00066 
00072    virtual uint64 GetOutputStallLimit() const {return MUSCLE_TIME_NEVER;}
00073 
00079    virtual void FlushOutput() = 0;
00080 
00085    virtual void Shutdown() = 0;
00086 
00099    virtual const SocketRef & GetSelectSocket() const = 0;
00100 
00114    virtual status_t GetReadByteTimeStamp(int32 whichByte, uint64 & retStamp) const {(void) whichByte; (void) retStamp; return B_ERROR;}
00115 
00123    virtual bool HasBufferedOutput() const {return false;}
00124 
00130    virtual void WriteBufferedOutput() {/* empty */}
00131 
00140    uint32 WriteFully(const void * buffer, uint32 size);
00141    
00150    uint32 ReadFully(void * buffer, uint32 size);
00151 
00158    virtual int64 GetLength();
00159 };
00160 
00161 typedef Ref<DataIO> DataIORef;
00162 
00163 END_NAMESPACE(muscle);
00164 
00165 #endif

Generated on Thu Jun 5 17:47:53 2008 for MUSCLE by  doxygen 1.5.1