3 #ifndef __ARC_DATABUFFER_H__ 4 #define __ARC_DATABUFFER_H__ 6 #include <arc/Thread.h> 7 #include <arc/data/DataSpeed.h> 39 unsigned long long int offset;
43 unsigned long long int eof_pos;
55 bool error_write_flag;
57 bool error_transfer_flag;
68 unsigned long long int offset;
72 std::list<checksum_desc> checksums;
78 operator bool()
const {
86 DataBuffer(
unsigned int size = 1048576,
int blocks = 3);
105 bool set(
CheckSum *cksum = NULL,
unsigned int size = 1048576,
135 bool for_read(
int& handle,
unsigned int& length,
bool wait);
153 bool is_read(
int handle,
unsigned int length,
154 unsigned long long int offset);
162 bool is_read(
char *buf,
unsigned int length,
163 unsigned long long int offset);
180 bool for_write(
int& handle,
unsigned int& length,
181 unsigned long long int& offset,
bool wait);
303 #endif // __ARC_DATABUFFER_H__
Arc namespace contains all core ARC classes.
Definition: ArcConfig.h:11
bool error()
Returns true if object was informed about error or internal error occurred.
bool wait_write()
Wait until end of transfer or error happens on 'write' side. Always returns true. ...
bool wait_read()
Wait until end of transfer or error happens on 'read' side. Always returns true.
char * operator[](int n)
Direct access to buffer by number.
bool wait_for_read()
Wait till no more buffers taken for "READING INTO" left in object.
bool is_written(int handle)
Informs object that data was written from buffer.
Keeps track of average and instantaneous transfer speed.
Definition: DataSpeed.h:20
bool error_transfer()
Returns true if transfer was slower than limits set in speed object.
bool wait_eof()
Wait until end of transfer happens on any side. Always returns true.
unsigned long long int eof_position() const
Returns offset following last piece of data transferred.
Definition: DataBuffer.h:291
bool error_read()
Returns true if object was informed about error on 'read' side.
bool for_write()
Check if there are buffers which can be taken by for_write().
bool is_notwritten(int handle)
Informs object that data was NOT written from buffer (and releases buffer).
bool for_read()
Check if there are buffers which can be taken by for_read().
int add(CheckSum *cksum)
Add a checksum object which will compute checksum of buffer.
Interface for checksum manipulations.
Definition: CheckSum.h:30
bool wait_used()
Wait till there are no more used buffers left in object.
Represents set of buffers.
Definition: DataBuffer.h:19
bool error_write()
Returns true if object was informed about error on 'write' side.
bool wait_eof_read()
Wait until end of transfer happens on 'read' side. Always returns true.
unsigned int buffer_size() const
Returns size of buffer in object.
bool wait_any()
Wait (max 60 sec.) till any action happens in object.
DataSpeed speed
This object controls transfer speed.
Definition: DataBuffer.h:76
const CheckSum * checksum_object() const
Returns first checksum object in checksum list or NULL if list is empty.
bool checksum_valid() const
Returns true if the checksum was successfully computed.
bool eof_read()
Returns true if object was informed about end of transfer on 'read' side.
bool wait_for_write()
Wait till no more buffers taken for "WRITING FROM" left in object.
DataBuffer(unsigned int size=1048576, int blocks=3)
Construct a new DataBuffer object.
bool eof_write()
Returns true if object was informed about end of transfer on 'write' side.
bool is_read(int handle, unsigned int length, unsigned long long int offset)
Informs object that data was read into buffer.
bool wait_eof_write()
Wait until end of transfer happens on 'write' side. Always returns true.