00001
#if !defined(__COLLEAGUE_HPP)
00002
#define __COLLEAGUE_HPP
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
#if !defined(__COMMON_HPP)
00025
#include <Common.hpp>
00026
#endif
00027
00028
#if !defined(__VECTOR_HPP)
00029
#include <Vector.hpp>
00030
#endif
00031
00032
#if !defined(__EVENT_HPP)
00033
#include <Event.hpp>
00034
#endif
00035
00036
namespace corelinux
00037 {
00038 CORELINUX_VECTOR( IdentifierPtr , EventIdentifiers );
00039
00040 DECLARE_CLASS( Mediator );
00041
00042 DECLARE_CLASS( Colleague );
00043
00049 class Colleague
00050 {
00051
public:
00052
00053
00054
00055
00056
00064
Colleague(
MediatorPtr )
00065
throw (
NullPointerException );
00066
00073
Colleague(
ColleagueCref );
00074
00076
00077
virtual ~Colleague(
void );
00078
00079
00080
00081
00082
00084
00085
ColleagueRef operator=(
ColleagueCref );
00086
00088
00089
bool operator==(
ColleagueCref )
const;
00090
00091
00092
00093
00094
00101
virtual void getEventsGenerated( EventIdentifiersRef ) = 0;
00102
00109
virtual void getInterestedEvents( EventIdentifiersRef ) = 0;
00110
00111
00112
00113
00114
00122
virtual void action(
Event<Identifier> * ) = 0;
00123
00124
protected:
00125
00126
00127
00128
00130
00131
Colleague(
void )
throw (
Assertion );
00132
00133
00134
00135
00143
virtual void invokeMediator(
Event<Identifier> * )
throw (
NullPointerException );
00144
00145
private:
00146
00148
00149
MediatorPtr theMediator;
00150 };
00151 }
00152
00153
#endif // if !defined(__COLLEAGUE_HPP)
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163