Observer Design Pattern, Subject part. More...
Public Member Functions | |
Observable () | |
template<typename T > | |
T * | getObserver () |
void | addObserver (BaseObserver *) |
void | removeObserver (BaseObserver *) |
void | notify (unsigned int flags) |
Observer Design Pattern, Subject part.
Observable is the implementation of the subject part of the Observer design pattern. For the time beeing it's a simplificated version that allows only one Observer to watch the subject.
Observable is designed to be an attribute of the subject, not one of it's base class.
This implantation is completly generic and has nothing specific to Katabatic. It may be moved sometimes in Hurricane at Property level in Hurricane::DBo.
Note to Myself: Observer pattern is the one behind signal/slots.
|
inline |
Default and only constructor. The copy constructor is disabled (made private and unimplemented).
|
inline |
|
inline |
Adds an observer. If more than one is added, throw an error.
|
inline |
Removes an observer. If the observer do not belong to this observable, throw an exception.
|
inline |
Used by the subject to signal a change in it's state to the observers. The flags
parameter can be used to indicates what kind of change is occuring. Values for flags
are defined between the subject and the observers.
References BaseObserver::notify().
Referenced by AutoSegment::_invalidate(), AutoSegment::_postCreate(), AutoSegment::_preDestroy(), and AutoSegment::revalidate().
Generated by doxygen 1.8.5 on Mon Oct 1 2018 | Return to top of page |
Katabatic - Routing Toolbox | Copyright © 2008-2016 UPMC. All rights reserved |