Version: 9.15.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

◆ CleanUpObservers()

void CleanUpObservers ( )

Definition at line 90 of file ExampleOfObserversPluginForDriver.cxx.

91  {// Customize here !
92  }

◆ DefineCustomObservers()

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

Definition at line 78 of file ExampleOfObserversPluginForDriver.cxx.

79  {// Customize here !
80  YACS::ENGINE::Node *n(rootNode->getChildByName("ForEachLoop_pyobj1"));
82  if(!nc)
83  throw YACS::Exception("Expect to have a ForEach node called ForEachLoop_pyobj1 !");
84  PluginObserver *myCustomObsever(new PluginObserver(nc));
85  constexpr char WHAT[]="progress_ok";
86  pok.registerObserver(myCustomObsever,nc,WHAT,disp);
87  disp->addObserver(myCustomObsever,nc,WHAT);
88  }
PluginObserverKeeper pok
void registerObserver(YACS::ENGINE::Observer *newObs, YACS::ENGINE::ForEachLoop *nc, const std::string &what, YACS::ENGINE::Dispatcher *disp)
Node * getChildByName(const std::string &name) const
virtual void addObserver(Observer *observer, Node *object, const std::string &event)
Definition: Dispatcher.cxx:125
Loop node for parametric calculation.
Base class for all nodes.
Definition: Node.hxx:70

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

Variable Documentation

◆ pok