70 likes | 157 Views
ITTF Object Communication. Mike Miller Yale University. Outline. Introduce StiIOBroker Introduce Observer/Subscriber Pattern List objects that communicate via Observer/Subscriber. StiIOBroker. Goal: centralize all dynamic parameters in one place class StiIOBroker
E N D
ITTF Object Communication Mike Miller Yale University
Outline • Introduce StiIOBroker • Introduce Observer/Subscriber Pattern • List objects that communicate via Observer/Subscriber
StiIOBroker • Goal: centralize all dynamic parameters in one place • class StiIOBroker • Abstract class to define get/set methods • Singleton • class StiRootIOBroker : public StiIOBroker • Available at the root prompt • Currently used to pass info at the macro level • class StiMySqlIOBroker : public StiIOBroker • Not yet implemented
a=50 b=30 c=20 notification requests Subject/Observer Pattern (I) Guarantee dynamic propagation of information Define a one to many relationship Observer Observer Observer Subject
class Subscriber { public: add(Observer*); detach(Observer*); notify(); private: vector<Observer*> mVec; }; Subject/Observer Pattern (II) class Observer { public: update(Subject*)=0; private: Subject* mSubject; }; Simply derive from these classes and dynamic updates are guaranteed!
Subject StiIOBroker Observer Observer StiKalmanTrackFinder StiTrackMerger Observer Observer StiTrackFilter StiTrackSeedFinder ITTF Object Communication
Conclusions • StiIOBroker defines the only entrance for run-time parameters • Update of StiMySqlBroker in StiMaker::InitRun() will fully propagate through the entire object structure