23 #ifndef ADF_FrameBlock
39 {
SetEoB(
true);
return false;}
44 {
SetEoB(
true);
return false;}
71 if ( opt_link_or_copy ==
'l' )
77 if ( opt_rewind ==
'r' )
100 Bool_t add_ok =
true;
164 fCurrentSize = 0u; fMaxSize =
kMaxUInt_t; fFile = 0x0;
174 UInt_t lengthkey = key->
GetKeyLength(), lengthkeyread, lengthdata, lengthdataread;
180 if ( lengthkeyread != lengthkey ) {
184 else fCurrentSize += lengthkeyread;
191 if ( lengthdata != 0u ) {
195 if ( lengthdataread != lengthdata )
196 {
SetEoB(
true);
return false; }
198 else {
SetEoB(
true);
return false; }
201 fCurrentSize += lengthdataread;
214 ok = ext_frame.
Export(fFile,ext_frame.
Size()) ?
true :
false;
216 fCurrentSize += ext_frame.
Size();
237 if ( size <= (fMaxSize-fCurrentSize) )
249 virtual Bool_t Expand(UInt_t);
258 virtual Bool_t Reserve(UInt_t, Bool_t =
false, UInt_t = 0u);
virtual const BufferIO * GetRealBuffer() const
virtual Bool_t NextFrame(Key *)
return true if there is a new frame available (in reading mode)
virtual Key * GetKey()=0
To get the Key associated to this frame.
virtual void Rewind(ConfAgent::EMode mode=ConfAgent::kRead)
Rewind to be ready to be used again.
virtual Bool_t SetBlock(Char_t *=0x0, UInt_t=0u, char= 'r', char= 'l', UInt_t=0u)
Attach a external block to this.
header file for FrameBlock.cpp
virtual Bool_t Link(const Char_t *from, UInt_t from_size)
Link an external buffer to this class.
virtual Bool_t Reserve(UInt_t, Bool_t=false, UInt_t=0u)
check if enough place to write something (writing mode)
Bool_t IsMode(ConfAgent::EMode mode) const
virtual const BufferIO * GetRealBuffer() const =0
give access to the underlying buffer of the data part
virtual Bool_t Reserve(UInt_t, Bool_t=false, UInt_t=0u)
check if enough place to write something (writing mode)
FileBlock(UInt_t size=aMByte, ConfAgent::EMode mode=ConfAgent::kRead)
EMode
Operating mode for frame IO.
virtual UInt_t GetDataLength() const
ConfAgent::EMode GetModeIO() const
Return the operating mode.
virtual void SetModeIO(ConfAgent::EMode mode)
virtual Bool_t AddFrame(const BufferIO &, UInt_t i=0u)
Add a Frame to the block.
virtual Char_t * Unlink()
Unlink the external buffer to this class.
virtual Bool_t Export(BufferIO &buf) const =0
Export the content of the frame in a buffer.
UInt_t Offset() const
it returns the current position in the buffer
UInt_t Size() const
it returns the maximum number of bytes in this buffer
virtual UInt_t GetKeyLength() const
Unique number corresponding to a type of Key.
virtual Bool_t AddFrame(const BufferIO &, UInt_t i=0u)
Add a Frame to the block.
UInt_t FreeSize() const
it returns the number of free bytes to the end
virtual UInt_t Export(Char_t *, UInt_t) const
Export this buffer to an array.
virtual Bool_t Copy(const Char_t *from, UInt_t from_size)
copy an external buffer to this.
BufferIO fBuffer
The buffer to look for Frames.
virtual Bool_t NextFrame(Key *)
Read next frame from file.
virtual UInt_t GetLength() const =0
total length for that frame
virtual Bool_t Expand(UInt_t new_size)
Expand the size of the current buffer.
BufferIO fFrame
to wrap the current Frame
virtual Bool_t Link(const Char_t *, UInt_t)
Link an external buffer to this key.
UInt_t SetEffectiveSize(UInt_t size=kMaxUInt_t)
in case the buffer is partly filled and you would like to read it again
UInt_t Import(const Char_t *from, UInt_t size_ext_buf)
Import the given array in this buffer.
NarvalBlock(UInt_t size=aByte)
virtual Bool_t Expand(UInt_t)
implements Expand method
virtual Bool_t Expand(UInt_t)
This kind of Block is not expandable.
virtual Bool_t Expand(UInt_t)
This kind of Block is not expandable.
It implements an in-memory block of Frames.
virtual UInt_t GetFrameLength() const
virtual Bool_t Reserve(UInt_t, Bool_t=false, UInt_t=0u)
check if enough place to write something (writing mode)
UInt_t SetOffset(UInt_t off=0u) const
change the current position.