Protected Members
- NoticeTarget() : ilink(0), container(0), valid(False)
- NoticeTarget(NoticeSource *v) : ilink(0), container(0), valid(False)
- NoticeTarget(NoticeSource &v) : ilink(0),container(0), valid(False)
- NoticeTarget(NoticeTarget &other) : ilink(0), container(0), valid(False)
- NoticeTarget(NoticeTarget *other) : ilink(0), container(0), valid(False)
- void unlink()
- void link(const NoticeTarget &other)
- void link(const NoticeTarget *other)
- Link<NoticeTarget*> *next()
- const Link<NoticeTarget*> *next() const
- void attach(NoticeSource *v)
- void attach(NoticeSource &v)
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:
- An iterator changes something to the underlying list.
- The iterator creates a ListNotice
containing all the necessary information about the change.
- The iterator passes the notice to the NoticeSource
List.
- The list relays the notice to all other iterators operating on the
list (kept in the "target list").
- Every iterator catches the notice and changes its state accordingly.
Member Description
Destructs this NoticeTarget.
Returns a boolean value telling whether this NoticeTarget
is still "valid".
Returns a boolean value telling whether this NoticeTarget
is still attached to a NoticeSource or not.
Makes the current NoticeTarget "invalid".
virtual void notify(const Notice &) = 0
Hook through which NoticeTargets are notified
(by NoticeSources).
NoticeTarget() : ilink(0), container(0), valid(False)
Creates an unlinked, "invalid" NoticeTarget. An invalid
NoticeTarget does not occur in the target list of any
NoticeSource.
Creates a "valid" NoticeTarget linked to the specified
NoticeSource. The NoticeTarget will be added
to the target list in that NoticeSource.
NoticeTarget(NoticeTarget &other) : ilink(0), container(0), valid(False)
NoticeTarget(NoticeTarget *other) : ilink(0), container(0), valid(False)
Creates a "valid" NoticeTarget linked to the same
NoticeSource as the other NoticeTarget.
So, both NoticeTargets will occur in the same target
list.
Unlinks this NoticeTarget from its NoticeSource.
The NoticeTarget will be removed from the target list.
void link(const NoticeTarget &other)
void link(const NoticeTarget *other)
Links this NoticeTarget to the same NoticeSource
as the other NoticeTarget. Any previous link will be undone.
Link<NoticeTarget*> *next()
const Link<NoticeTarget*> *next() const
Retrieves the next NoticeTarget in the target list
of the associated NoticeSource.
Adds this NoticeTarget to the target list in the
specified NoticeSource, so that it will receive all
notices sent out by that NoticeSource.