GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ADF::DFAgent Class Reference

A DFAgent contains all the information concerning the structure of the data flow. More...

#include <DFAgent.h>

Inheritance diagram for ADF::DFAgent:

Public Member Functions

virtual void AddConf (DotConf *)
 add a conf object to this. The added objects are not owned by this so not deleted. More...
 
void AddKnownFrame (const Frame *frame, const Char_t opt= '+')
 to add a known frame (used when building the list of known frames) More...
 
virtual Bool_t Configure (ConfigurationFrame *, const char *option="in", Bool_t allow_init=false)
 configuration from/to a configuration frame : extact string from the frame and call DoConfigure More...
 
virtual Bool_t Configure (const char *name, const char *option="in", Bool_t allow_init=true)
 configuration from/to a file : open the file and call DoConfigure More...
 
 DFAgent (const Char_t *rid, const Char_t *srid, Bool_t is_record=true, Bool_t global=true)
 in case global is true, it keeps a list of pointers to the global factories otherwise asked for Clones of them More...
 
virtual Bool_t DoConfigure (std::istream &in, Bool_t allow_init)
 configure this from an input stream More...
 
virtual Bool_t DoConfigure (std::ostream &)
 write the configuration in an output stream More...
 
const FactoryItemGetAutoConfFrame () const
 
const FactoryItemGetAutoConfKey () const
 To get the definition of the Key and Frame associated to a global reconfiguration. More...
 
const Char_t * GetComment () const
 
BaseBuffer::EEndian GetEndian () const
 
const Char_t * GetLastModif () const
 
const std::list< std::pair
< FactoryItem, FactoryItem > > & 
GetListOfKnownFrames () const
 to just browse the list of known frame More...
 
Short_t GetMaxVersion () const
 this class could managed moddification of the versionned part up to MaxVersion : should be set in the constructor part of the inheriting class More...
 
ConfAgent::EModel GetModel () const
 
const FactoryItemGetPrimaryKey () const
 Just to know if the size of the frame is coded on 2 bytes, 4 bytes ... or 8 bytes. More...
 
virtual const Char_t * GetRID () const
 to get the record id More...
 
virtual const Char_t * GetSRID () const
 to get the record id More...
 
virtual const Char_t * GetStreamOption () const
 get/set option More...
 
virtual Short_t GetVersion () const
 to get the curent version of this object More...
 
UShort_t IsAKnownFrame (const FactoryItem &kit, const FactoryItem &fit, PF_FactoryItemChange kch=ChangeOfVersion, PF_FactoryItemChange fch=ChangeOfVersion) const
 To know if a Frame is known by the Agent under the conditions given. More...
 
Bool_t IsWithRecord () const
 to know if this is intialisased with a stream composed of records. More...
 
virtual void RemoveConf (DotConf *aconf=0x0)
 
virtual void Reset (const Char_t *opt="")
 Reset : all values are set to default. More...
 
Bool_t SetAsCompatibleFrameItem (FactoryItem &factory_item) const
 Take the item and prepare it to be an item related to the is agent i.e. set the factory version # and pointer as referenced in the list of required factory. More...
 
Bool_t SetAsCompatibleItems (FactoryItem &factory_key_item, FactoryItem &factory_frame_item) const
 change both item as the same time More...
 
Bool_t SetAsCompatibleKeyItem (FactoryItem &factory_item) const
 Take the item and prepare it to be an item related to the is agent i.e. set the factory version # and pointer as referenced in the list of required factory. More...
 
void SetComment (const Char_t *comment)
 
void SetEndian (BaseBuffer::EEndian)
 
Bool_t SetKnownFrameFactory (const FactoryItem &factory_item)
 check if the factory is referenced by the agent. More...
 
Bool_t SetKnownKeyFactory (const FactoryItem &factory_item)
 check if the factory is referenced by the agent. More...
 
void SetModel (ConfAgent::EModel model)
 
void SetPrimaryKey (const FactoryItem &item)
 to set the definition of the Keys for input More...
 
virtual void SetRID (const Char_t *rid, const Char_t *srid="")
 to set the record id More...
 
virtual void SetStreamOption (const Char_t *opt)
 
void SetWithRecord (Bool_t is_record=true)
 to change the behavior More...
 
FactoryItem WhichKnownFrame (const FactoryItem &kit, const FactoryItem &fit, PF_FactoryItemChange kch=ChangeOfVersion, PF_FactoryItemChange fch=ChangeOfVersion) const
 To get the exact definition of a key and a Frame. More...
 
FactoryItem WhichKnownKey (const FactoryItem &kit, const FactoryItem &fit, PF_FactoryItemChange kch=ChangeOfVersion, PF_FactoryItemChange fch=ChangeOfVersion) const
 
virtual ~DFAgent ()
 

Protected Member Functions

void AddKnownFrame (const FactoryItem &item_key, const FactoryItem &item_frame, const Char_t opt= '+')
 internal use to avoid adding a definition of a Frame that cannot be allocated More...
 
Bool_t AddRecord (std::ostream &, char t= 'b')
 Add a begin or end of record, return true if done. More...
 
std::string BeginOfRecord ()
 string that gives a start of record for this object More...
 
std::string EndOfRecord ()
 string that gives an end of record for this object More...
 
FrameFactoryGetFrameFactory (const FactoryItem &item)
 look in the DFAgent list if this factory exist and with a version # greater that the given one More...
 
KeyFactoryGetKeyFactory (const FactoryItem &item)
 look in the DFAgent list if this factory exist and with a version # greater that the given one More...
 
Bool_t IsBeginOfRecord (const std::string &, Bool_t allow_init)
 Return true if this string is a begin of record and call Reset if Init is found. More...
 
Bool_t IsEndOfRecord (const std::string &)
 Return true if this string is an end of record. More...
 
virtual Bool_t ProcessLine (const std::string &)
 decode an input line to configure/reconfigure this DFAgent More...
 
void SetLastModif ()
 set in last modif string the current date. More...
 
void SetMaxVersion (Short_t v)
 
void SetVersion (Short_t v)
 

Protected Attributes

LogMessage fLog
 the log messenger ... to know the object hae been properly intitialised/modified More...
 

Detailed Description

A DFAgent contains all the information concerning the structure of the data flow.

The DFAgent is in charge of keeping all the informations concerning the structrure of the data flow at a given point

For instance it is the place to store the endian type of the data flow. It could be also the default size of a block in case the DF in composed of fixed blocks.

The model corresponds to the way the data flow is manipulated, for instance if the input data are consumed or not.

The primary key is used to know the number of bytes (2 bytes, short or 4 bytes, integer) used to read the length of the frames.

The other part are more specific to the data flow itsel. It corresponds to the full definition of the Frame that reconfigures completely the data flow and the list of Frame, with their version number, expected on the data flow.

It keeps also a list of factories. By default this is the list of the global factories found in the MainFactory once a DFAgent is created

In a complex topology, the situation could be different at one point to the data flow compared to another one. It is then mandatory to have at least one DFAgent per local point (per actor or data flow line). As well reconfiguration of one agent could occur from a Configuration Frame requiring a local agent. Having local agents helps also to be safer in muti-threading mode.

Local agents are at the beginning clones of the global agent. As for the agent it requires then to have a clone of the factories. This is done by the user, who knows which agent is local or global, by calling the constructor with the option global = false. The Cloned factories belong to the main factories so they are no deleted here. In case of reconfiguration, only the cloned factories are reconfigured which helps for consitency and safety in case of multithreading.

Definition at line 71 of file DFAgent.h.


The documentation for this class was generated from the following files: