CoreLinux++  0.4.32
Colleague.hpp
1 #if !defined(__COLLEAGUE_HPP)
2 #define __COLLEAGUE_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(__VECTOR_HPP)
29 #include <Vector.hpp>
30 #endif
31 
32 #if !defined(__EVENT_HPP)
33 #include <Event.hpp>
34 #endif
35 
36 namespace corelinux
37 {
38  CORELINUX_VECTOR( IdentifierPtr , EventIdentifiers );
39 
40  DECLARE_CLASS( Mediator );
41 
42  DECLARE_CLASS( Colleague );
43 
49  class Colleague
50  {
51  public:
52 
53  //
54  // Constructors and destructor
55  //
56 
65  throw ( NullPointerException );
66 
74 
76 
77  virtual ~Colleague( void );
78 
79  //
80  // Operator overloads
81  //
82 
84 
86 
88 
89  bool operator==( ColleagueCref ) const;
90 
91  //
92  // Accessors
93  //
94 
101  virtual void getEventsGenerated( EventIdentifiersRef ) = 0;
102 
109  virtual void getInterestedEvents( EventIdentifiersRef ) = 0;
110 
111  //
112  // Mutators
113  //
114 
122  virtual void action( Event<Identifier> * ) = 0;
123 
124  protected:
125 
126  //
127  // Constructor
128  //
130 
131  Colleague( void ) throw ( Assertion );
132 
133  //
134  // Service method
135  //
143  virtual void invokeMediator( Event<Identifier> * ) throw ( NullPointerException );
144 
145  private:
146 
148 
149  MediatorPtr theMediator;
150  };
151 }
152 
153 #endif // if !defined(__COLLEAGUE_HPP)
154 
155 /*
156  Common rcs information do not modify
157  $Author: prudhomm $
158  $Revision: 1.2 $
159  $Date: 2000/08/31 22:52:20 $
160  $Locker: $
161 */
162 
163 
Colleague knows its Mediator object, communicates with its mediator whenever it would have otherwise ...
Definition: Colleague.hpp:49
ColleagueRef operator=(ColleagueCref)
Assignment operator.
Definition: Colleague.cpp:79
virtual void invokeMediator(Event< Identifier > *)
Called by the Colleague implementation to have the Mediator::action called with the event type...
Definition: Colleague.cpp:101
virtual void getEventsGenerated(EventIdentifiersRef)=0
Implementation defined to return the identifiers of the events that this Colleague generates...
Colleague(void)
Default constructor not allowed.
Definition: Colleague.cpp:37
virtual void action(Event< Identifier > *)=0
Called by the mediator when another Colleague has generated an event that this colleague instance is ...
bool operator==(ColleagueCref) const
Equality operator.
Definition: Colleague.cpp:94
Forward reference the various common classes.
Definition: AbstractAllocator.hpp:32
NullPointerException is the base exception type for NullPointer.
Definition: NullPointerException.hpp:40
virtual ~Colleague(void)
Virtual destructor.
Definition: Colleague.cpp:72
Assertion is-a Exception created when an assertion fails.
Definition: Assertion.hpp:423
virtual void getInterestedEvents(EventIdentifiersRef)=0
Implementation defined to return the identifiers of the events that this Colleague is interested in...
Event provides a type basis for event ontologies.
Definition: Event.hpp:35
Mediator declares an interface for communicating with Colleague objects.
Definition: Mediator.hpp:45

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