casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions | Protected Attributes | Friends
casa::NoticeTarget Class Reference

abstract base class for notice receptors More...

#include <Notice.h>

Inheritance diagram for casa::NoticeTarget:
casa::ConstListIter< t > casa::OrderedMapIterRep< key, value > casa::RecordFieldPtr< T > casa::ListIter< t >

List of all members.

Public Member Functions

virtual ~NoticeTarget ()
 Destructs this NoticeTarget.
Bool isValid () const
 Returns a boolean value telling whether this NoticeTarget is still "valid".
Bool isAttached () const
 Returns a boolean value telling whether this NoticeTarget is still attached to a NoticeSource or not.
void invalidate ()
 Makes the current NoticeTarget "invalid".
virtual void notify (const Notice &)=0
 Hook through which NoticeTargets are notified (by NoticeSources).

Protected Member Functions

 NoticeTarget ()
 Creates an unlinked, "invalid" NoticeTarget.
 NoticeTarget (NoticeSource *v)
 Creates a "valid" NoticeTarget linked to the specified NoticeSource.
 NoticeTarget (NoticeSource &v)
 NoticeTarget (NoticeTarget &other)
 Creates a "valid" NoticeTarget linked to the same NoticeSource as the other NoticeTarget.
 NoticeTarget (NoticeTarget *other)
void unlink ()
 Unlinks this NoticeTarget from its NoticeSource.
void link (const NoticeTarget &other)
 Links this NoticeTarget to the same NoticeSource as the other NoticeTarget.
void link (const NoticeTarget *other)
Link< NoticeTarget * > * next ()
 Retrieves the next NoticeTarget in the target list of the associated NoticeSource.
const Link< NoticeTarget * > * next () const
void attach (NoticeSource *v)
 Adds this NoticeTarget to the target list in the specified NoticeSource, so that it will receive all notices sent out by that NoticeSource.
void attach (NoticeSource &v)

Protected Attributes

Link< NoticeTarget * > * ilink
NoticeSourcecontainer
Bool valid

Friends

class NoticeSource

Detailed Description

abstract base class for notice receptors

Intended use:

Public interface

Review Status

Reviewed By:
Friso Olnon
Date Reviewed:
1995/03/16

Synopsis

A NoticeTarget receives the Notices from the NoticeSource to which it is linked. A target can only be linked to one source.

Classes which are dependent upon a particular NoticeSource should derive from this class.

Example

ListIter and its parent class ConstListIter are the iterators or "dynamic" cursors in the linked List . They are derived from NoticeTarget, and the notice system ensures that multiple cursors are updated as elements are added and removed from the list, according to the following scheme:

  1. An iterator changes something to the underlying list.
  2. The iterator creates a ListNotice containing all the necessary information about the change.
  3. The iterator passes the notice to the NoticeSource List .
  4. The list relays the notice to all other iterators operating on the list (kept in the "target list").
  5. Every iterator catches the notice and changes its state accordingly.

Definition at line 152 of file Notice.h.


Constructor & Destructor Documentation

virtual casa::NoticeTarget::~NoticeTarget ( ) [virtual]

Destructs this NoticeTarget.

casa::NoticeTarget::NoticeTarget ( ) [inline, protected]

Creates an unlinked, "invalid" NoticeTarget.

An invalid NoticeTarget does not occur in the target list of any NoticeSource.

Definition at line 183 of file Notice.h.

casa::NoticeTarget::NoticeTarget ( NoticeSource v) [inline, protected]

Creates a "valid" NoticeTarget linked to the specified NoticeSource.

The NoticeTarget will be added to the target list in that NoticeSource.

Definition at line 189 of file Notice.h.

References attach().

casa::NoticeTarget::NoticeTarget ( NoticeSource v) [inline, protected]

Definition at line 190 of file Notice.h.

References attach().

casa::NoticeTarget::NoticeTarget ( NoticeTarget other) [inline, protected]

Creates a "valid" NoticeTarget linked to the same NoticeSource as the other NoticeTarget.

So, both NoticeTargets will occur in the same target list.

Definition at line 198 of file Notice.h.

References attach(), container, and isValid().

casa::NoticeTarget::NoticeTarget ( NoticeTarget other) [inline, protected]

Definition at line 200 of file Notice.h.

References attach(), and isValid().


Member Function Documentation

void casa::NoticeTarget::attach ( NoticeSource v) [protected]

Adds this NoticeTarget to the target list in the specified NoticeSource, so that it will receive all notices sent out by that NoticeSource.

Referenced by NoticeTarget().

void casa::NoticeTarget::attach ( NoticeSource v) [protected]
void casa::NoticeTarget::invalidate ( ) [inline]

Makes the current NoticeTarget "invalid".

Definition at line 168 of file Notice.h.

References casa::False, and valid.

Bool casa::NoticeTarget::isValid ( ) const [inline]
void casa::NoticeTarget::link ( const NoticeTarget other) [protected]

Links this NoticeTarget to the same NoticeSource as the other NoticeTarget.

Any previous link will be undone.

void casa::NoticeTarget::link ( const NoticeTarget other) [protected]
Link<NoticeTarget*>* casa::NoticeTarget::next ( ) [inline, protected]

Retrieves the next NoticeTarget in the target list of the associated NoticeSource.

Definition at line 219 of file Notice.h.

References ilink, and casa::Link< t >::next().

const Link<NoticeTarget*>* casa::NoticeTarget::next ( ) const [inline, protected]

Definition at line 222 of file Notice.h.

References ilink, and casa::Link< t >::next().

virtual void casa::NoticeTarget::notify ( const Notice ) [pure virtual]
void casa::NoticeTarget::unlink ( ) [protected]

Unlinks this NoticeTarget from its NoticeSource.

The NoticeTarget will be removed from the target list.


Friends And Related Function Documentation

friend class NoticeSource [friend]

Definition at line 154 of file Notice.h.


Member Data Documentation

Reimplemented in casa::OrderedMapIterRep< key, value >.

Definition at line 177 of file Notice.h.

Referenced by NoticeTarget().

Definition at line 176 of file Notice.h.

Referenced by isAttached(), and next().

Definition at line 178 of file Notice.h.

Referenced by invalidate(), and isValid().


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