CoreLinux++  0.4.32
Observer.hpp
1 #if !defined(__OBSERVER_HPP)
2 #define __OBSERVER_HPP
3 
4 /*
5  CoreLinux++
6  Copyright (C) 2000 CoreLinux Consortium
7 
8  The CoreLinux++ Library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Library General Public License as
10  published by the Free Software Foundation; either version 2 of the
11  License, or (at your option) any later version.
12 
13  The CoreLinux++ Library Library is distributed in the hope that it will
14  be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Library General Public License for more details.
17 
18  You should have received a copy of the GNU Library General Public
19  License along with the GNU C Library; see the file COPYING.LIB. If not,
20  write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  Boston, MA 02111-1307, USA.
22 */
23 
24 #if !defined(__COMMON_HPP)
25 #include <Common.hpp>
26 #endif
27 
28 #if !defined(__EVENT_HPP)
29 #include <Event.hpp>
30 #endif
31 
32 
33 namespace corelinux
34 {
35  DECLARE_CLASS( Subject );
36  DECLARE_CLASS( Observer );
37 
44  class Observer
45  {
46  public:
47 
48  //
49  // Constructors and destructor
50  //
51 
56  Observer( void ) ;
57 
64 
66 
67  virtual ~Observer( void );
68 
69  //
70  // Operator overloads
71  //
72 
74 
76 
78 
79  bool operator==( ObserverCref ) const;
80 
82 
83  bool operator!=( ObserverCref ) const;
84  //
85  // Accessors
86  //
87 
88 
89  //
90  // Mutators
91  //
92 
100  virtual void event( Event<Identifier> * )
101  throw ( NullPointerException );
102 
103  protected:
104 
105  private:
106 
107  };
108 }
109 
110 #endif // if !defined(__OBSERVER_HPP)
111 
112 /*
113  Common rcs information do not modify
114  $Author: prudhomm $
115  $Revision: 1.2 $
116  $Date: 2000/08/31 22:52:20 $
117  $Locker: $
118 */
119 
120 
121 
Observer observes Subjets and supports the event interface for recieving subject event notifications...
Definition: Observer.hpp:44
bool operator==(ObserverCref) const
Equality operator.
Definition: Observer.cpp:71
Forward reference the various common classes.
Definition: AbstractAllocator.hpp:32
NullPointerException is the base exception type for NullPointer.
Definition: NullPointerException.hpp:40
virtual void event(Event< Identifier > *)
Called by Subject::notifyObservers if this observer instance is registered for the event type...
Definition: Observer.cpp:97
bool operator!=(ObserverCref) const
In-Equality operator.
Definition: Observer.cpp:90
virtual ~Observer(void)
Virtual destructor.
Definition: Observer.cpp:53
Event provides a type basis for event ontologies.
Definition: Event.hpp:35
Observer(void)
Default constructor.
Definition: Observer.cpp:35
ObserverRef operator=(ObserverCref)
Assignment operator.
Definition: Observer.cpp:62

This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium