1
#if !defined(__COLLEAGUE_HPP)
2
#define __COLLEAGUE_HPP
6
Copyright (C) 2000 CoreLinux Consortium
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.
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.
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.
24
#if !defined(__COMMON_HPP)
28
#if !defined(__VECTOR_HPP)
32
#if !defined(__EVENT_HPP)
38
CORELINUX_VECTOR( IdentifierPtr , EventIdentifiers );
40
DECLARE_CLASS( Mediator );
42
DECLARE_CLASS( Colleague );
45
Colleague knows its Mediator object, communicates with its mediator
46
whenever it would have otherwise communicated with another Colleague.
54
// Constructors and destructor
58
Default constructor requires a Mediator
59
@param Mediator pointer
60
@exception NullPointerException if MediatorPtr
64
Colleague( MediatorPtr )
65
throw ( NullPointerException );
68
Copy constructor copies the mediator
70
@param Colleague const referencee
73
Colleague( ColleagueCref );
75
/// Virtual destructor
77
virtual ~Colleague( void );
83
/// Assignment operator
85
ColleagueRef operator=( ColleagueCref );
89
bool operator==( ColleagueCref ) const;
96
Implementation defined to return the identifiers
97
of the events that this Colleague generates
98
@param EventIdentifiers vector reference
101
virtual void getEventsGenerated( EventIdentifiersRef ) = 0;
104
Implementation defined to return the identifiers
105
of the events that this Colleague is interested in
106
@param EventIdentifiers vector reference
109
virtual void getInterestedEvents( EventIdentifiersRef ) = 0;
116
Called by the mediator when another Colleague has
117
generated an event that this colleague instance
119
@param Event pointer to event
122
virtual void action( Event<Identifier> * ) = 0;
129
/// Default constructor not allowed
131
Colleague( void ) throw ( Assertion );
137
Called by the Colleague implementation to have
138
the Mediator::action called with the event type
139
@param Event pointer to event
140
@exception NullPointerException if EventPtr is NULLPTR
143
virtual void invokeMediator( Event<Identifier> * ) throw ( NullPointerException );
147
/// The Mediator that this Colleague knows
149
MediatorPtr theMediator;
153
#endif // if !defined(__COLLEAGUE_HPP)
156
Common rcs information do not modify
159
$Date: 2000/08/31 22:52:20 $