CSL 5.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes
csl::Observer Class Reference

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:

List of all members.

## Public Member Functions
| Observer ()
virtual | ~Observer ()
| constructor
virtual void | update (void *arg)=0
| this will be implemented in subclasses.

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

## 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 283 of file CGestalt.h.

## Constructor & Destructor Documentation

csl::Observer::Observer | ( |  | ) |
| inline

Definition at line 285 of file CGestalt.h.

virtual csl::Observer::~Observer | ( |  | ) |
| inline virtual

constructor

Definition at line 286 of file CGestalt.h.

## Member Function Documentation

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

this will be implemented in subclasses.

Implemented in 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 286 of file CGestalt.h.

Referenced by csl::Model::attachObserver().

int csl::Observer::mKey

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

Definition at line 289 of file CGestalt.h.

Referenced by csl::Model::attachObserver().

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

- CSL/Kernel/CGestalt.h