ScummVM API documentation
Ultima::Ultima4::Observable< O, A > Class Template Reference

#include <observable.h>

Public Member Functions

void addObserver (Observer< O, A > *o)
 
int countObservers () const
 
void deleteObserver (Observer< O, A > *o)
 
void deleteObservers ()
 
bool hasChanged () const
 
void notifyObservers (A arg)
 

Protected Member Functions

void clearChanged ()
 
void setChanged ()
 

Detailed Description

template<class O, class A = NoArg *>
class Ultima::Ultima4::Observable< O, A >

Classes can report updates to a list of decoupled Observers by extending this class.

The O class parameter should be a pointer to the class of the observable itself, so it can be passed in a typesafe manner to the observers update method.

The A class can be any additional information to pass to observers. Observables that don't need to pass an argument when they update observers should use the default "NoArg" class for the second template parameter and pass nullptr to notifyObservers.


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