[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    Subject(3X) manual page Table of Contents

Name

Subject - object with multiple views

Synopsis

#include <ivplus/subject.h>

Description

Subject is an object that has one or more views or users that it notifies. Notification is performed by invoking the Notify() operation.

Because subjects can be shared, Subject is a subclass of Resource. To allow for the possibility of multiple inheritance, in which case only a single copy of resource information should be maintained, Resource is a virtual base class. Subject has an initial reference count of 0. This means that the programmer needs to explicitly increment the reference count through a call to Reference().

Subject is an abstract base class.

Class Hierarchy

Subject->Resource

Constructors

Subject()

Creates an instance of a subject. Since Subject is an abstract base class, this constructor is protected.

Public Operations

virtual void Attach(Interactor*)

Adds a view to the subject’s list of views.

virtual void Detach(Interactor*)

Removes a view from the subject’s list of views.

boolean IsView(Interactor*)

Returns whether or not a given view is on the subject’s list of views.

virtual void Notify()

Notifies all the views of a subject that it has changed. The default implementation simply invokes Update() on each view.

X Resources

None.

Examples

No example for this abstract base class.

Files


subject.h

See Also

Resource(3X) .


Table of Contents