GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Gw::BaseEmulator Class Referenceabstract

Base class for an emulator. More...

#include <BaseEmulator.h>

Inheritance diagram for Gw::BaseEmulator:

Public Member Functions

 BaseEmulator (std::string name)
 
void BuildTopology ()
 Built the map, starting from producer is calculates the depth of each actor in the data flow. More...
 
virtual void Draw ()
 Draw ... default is print. More...
 
virtual NarvalInterfaceGetActorByName (const Char_t *) const
 search for an actor in the emulator More...
 
template<class T_actor >
T_actor * GetActorByName (const Char_t *name) const
 search for an actor in the emulator More...
 
virtual ALoadedActorGetLoaderByName (const Char_t *) const
 search for a node in the emulator More...
 
std::string & GetName ()
 Name of the emulator. More...
 
virtual void Init (const NamedItem< std::string > &init_sequence=NamedItem< std::string >("InitSequence","config load init"))
 Init the emulator. To be called before calling Run. More...
 
virtual void PrintTopology ()
 print topology More...
 
virtual void Run (Int_t max_loop=-1)
 Run max loop. More...
 
virtual void SetGlobal (const ANamedItem &)
 This method allows to modified some options of the emulator. More...
 
virtual ~BaseEmulator ()
 

Protected Member Functions

template<class T_loader , class T_actor >
T_loader * AddLoader (const Char_t *name_left, const Char_t *name_new_actor, const Char_t *name_right, const Char_t *conf_dir, ConfigFunction f_config)
 Actors are memorized depending on their depth in the data processing chain. More...
 
template<class T_item >
NamedItem< T_item > * GetItem (const Char_t *name, std::vector< ANamedItem * > &v)
 to get back an item from its name More...
 
virtual void LinkActors (ALoadedActor *left, ALoadedActor *middle, ALoadedActor *right)=0
 link middle (new actor in the emulator) with left and right (could be null) ... the type of connecion depends on the emulator's implementation More...
 

Protected Attributes

std::vector< ALoadedActor * > fAllActors
 list of all actors to start building the map and to delete them @ the end More...
 
std::vector< AnActorConnection * > fAllConnections
 list of all connections. Owned by the emulator thus delete by this More...
 
std::vector< ANamedItem * > fGlobals
 to configure the emulator. The name of each item should be unique ! More...
 
std::vector< std::vector
< ALoadedActor * > > 
fTopology
 Actors are memorized depending on their depth in the data processing chain. More...
 

Detailed Description

Base class for an emulator.

An emulator regroups actors that are connected together i.e. they exchange buffers of data, whatever is inside the buffer. It is organised such that it starts with producers and, in principle, ends with consumers.

The topology could be complex. It is however organized in level in the data processing. Here is a simple example of such a topology with different levels.

one line producer -> filter -> consumer

The data go then through a chain of actors : producer, filter, consumer and dispatcher. Dispatchers are special actors since they handle multiple input and/or ouput while the other ones handle at maximum one input and/or output.

The organisation in layers of the topology constrains then the maximum depth of the topology. Here is a more complex example :

several lines producer -> filter -> consumer -> EB with producer @ different levels

The global behavior of the emulator can be modified using SetGlobal(). By default the following options are added to the emulator :

  • Name: "ConfDir" , type: STR, default "./"
  • Name: "ReadDir" , type: STR, default "./"
  • Name: "SaveDir" , type: STR, default "./"

Definition at line 61 of file BaseEmulator.h.


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