XRootD
IXrdCephBufferAlg.hh
Go to the documentation of this file.
1 #ifndef __IXRD_CEPH_BUFFER_ALG_HH__
2 #define __IXRD_CEPH_BUFFER_ALG_HH__
3 //------------------------------------------------------------------------------
4 // Interface of the logic part of the buffering
5 // Intention to be able to abstract the underlying implementation and code against the inteface
6 // e.g. for different complexities of control.
7 // Couples loosely to IXrdCepgBufferData and anticipated to be called by XrdCephOssBufferedFile.
8 // Should managage all of the IO and logic to give XrdCephOssBufferedFile only simple commands to call.
9 // implementations are likely to use (via callbacks?) CephPosix library code for actual reads and writes.
10 //------------------------------------------------------------------------------
11 
12 #include <sys/types.h>
13 #include "IXrdCephBufferData.hh"
14 #include "ICephIOAdapter.hh"
15 
16 class XrdSfsAio;
17 
18 namespace XrdCephBuffer {
19 
27  public:
28  virtual ~IXrdCephBufferAlg() {}
29 
30  virtual ssize_t read_aio (XrdSfsAio *aoip) = 0;
31  virtual ssize_t write_aio(XrdSfsAio *aoip) = 0;
32 
33  virtual ssize_t read (volatile void *buff, off_t offset, size_t blen) = 0;
34  virtual ssize_t write(const void *buff, off_t offset, size_t blen) = 0;
35  virtual ssize_t flushWriteCache() = 0;
36 
37 
38  protected:
39 
40 
41  private:
42 
43 };
44 
45 }
46 
47 #endif
Interface to a holder of the main logic decisions of the buffering algortithm, decoupled from the buf...
virtual ssize_t write(const void *buff, off_t offset, size_t blen)=0
write data through the buffer
virtual ssize_t read(volatile void *buff, off_t offset, size_t blen)=0
read data through the buffer
virtual ssize_t flushWriteCache()=0
remember to flush the cache on final writes
virtual ssize_t read_aio(XrdSfsAio *aoip)=0
possible aio based code
virtual ssize_t write_aio(XrdSfsAio *aoip)=0
possible aio based code
is a simple implementation of IXrdCephBufferData using std::vector<char> representation for the buffe...
Definition: BufferUtils.hh:29