Colleague.hpp
#if !defined(__COLLEAGUE_HPP)
#define __COLLEAGUE_HPP
/*
CoreLinux++
Copyright (C) 2000 CoreLinux Consortium
The CoreLinux++ Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The CoreLinux++ Library Library is distributed in the hope that it will
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#if !defined(__COMMON_HPP)
#include <Common.hpp>
#endif
#if !defined(__VECTOR_HPP)
#include <Vector.hpp>
#endif
#if !defined(__EVENT_HPP)
#include <Event.hpp>
#endif
namespace corelinux
{
CORELINUX_VECTOR( IdentifierPtr , EventIdentifiers );
DECLARE_CLASS( Mediator );
DECLARE_CLASS( Colleague );
class Colleague
{
public:
//
// Constructors and destructor
//
Colleague( MediatorPtr )
throw ( NullPointerException );
Colleague( ColleagueCref );
virtual ~Colleague( void );
//
// Operator overloads
//
ColleagueRef operator=( ColleagueCref );
bool operator==( ColleagueCref ) const;
//
// Accessors
//
virtual void getEventsGenerated( EventIdentifiersRef ) = 0;
virtual void getInterestedEvents( EventIdentifiersRef ) = 0;
//
// Mutators
//
virtual void action( Event<Identifier> * ) = 0;
protected:
//
// Constructor
//
Colleague( void ) throw ( Assertion );
//
// Service method
//
virtual void invokeMediator( Event<Identifier> * ) throw ( NullPointerException );
private:
MediatorPtr theMediator;
};
}
#endif // if !defined(__COLLEAGUE_HPP)
/*
Common rcs information do not modify
$Author: prudhomm $
$Revision: 1.2 $
$Date: 2000/08/31 22:52:20 $
$Locker: $
*/
corelinux::Colleague
Colleague knows its Mediator object, communicates with its mediator whenever it would have otherwise ...
Definition: Colleague.hpp:49
corelinux::Colleague::operator=
ColleagueRef operator=(ColleagueCref)
Assignment operator.
Definition: Colleague.cpp:79
corelinux::Colleague::invokeMediator
virtual void invokeMediator(Event< Identifier > *)
Called by the Colleague implementation to have the Mediator::action called with the event type...
Definition: Colleague.cpp:101
corelinux::Colleague::getEventsGenerated
virtual void getEventsGenerated(EventIdentifiersRef)=0
Implementation defined to return the identifiers of the events that this Colleague generates...
corelinux::Colleague::Colleague
Colleague(void)
Default constructor not allowed.
Definition: Colleague.cpp:37
corelinux::Colleague::action
virtual void action(Event< Identifier > *)=0
Called by the mediator when another Colleague has generated an event that this colleague instance is ...
corelinux
Forward reference the various common classes.
Definition: AbstractAllocator.hpp:32
corelinux::NullPointerException
NullPointerException is the base exception type for NullPointer.
Definition: NullPointerException.hpp:40
corelinux::Colleague::operator==
bool operator==(ColleagueCref) const
Equality operator.
Definition: Colleague.cpp:94
corelinux::Colleague::~Colleague
virtual ~Colleague(void)
Virtual destructor.
Definition: Colleague.cpp:72
corelinux::Assertion
Assertion is-a Exception created when an assertion fails.
Definition: Assertion.hpp:423
corelinux::Colleague::getInterestedEvents
virtual void getInterestedEvents(EventIdentifiersRef)=0
Implementation defined to return the identifiers of the events that this Colleague is interested in...
corelinux::Event
Event provides a type basis for event ontologies.
Definition: Event.hpp:35
corelinux::Mediator
Mediator declares an interface for communicating with Colleague objects.
Definition: Mediator.hpp:45

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