25 #define ADF_FRAME_H ADF_Frame
31 #ifndef ADF_FrameFactory
45 class ConfigurationFrame;
97 { fSignature = item ; }
121 { fCheckLevel = checklevel; }
124 {
return fCheckLevel; }
128 {
return fSignature; }
155 virtual Bool_t
Link(
const Char_t *, UInt_t,
const char =
'b') = 0;
160 virtual Bool_t
Copy(
const Char_t *, UInt_t,
const char =
'b') = 0;
168 virtual Bool_t
Link(
const BufferIO &, UInt_t ,
const char =
'b') = 0;
171 virtual void Unlink() = 0;
174 virtual Bool_t
IsLinked()
const = 0;
279 virtual void Reset() = 0;
288 virtual void Dump(
const Char_t *filename, Bool_t anew =
false)
const = 0;
289 virtual Bool_t
Dump(FILE *)
const = 0;
292 virtual Bool_t
Load(FILE *) = 0;
299 virtual void Stallion(UInt_t repetition = 4u) = 0;
302 virtual Bool_t
Configure(
const char *name,
const char *option);
374 virtual Bool_t
Link(
const Char_t *buf, UInt_t
size,
const char opt =
'b')
387 virtual Bool_t
Copy(
const Char_t *buf, UInt_t
size,
const char opt =
'b')
411 virtual Bool_t
Link(
const BufferIO &buf, UInt_t pos,
const Char_t opt =
'b')
538 virtual void Dump(
const Char_t *filename, Bool_t anew =
false)
const ;
539 virtual Bool_t
Dump(FILE *)
const;
542 virtual Bool_t
Load(FILE *);
549 virtual void Stallion(UInt_t repetition = 4u);
613 {
if (fFrame)
delete fFrame ; fFrame = 0x0; }
620 { fIsValid = validity; }
632 {
return fKeyChange(item_from,item_to); }
638 {
return fKeyChange; }
644 {
return fFrameChange(item_from,item_to); }
647 { fFrameChange = pf; }
650 {
return fFrameChange; }
virtual const Key * GetSubKey(UInt_t) const =0
Returns one of the sub-key in case this is a composite frame.
virtual UInt_t GetLength() const
total length for that frame
virtual BufferIO * RealBuffer()
virtual Bool_t IsValid() const
true if it is a valid pointer
virtual Bool_t Copy(const Char_t *buf, UInt_t size, const char opt= 'b')
copy a buffer to this Frame
virtual Key * GetKey()=0
To get the Key associated to this frame.
void SetStatus(BufferIO::EStatus s=BaseBuffer::kGood)
virtual Frame * GetFrame() const
BufferIO::EStatus GetStatus() const
virtual Bool_t TransfertSubFrame(const Frame &, UInt_t)
copy the sub-frame #i to the Frame given in the second argument
Base class for a FrameFactory.
virtual Bool_t AddSubFrame(const Frame &)
Add a subframe to that frame (only if composite)
virtual void Unlink()
Copy a buffer to this Frame.
virtual UInt_t Read()
It reads the content into dedicated structures from the Frame (data part)
virtual Bool_t Link(const Char_t *from, UInt_t from_size)
Link an external buffer to this class.
virtual Bool_t Export(BufferIO &buf) const
Export the content of the frame in a buffer.
virtual void FastReset()=0
FastReset the current frame, means the data part keep the previous values.
virtual Bool_t CopyKey(const Char_t *buf, UInt_t size)
virtual void Reset()
Reset means set all elements to 0 and the current position is 0.
virtual Bool_t IsComposite() const
tells if this frame is a composite frame i.e. if it is composed of sub-frames
virtual Bool_t Link(const BufferIO &buf, UInt_t pos, const Char_t opt= 'b')
copy a buffer to this Frame
virtual Bool_t IsLinked() const
virtual Bool_t ExportData(BufferIO &buf) const
Export the content of the frame (data part only) in a buffer.
A configuration frame is just an encapsulation of a string.
virtual Bool_t Copy(const Char_t *, UInt_t)
Copy an external buffer to this key.
virtual Bool_t Load(FILE *)
load a Frame from a C file (for debugging) - return the number of bytes read
Bool_t IsKeyChangeable(FactoryItem item_from, FactoryItem item_to) const
true if for that Frame the key modification proposed is acceptable
virtual const BufferIO * GetRealBuffer() const =0
give access to the underlying buffer of the data part
virtual void Dump(const Char_t *filename, Bool_t anew=false) const
Dump the content of the frame in a file (for debugging)
virtual Bool_t LinkFrame(const Char_t *buf, UInt_t size)
virtual Bool_t IsLinked() const
true if the underlying buffers have been linked.
virtual Key * GetKey()
To get the Key associated to this frame.
virtual const Key * GetKey() const
To get the Key associated to this frame.
virtual UInt_t GetDataLength() const
virtual Bool_t Link(const Char_t *buf, UInt_t size, const char opt= 'b')
Link a buffer to this Frame.
virtual void SetFrameChangeFunction(PF_FactoryItemChange pf)
virtual Bool_t ExportData(BufferIO &buf) const =0
Export the content of the frame (data part only) in a buffer.
Bool_t(* PF_FactoryItemChange)(const FactoryItem &, const FactoryItem &)
prototype function to control the evolution of a factory item.
virtual Bool_t IsLinked()
check if this is linked or not
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.
virtual void SetValid(Bool_t validity)
true if it is a valid pointer
const PF_FactoryItemChange & GetKeyChangeFunction() const
virtual UInt_t Scan()
Scan this Frame. If it is a composite frame, it looks for the keys of sub-frames. ...
virtual Bool_t IsComposite() const
tells if this frame is a composite frame i.e. if it is composed of sub-frames
virtual const Key * GetSubKey(UInt_t) const
Returns one of the sub-key in case this is a composite frame.
virtual Bool_t Configure(const char *name, const char *option)
configuration from/to a file
void SetSignature(FactoryItem item)
to change the signature of that frame
virtual void Stallion(UInt_t repetition=4u)
Fill the frame with a given pattern (used for debugging)
virtual BaseBuffer::EStatus GetFrameStatus() const
To get the current status of this frame.
virtual UInt_t GetNbSubFrame() const
Returns the number of sub-frames composing this frame. Scan have to be called first.
virtual UInt_t GetKeyLength() const
Unique number corresponding to a type of Key.
virtual void ClearFrameStatus()
To clear to kGood the current status of this frame.
virtual void Reset()
copy the sub-frame #i to the Frame given in the second argument
virtual Bool_t CopyFrame(const Char_t *buf, UInt_t size)
virtual UInt_t Write()
It just set the size of the frame from the current position in the buffer.
virtual void Unlink()=0
UnLink a buffer to this Frame.
virtual BaseBuffer::EStatus GetFrameStatus() const =0
To get the current status of this frame.
A RawFrame gives direct access to the underlying buffer.
virtual UInt_t Write()
It writes to the Frame the content of the dedicated structures.
virtual Bool_t Copy(const Char_t *from, UInt_t from_size)
copy an external buffer to this.
virtual UInt_t Read()
It just returns the current size of the buffer.
virtual BufferIO & RawBuffer()
This method gives access in reading/writing mode to the underlying data buffer.
Frame()
To avoid direct creation of a Frame.
virtual UInt_t GetLength() const =0
total length for that frame
virtual Bool_t DoConfigure(std::ostream &)
write the configuration in an output stream
virtual Bool_t Export(BufferIO &buf) const
to copy the content of the key to an external buffer
virtual const BufferIO * GetRealBuffer() const
give access to the underlying buffer of the data part
virtual Short_t GetCheckLevel() const
virtual Bool_t Link(const Char_t *, UInt_t)
Link an external buffer to this key.
virtual void Reset()=0
Reset the current frame.
virtual Bool_t LinkSubFrame(UInt_t, Frame *)
Attach the sub-frame corresponding to the given subkey # to the Frame given in the second argument...
virtual Frame * SetFrame(Frame *)
change the frame, returns the current one
virtual void Stallion(UInt_t repetition=4u)=0
Fill the frame with a given pattern (used for ADF test)
virtual void Unlink()
Unlink the buffer attached to this key.
virtual Bool_t Copy(const Char_t *, UInt_t, const char= 'b')=0
copy a buffer to this Frame
virtual void SetCheckLevel(Short_t checklevel)
The number of tests (and the speed !) once writing/reading in Frame increase with this level...
virtual void SetKeyChangeFunction(PF_FactoryItemChange pf)
Bool_t IsFrameChangeable(FactoryItem item_from, FactoryItem item_to) const
true if for that Frame the frame modification proposed is acceptable
virtual Bool_t Link(const Char_t *, UInt_t, const char= 'b')=0
Link a buffer to this Frame.
UInt_t Import(const Char_t *from, UInt_t size_ext_buf)
Import the given array in this buffer.
virtual void ClearFrameStatus()=0
To clear to kGood the current status of this frame.
virtual void Dump(const Char_t *filename, Bool_t anew=false) const =0
Dump the content of the frame in a file (for debugging)
EStatus
Status for this buffer.
virtual Bool_t IsASubFrame(const Frame &)
to check if a subframe could be added to the composite frame
virtual Bool_t Load(FILE *)=0
load a Frame from a C file (for debugging)
virtual UInt_t Scan()
Scan this Frame. If it is a composite frame, it looks for the keys of sub-frames. ...
virtual Bool_t AddSubFrame(const Frame &)
Add a subframe to that frame (only if composite)
virtual Bool_t LinkKey(const Char_t *buf, UInt_t size)
header file for FrameFactory.cpp
virtual UInt_t GetNbSubFrame() const
Returns the number of sub-frames composing this frame. Scan have to be called first.
virtual Bool_t DoConfigure(std::istream &)
configure this from an input stream
virtual Bool_t IsLinked() const =0
true if the underlying buffers have been linked.
virtual void FastReset()
FastReset the current frame, means the data part keep the previous values.
virtual Bool_t LinkSubFrame(UInt_t, Frame *)
Attach the sub-frame corresponding to the given subkey to the Frame given in the second argument...
virtual UInt_t GetFrameLength() const
const PF_FactoryItemChange & GetFrameChangeFunction() const
Base class that described an item in a Factory.
const FactoryItem & GetSignature() const
Signature of that frame.
UInt_t SetOffset(UInt_t off=0u) const
change the current position.