Version: 8.3.0
ExampleOfObserversPluginForDriver.cxx File Reference
#include "Dispatcher.hxx"
#include "ForEachLoop.hxx"
#include <iostream>
#include <sstream>
Include dependency graph for ExampleOfObserversPluginForDriver.cxx:

Go to the source code of this file.

Classes

class  PluginObserver
 
class  PluginObserverKeeper
 

Functions

void DefineCustomObservers (YACS::ENGINE::Dispatcher *disp, YACS::ENGINE::ComposedNode *rootNode, YACS::ENGINE::Executor *executor)
 
void CleanUpObservers ()
 

Variables

PluginObserverKeeper pok
 

Function Documentation

void CleanUpObservers ( )

Definition at line 87 of file ExampleOfObserversPluginForDriver.cxx.

References PluginObserverKeeper::clean().

88  {// Customize here !
89  pok.clean();
90  }
void DefineCustomObservers ( YACS::ENGINE::Dispatcher disp,
YACS::ENGINE::ComposedNode rootNode,
YACS::ENGINE::Executor executor 
)

Definition at line 76 of file ExampleOfObserversPluginForDriver.cxx.

References YACS::ENGINE::Dispatcher::addObserver(), YACS::ENGINE::ComposedNode::getChildByName(), gui.Appli::n, and PluginObserverKeeper::registerObserver().

77  {// Customize here !
78  YACS::ENGINE::Node *n(rootNode->getChildByName("ForEachLoop_pyobj1"));
79  YACS::ENGINE::ForEachLoop *nc(dynamic_cast<YACS::ENGINE::ForEachLoop *>(n));
80  if(!nc)
81  throw YACS::Exception("Expect to have a ForEach node called ForEachLoop_pyobj1 !");
82  PluginObserver *myCustomObsever(new PluginObserver(nc));
83  pok.registerObserver(myCustomObsever);
84  disp->addObserver(myCustomObsever,nc,"progress_ok");
85  }

Variable Documentation