NEURON
observe.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 1992 Stanford University
3
* Copyright (c) 1992 Silicon Graphics, Inc.
4
*
5
* Permission to use, copy, modify, distribute, and sell this software and
6
* its documentation for any purpose is hereby granted without fee, provided
7
* that (i) the above copyright notices and this permission notice appear in
8
* all copies of the software and related documentation, and (ii) the names of
9
* Stanford and Silicon Graphics may not be used in any advertising or
10
* publicity relating to the software without the specific, prior written
11
* permission of Stanford and Silicon Graphics.
12
*
13
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
14
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
15
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
16
*
17
* IN NO EVENT SHALL STANFORD OR SILICON GRAPHICS BE LIABLE FOR
18
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
19
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
20
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
21
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
22
* OF THIS SOFTWARE.
23
*/
24
25
/*
26
* Observable - object to observe
27
*/
28
29
#ifndef iv_observe_h
30
#define iv_observe_h
31
32
#include <
InterViews/enter-scope.h
>
33
34
#include <
InterViews/_enter.h
>
35
36
class
Observer
;
37
class
ObserverList
;
38
39
class
Observable
{
40
public
:
41
Observable
();
42
virtual
~Observable
();
43
44
virtual
void
attach
(
Observer
*);
45
virtual
void
detach
(
Observer
*);
46
virtual
void
notify
();
47
private
:
48
ObserverList
*
observers_
;
49
};
50
51
class
Observer
{
52
protected
:
53
Observer
();
54
public
:
55
virtual
~Observer
();
56
57
virtual
void
update
(
Observable
*);
58
virtual
void
disconnect
(
Observable
*);
59
};
60
61
#include <
InterViews/_leave.h
>
62
63
#endif
_enter.h
_leave.h
ObserverList
#define ObserverList
Definition:
_defines.h:192
enter-scope.h
Observable
Definition:
observe.h:39
Observable::notify
virtual void notify()
Definition:
observe.cpp:75
Observable::attach
virtual void attach(Observer *)
Definition:
observe.cpp:54
Observable::Observable
Observable()
Definition:
observe.cpp:38
Observable::~Observable
virtual ~Observable()
Definition:
observe.cpp:42
Observable::detach
virtual void detach(Observer *)
Definition:
observe.cpp:63
Observable::observers_
ObserverList * observers_
Definition:
observe.h:48
Observer
Definition:
observe.h:51
Observer::Observer
Observer()
Definition:
observe.cpp:84
Observer::~Observer
virtual ~Observer()
Definition:
observe.cpp:85
Observer::disconnect
virtual void disconnect(Observable *)
Definition:
observe.cpp:87
Observer::update
virtual void update(Observable *)
Definition:
observe.cpp:86
src
ivos
InterViews
observe.h