Version: 9.15.0
PluginObserverKeeper Class Reference
Collaboration diagram for PluginObserverKeeper:

Public Member Functions

 ~PluginObserverKeeper ()
 
void clean ()
 
void registerObserver (YACS::ENGINE::Observer *newObs, YACS::ENGINE::ForEachLoop *nc, const std::string &what, YACS::ENGINE::Dispatcher *disp)
 

Private Attributes

std::string _what
 
YACS::ENGINE::ForEachLoop_nc = nullptr
 
std::vector< YACS::ENGINE::Observer * > _observers
 
YACS::ENGINE::Dispatcher_disp = nullptr
 

Detailed Description

Definition at line 59 of file ExampleOfObserversPluginForDriver.cxx.

Constructor & Destructor Documentation

◆ ~PluginObserverKeeper()

PluginObserverKeeper::~PluginObserverKeeper ( )
inline

Definition at line 62 of file ExampleOfObserversPluginForDriver.cxx.

References clean().

Member Function Documentation

◆ clean()

void PluginObserverKeeper::clean ( )
inline

Definition at line 63 of file ExampleOfObserversPluginForDriver.cxx.

63 { for(std::vector<YACS::ENGINE::Observer *>::iterator it=_observers.begin();it!=_observers.end();it++) { delete *it; _disp->removeObserver(*it,_nc,_what); } _observers.clear(); }
std::vector< YACS::ENGINE::Observer * > _observers
virtual void removeObserver(Observer *observer, Node *object, const std::string &event)
Definition: Dispatcher.cxx:131

References _disp, _nc, _observers, _what, and YACS::ENGINE::Dispatcher::removeObserver().

Referenced by ~PluginObserverKeeper().

◆ registerObserver()

void PluginObserverKeeper::registerObserver ( YACS::ENGINE::Observer newObs,
YACS::ENGINE::ForEachLoop nc,
const std::string &  what,
YACS::ENGINE::Dispatcher disp 
)
inline

Definition at line 64 of file ExampleOfObserversPluginForDriver.cxx.

64 { _what=what; _nc=nc; _disp=disp; _observers.push_back(newObs); std::cerr << "register @@@@@@@@@@@ " << _observers.size() << std::endl; }

References _disp, _nc, _observers, and _what.

Referenced by DefineCustomObservers().

Member Data Documentation

◆ _disp

YACS::ENGINE::Dispatcher* PluginObserverKeeper::_disp = nullptr
private

Definition at line 69 of file ExampleOfObserversPluginForDriver.cxx.

Referenced by clean(), and registerObserver().

◆ _nc

YACS::ENGINE::ForEachLoop* PluginObserverKeeper::_nc = nullptr
private

Definition at line 67 of file ExampleOfObserversPluginForDriver.cxx.

Referenced by clean(), and registerObserver().

◆ _observers

std::vector<YACS::ENGINE::Observer *> PluginObserverKeeper::_observers
private

Definition at line 68 of file ExampleOfObserversPluginForDriver.cxx.

Referenced by clean(), and registerObserver().

◆ _what

std::string PluginObserverKeeper::_what
private

Definition at line 66 of file ExampleOfObserversPluginForDriver.cxx.

Referenced by clean(), and registerObserver().


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