|
VirtualFluids 0.2.0
Parallel CFD LBM Solver
|
Observable object. More...
#include <UbObservable.h>
Public Member Functions | |
| virtual | ~UbObservable () |
| virtual void | addObserver (UbObserver *observer) |
| virtual void | removeObserver (UbObserver *observer) |
| virtual void | removeAllObservers () |
| virtual bool | isObservedBy (UbObserver *observer) |
| virtual void | notifyObserversObjectChanged () |
| std::list< UbObserver * > * | getObserverList () |
| virtual std::string | toString () |
Protected Member Functions | |
| UbObservable ()=default | |
| UbObservable (const UbObservable &) | |
| UbObservable & | operator= (const UbObservable &) |
Observable object.
This class provides Observables. The Observeres which observe this Observable are stored in an observerlist. IMPORTANT: objectWillBeDeleted is called at UbObserver::~UbObserver this destructor is called AFTER the destructor of the child classes. if you down_cast the pointer sent with the objectWillBeDeleted(UbObserver* objpointer) then have to go this:
if(dynamic_cast<UbObserver*>(observedObj)==objpointer) (e.g.) observedObj=NULL; example: see end of file
a copy of an UbservableObject will NOT copy the observerList
UbObservable(ObservableObject). Associating may be used, where object types to be observed could not be extended from UbObservable. see UbObserver
Definition at line 70 of file UbObservable.h.
|
protecteddefault |
Creates a UbObservable itself to be the object to be observed. Usually this constructor is used in extended classes.
|
inlineprotected |
Definition at line 82 of file UbObservable.h.
|
inlinevirtual |
Definition at line 102 of file UbObservable.h.
|
inlinevirtual |
Adds an UbObserver to the observerlist.
| observer | the observer to add to this observable (note that an observer may observe c1 observable more than once) |
Definition at line 113 of file UbObservable.h.
|
inline |
Definition at line 174 of file UbObservable.h.
|
inlinevirtual |
Checks whether the specified UbObserver observes this observable.
| observer | the observer to remove from this observable (note that all observers identical are deleted) |
Definition at line 145 of file UbObservable.h.
Notifies all of its observers that something happened. Does nothing, if the observed object is null. Calls the Method UbObserver.objectChanged(Object) with the object of this observable as parameter. The Method UbObserver.objectChanged(Object) must be defined by each class implementing the interface TiObserver
Definition at line 161 of file UbObservable.h.
|
inlineprotected |
Definition at line 89 of file UbObservable.h.
Deletes all Observers from the observerlist. ( delete means delete Heap... but here we're only removing a pointer)
Definition at line 138 of file UbObservable.h.
|
inlinevirtual |
Deletes an UbObserver from the observerlist.
| observer | the observer to remove from this observable (note that all observers identical are deleted) ( delete means delete Heap... but here we're only removing a pointer) |
Definition at line 128 of file UbObservable.h.
|
inlinevirtual |
Reimplemented in GbCuboid3D, GbCylinder3D, GbHalfSpaceKrischan3D, GbLine3D, GbObjectGroup3D, GbPoint3D, GbPolygon3D, GbQuadFaceMesh3D, GbSphere3D, GbTriangle3D, GbTriangularMesh3D, GbTriFaceMesh3D, GbVoxelMatrix3D, and ObObject.
Definition at line 176 of file UbObservable.h.