23 #ifndef Gw_BaseEmulator
24 #define Gw_BaseEmulator
79 std::vector < std::vector< ALoadedActor * > >
fTopology;
83 template <
class T_item>
88 for (
size_t i = 0; i < v.size(); i++) {
89 if ( v[i]->
GetName().compare(name) == 0 ) {
105 template <
class T_loader,
class T_actor>
106 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)
108 T_loader *new_node = 0x0;
ALoadedActor *input_node = 0x0, *output_node = 0x0;
112 std::cout <<
" " << name_new_actor <<
" already in the topology, name has to be unique " <<
std::endl;
116 new_node =
new T_loader( name_new_actor );
117 if ( new_node == 0x0 ) {
130 new_node->SetConfigurator(configurator);
136 LinkActors(input_node, new_node, output_node);
384 template <
class T_actor>
389 t_actor =
dynamic_cast<T_actor *
> (actor);
409 virtual void Run(Int_t max_loop = -1 );
virtual void Draw()
Draw ... default is print.
std::vector< ANamedItem * > fGlobals
to configure the emulator. The name of each item should be unique !
void(* ConfigFunction)(const Char_t *, UInt_t *)
the function used to configure the underlying actor. Added to allow configuration by calling explicit...
virtual void SetGlobal(const ANamedItem &)
This method allows to modified some options of the emulator.
std::vector< std::vector< ALoadedActor * > > fTopology
Actors are memorized depending on their depth in the data processing chain.
std::string & GetName()
Name of the emulator.
header file for AnActorConnection.cpp
T_actor * GetActorByName(const Char_t *name) const
search for an actor in the emulator
header file for ALoadedActor.cpp
virtual void Run(Int_t max_loop=-1)
Run max loop.
Base class for a Log message.
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.
BaseEmulator(std::string name)
std::vector< AnActorConnection * > fAllConnections
list of all connections. Owned by the emulator thus delete by this
header file for GwLogMessage.cpp
virtual void PrintTopology()
print topology
An actor looded in an emulator.
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.
header file for DataHandling.cpp
NamedItem< T_item > * GetItem(const Char_t *name, std::vector< ANamedItem * > &v)
to get back an item from its name
ADF::LogMessage & endl(ADF::LogMessage &log)
Base class for an emulator.
virtual ALoadedActor * GetLoaderByName(const Char_t *) const
search for a node in the emulator
header file for NarvalInterface.cpp
void BuildTopology()
Built the map, starting from producer is calculates the depth of each actor in the data flow...
std::vector< ALoadedActor * > fAllActors
list of all actors to start building the map and to delete them @ the end
It defines the general interface needed to be a narval actor.
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...
base class in charge of configurating, allocating the true actor loaded in a LoadedActor ...
virtual NarvalInterface * GetActorByName(const Char_t *) const
search for an actor in the emulator