CoreLinux++  0.4.32
Mediator.hpp
1 #if !defined(__MEDIATOR_HPP)
2 #define __MEDIATOR
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(__ITERATOR_HPP)
29 #include <Iterator.hpp>
30 #endif
31 
32 #if !defined(__EVENT_HPP)
33 #include <Event.hpp>
34 #endif
35 
36 namespace corelinux
37 {
38  DECLARE_CLASS( Colleague );
39  DECLARE_CLASS( Mediator );
40 
45  class Mediator
46  {
47  public:
48 
49  //
50  // Constructors and destructor
51  //
52 
54 
55  Mediator( void );
56 
58 
60 
62 
63  virtual ~Mediator( void );
64 
65  //
66  // Operator overloads
67  //
68 
70 
72 
74 
75  bool operator==( MediatorCref ) const;
76 
77  //
78  // The working part
79  //
80 
81  virtual void action( Event<Identifier>* )
82  throw ( NullPointerException );
83 
84  protected:
85 
86  //
87  // Mutators
88  //
89 
97  virtual void colleagueCreated( ColleaguePtr ) = 0;
98 
99  //
100  // Factory methods
101  //
102 
113 
119  virtual void destroyIterator( Iterator<ColleaguePtr> * ) = 0;
120 
121  private:
122 
123  };
124 }
125 
126 #endif // if !defined(__MEDIATOR_HPP)
127 
128 /*
129  Common rcs information do not modify
130  $Author: frankc $
131  $Revision: 1.1 $
132  $Date: 2000/05/07 03:41:47 $
133  $Locker: $
134 */
135 
MediatorRef operator=(MediatorCref)
Assignment operator.
Definition: Mediator.cpp:58
Colleague knows its Mediator object, communicates with its mediator whenever it would have otherwise ...
Definition: Colleague.hpp:49
bool operator==(MediatorCref) const
Equality operator.
Definition: Mediator.cpp:65
virtual Iterator< ColleaguePtr > * createIterator(Event< Identifier > *)=0
When action is called on the Mediator, it will ask the implementation for the Colleagues that are int...
virtual void destroyIterator(Iterator< ColleaguePtr > *)=0
Called when action is through with the colleague iteration.
Mediator(void)
Default constructor.
Definition: Mediator.cpp:37
Forward reference the various common classes.
Definition: AbstractAllocator.hpp:32
NullPointerException is the base exception type for NullPointer.
Definition: NullPointerException.hpp:40
The Iterator provides a way to access the elements of an collection type sequentially without exposin...
Definition: Iterator.hpp:44
Event provides a type basis for event ontologies.
Definition: Event.hpp:35
virtual ~Mediator(void)
Virtual destructor.
Definition: Mediator.cpp:51
virtual void colleagueCreated(ColleaguePtr)=0
colleagueCreated requires a implementation for derivations that need to gather information from the C...
Mediator declares an interface for communicating with Colleague objects.
Definition: Mediator.hpp:45

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