Handler.hpp
#if !defined(__HANDLER_HPP)
#define __HANDLER_HPP
/*
CoreLinux++
Copyright (C) 1999,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(__REQUEST_HPP)
#include <Request.hpp>
#endif
namespace corelinux
{
DECLARE_CLASS( Handler );
class Handler : public Synchronized
{
public:
//
// Constructors and destructors
//
Handler( void );
Handler( HandlerCref );
virtual ~Handler( void );
//
// Operator overloads
//
HandlerRef operator=( HandlerCref );
bool operator==( HandlerCref ) const;
//
// Accessors
//
HandlerPtr operator++( void ) ;
HandlerPtr operator--( void ) ;
//
// Mutators
//
void succeedHandler( HandlerPtr ) throw ( Assertion );
void precedeHandler( HandlerPtr ) throw ( Assertion );
void extractSelf( void );
virtual void handleRequest( RequestPtr ) ;
protected:
virtual bool handlesType( RequestPtr ) = 0;
virtual void handle( RequestPtr ) = 0;
void setSuccessor( HandlerPtr ) ;
void setPredecessor( HandlerPtr ) ;
void setSiblings( HandlerPtr, HandlerPtr );
protected:
HandlerPtr theSuccessor;
HandlerPtr thePredecessor;
private:
};
}
#endif // if !defined(__HANDLER_HPP)
/*
Common rcs information do not modify
$Author: frankc $
$Revision: 1.1 $
$Date: 2000/04/27 14:32:21 $
$Locker: $
*/
corelinux::Handler::handleRequest
virtual void handleRequest(RequestPtr)
Routine which either invokes the work method or passes along to successor.
Definition: Handler.cpp:210
corelinux::Handler
Defines an interface for handling requests, accessing successors, and optionally implements the succe...
Definition: Handler.hpp:43
corelinux::Handler::Handler
Handler(void)
Default constructor.
Definition: Handler.cpp:33
corelinux::Handler::operator=
HandlerRef operator=(HandlerCref)
Operator assignment.
Definition: Handler.cpp:63
corelinux::Handler::~Handler
virtual ~Handler(void)
Virtual destructor.
Definition: Handler.cpp:56
corelinux::Handler::setSuccessor
void setSuccessor(HandlerPtr)
Sets the objects theSuccessor member.
Definition: Handler.cpp:231
corelinux::Handler::operator++
HandlerPtr operator++(void)
Returns successor or NULLPTR if end-of-chain.
Definition: Handler.cpp:77
corelinux::Handler::succeedHandler
void succeedHandler(HandlerPtr)
Have this tie itself as the successor to the argument handler pointer.
Definition: Handler.cpp:93
corelinux::Handler::precedeHandler
void precedeHandler(HandlerPtr)
Have this tie itself as the predecessor to the argument handler pointer.
Definition: Handler.cpp:138
corelinux::Handler::setPredecessor
void setPredecessor(HandlerPtr)
Sets the objects thePredecessor member.
Definition: Handler.cpp:239
corelinux::Handler::operator==
bool operator==(HandlerCref) const
Equality operator.
Definition: Handler.cpp:70
corelinux::Handler::operator--
HandlerPtr operator--(void)
Returns predecessor or NULLPTR if end-of-chain.
Definition: Handler.cpp:85
corelinux::Handler::thePredecessor
HandlerPtr thePredecessor
Supports chaining of responsibility where.
Definition: Handler.hpp:161
corelinux::Handler::handlesType
virtual bool handlesType(RequestPtr)=0
Implementation required.
corelinux::Handler::theSuccessor
HandlerPtr theSuccessor
Supports chaining of responsibility.
Definition: Handler.hpp:157
corelinux::Assertion
Assertion is-a Exception created when an assertion fails.
Definition: Assertion.hpp:423
corelinux::Synchronized
Synchronized is a mixin which allows class objects to enable monitor functionality.
Definition: Synchronized.hpp:41
corelinux::Handler::handle
virtual void handle(RequestPtr)=0
Implementation required.
corelinux::Handler::setSiblings
void setSiblings(HandlerPtr, HandlerPtr)
Sets the object siblings as atomic operation.
Definition: Handler.cpp:247
corelinux::Handler::extractSelf
void extractSelf(void)
Removes links from self.
Definition: Handler.cpp:183
corelinux::Request
A Request is used for type identification to a handler object.
Definition: Request.hpp:38

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