CSL  6.0
csl::Observer Class Referenceabstract

CSL Observer/Dependent/Monitor class – instances receive update() messages from "models" and handle some argument, which may be the model's "this" pointer, or any other data. More...

#include <CGestalt.h>

+ Inheritance diagram for csl::Observer:

Public Member Functions

 Observer ()
 
virtual ~Observer ()
 constructor More...
 
virtual void update (void *arg)=0
 this will be implemented in subclasses. More...
 

Public Attributes

float mPeriod
 virtual destructor (don't notify or delete observers in this version) More...
 
int mKey
 key selector (e.g., MIDI chan) I receive update() mesages from my model; More...
 

Detailed Description

CSL Observer/Dependent/Monitor class – instances receive update() messages from "models" and handle some argument, which may be the model's "this" pointer, or any other data.

Subclasses must override the update() method to do their stuff – grabbing a data buffer, operating on their model, or displaying something.

The mPeriod is the requested period for updates.

The mKey is an int value for the model's evaluate() function to filter updates
i.e., if the model implements evaluate(void*), and its return value is non-zero and 
matches the observer's key, then an update will be sent. An example of using this is
a MIDI IO object's channel filtering for MIDI listeners (observers).

Definition at line 296 of file CGestalt.h.

Constructor & Destructor Documentation

csl::Observer::Observer ( )
inline

Definition at line 298 of file CGestalt.h.

References mKey, and mPeriod.

virtual csl::Observer::~Observer ( )
inlinevirtual

constructor

Definition at line 299 of file CGestalt.h.

Member Function Documentation

virtual void csl::Observer::update ( void *  arg)
pure virtual

this will be implemented in subclasses.

Implemented in CSLMIDIComponent, CSLMIDIComponent, csl::Spatializer, and csl::SpatialPanner.

Member Data Documentation

float csl::Observer::mPeriod

virtual destructor (don't notify or delete observers in this version)

max update rate

Definition at line 299 of file CGestalt.h.

Referenced by csl::Model::attachObserver(), and Observer().

int csl::Observer::mKey

key selector (e.g., MIDI chan) I receive update() mesages from my model;

Definition at line 302 of file CGestalt.h.

Referenced by csl::Model::attachObserver(), and Observer().


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