Subject Class Reference

#include <IpObserver.hpp>

Inheritance diagram for Subject:

TaggedObject Matrix Vector CompoundMatrix DenseGenMatrix ExpansionMatrix GenTMatrix MultiVectorMatrix ScaledMatrix SumMatrix SymMatrix ZeroMatrix CompoundVector DenseVector

List of all members.


Detailed Description

Slight Variation of the Observer Design Pattern (Subject part).

This class implements the Subject class of the Observer Design Pattern. An Observer "Attach"es to a Subject, indicating that it would like to be notified of changes in the Subject. Any derived class that is to be observed has to inherit off the Subject base class. If the subject needs to notify the Observer, it calls the Notify method.

Public Member Functions

Constructors/Destructors
 Subject ()
 Default Constructor.
virtual ~Subject ()
 Default destructor.
Methods to Add and Remove Observers.
Currently, the notify_type flags are not used, and Observers are attached in general and will recieve all notifications (of the type requested and possibly of types not requested).

It is up to the observer to ignore the types they are not interested in. The NotifyType in the parameter list is so a more efficient mechanism depending on type could be implemented later if necessary.

void AttachObserver (Observer::NotifyType notify_type, Observer *observer) const
 Attach the specified observer (i.e., begin recieving notifications).
void DetachObserver (Observer::NotifyType notify_type, Observer *observer) const
 Detach the specified observer (i.e., no longer recieve notifications).

Protected Member Functions

void Notify (Observer::NotifyType notify_type) const


Constructor & Destructor Documentation

Subject (  )  [inline]

Default Constructor.

~Subject (  )  [inline, virtual]

Default destructor.

References DBG_START_METH, and Observer::NT_BeingDestroyed.


Member Function Documentation

void AttachObserver ( Observer::NotifyType  notify_type,
Observer observer 
) const [inline]

Attach the specified observer (i.e., begin recieving notifications).

References DBG_ASSERT, and DBG_START_METH.

Referenced by Observer::RequestAttach().

void DetachObserver ( Observer::NotifyType  notify_type,
Observer observer 
) const [inline]

Detach the specified observer (i.e., no longer recieve notifications).

References DBG_ASSERT, and DBG_START_METH.

Referenced by Observer::RequestDetach().

void Notify ( Observer::NotifyType  notify_type  )  const [inline, protected]

References DBG_START_METH.

Referenced by TaggedObject::ObjectChanged().


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

Generated on Fri Sep 26 07:44:26 2008 for SimTKcore by  doxygen 1.5.6