1 #ifndef __XRD_CEPH_BUFFER_DATA_SIMPLE_HH__
2 #define __XRD_CEPH_BUFFER_DATA_SIMPLE_HH__
28 virtual size_t capacity()
const override;
29 virtual size_t length()
const override;
30 virtual void setLength(
size_t len)
override;
31 virtual bool isValid()
const override;
38 virtual ssize_t
readBuffer(
void* buf, off_t offset,
size_t blen)
const override;
41 virtual ssize_t
writeBuffer(
const void* buf, off_t offset,
size_t blen, off_t externalOffset=0)
override;
Interface to the Buffer's physical representation. Allow an interface to encapsulate the requirements...
Implementation of a buffer using a simple vector<char> Simplest implementation of a buffer using vect...
virtual ssize_t readBuffer(void *buf, off_t offset, size_t blen) const override
set cache into an invalid state
virtual off_t setStartingOffset(off_t offset) override
std::atomic< long > m_stats_write_req
long m_stats_read_longest
virtual bool isValid() const override
Currently occupied and valid space, which may be less than capacity.
virtual size_t capacity() const override
long m_stats_write_longest
std::atomic< long > m_stats_read_req
virtual off_t startingOffset() const override
size_t m_bufLength
what does the first byte of the buffer map to for external offsets
std::atomic< long > m_stats_write_bytes
XrdCephBufferDataSimple(size_t bufCapacity)
std::atomic< long > m_stats_read_bytes
virtual ssize_t invalidate() override
copy data from the internal buffer to buf
bool m_valid
the buffer size
std::atomic< long > m_stats_write_timer
virtual void * raw() override
virtual void setValid(bool isValid) override
virtual const void * raw() const override
write data into the buffer, store the external offset if provided
virtual ~XrdCephBufferDataSimple()
virtual ssize_t writeBuffer(const void *buf, off_t offset, size_t blen, off_t externalOffset=0) override
set cache into an invalid state; do this before writes to be consistent
static std::atomic< long > m_total_memory_nbuffers
total number of buffers actively open
static std::atomic< long > m_total_memory_used
total memory of all these buffers
virtual size_t length() const override
total available space
virtual void setLength(size_t len) override
Currently occupied and valid space, which may be less than capacity.
std::atomic< long > m_stats_read_timer
length of valid stored data; might be less than the capacity
std::vector< char > m_buffer
is a simple implementation of IXrdCephBufferData using std::vector<char> representation for the buffe...