CoreLinux++  0.4.32
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
corelinux::Handler Class Referenceabstract

Defines an interface for handling requests, accessing successors, and optionally implements the successor link. More...

#include <Handler.hpp>

Public Member Functions

 Handler (void)
 Default constructor.
 
 Handler (HandlerCref)
 Copy constructor.
 
virtual ~Handler (void)
 Virtual destructor.
 
HandlerRef operator= (HandlerCref)
 Operator assignment.
 
bool operator== (HandlerCref) const
 Equality operator.
 
HandlerPtr operator++ (void)
 Returns successor or NULLPTR if end-of-chain.
 
HandlerPtr operator-- (void)
 Returns predecessor or NULLPTR if end-of-chain.
 
void succeedHandler (HandlerPtr) throw ( Assertion )
 Have this tie itself as the successor to the argument handler pointer. More...
 
void precedeHandler (HandlerPtr) throw ( Assertion )
 Have this tie itself as the predecessor to the argument handler pointer. More...
 
void extractSelf (void)
 Removes links from self.
 
virtual void handleRequest (RequestPtr)
 Routine which either invokes the work method or passes along to successor. More...
 
- Public Member Functions inherited from corelinux::Synchronized
 Synchronized (void)
 Default constructor.
 
 Synchronized (SynchronizedCref)
 Copy constructor.
 
virtual ~Synchronized (void)
 Virtual Destructor.
 
SynchronizedRef operator= (SynchronizedCref)
 Assignment operator.
 
bool operator== (SynchronizedCref) const
 Equality operator.
 

Protected Member Functions

virtual bool handlesType (RequestPtr)=0
 Implementation required. More...
 
virtual void handle (RequestPtr)=0
 Implementation required. More...
 
void setSuccessor (HandlerPtr)
 Sets the objects theSuccessor member.
 
void setPredecessor (HandlerPtr)
 Sets the objects thePredecessor member.
 
void setSiblings (HandlerPtr, HandlerPtr)
 Sets the object siblings as atomic operation.
 
- Protected Member Functions inherited from corelinux::Synchronized
Guard access (void) const throw (SemaphoreException)
 Access returns a instance of Guard which is block scoped to the caller. More...
 

Protected Attributes

HandlerPtr theSuccessor
 Supports chaining of responsibility.
 
HandlerPtr thePredecessor
 Supports chaining of responsibility where.
 

Additional Inherited Members

- Protected Types inherited from corelinux::Synchronized
typedef GuardGuardPtr
 
typedef const GuardGuardCptr
 
typedef GuardGuardRef
 
typedef const GuardGuardCref
 

Detailed Description

Defines an interface for handling requests, accessing successors, and optionally implements the successor link.

The builtin behavior is to allow forward and backward chaining of Handlers.

Member Function Documentation

virtual void corelinux::Handler::handle ( RequestPtr  )
protectedpure virtual

Implementation required.

Once determined if type is handled, then handle it!

Parameters
Requestpointer to request object

Referenced by handleRequest().

void corelinux::Handler::handleRequest ( RequestPtr  aRequest)
virtual

Routine which either invokes the work method or passes along to successor.

First calls handleType which determines if work is handled here or passed on.

Parameters
Requestpointer to request type

References handle(), and handlesType().

virtual bool corelinux::Handler::handlesType ( RequestPtr  )
protectedpure virtual

Implementation required.

Respond to type handler requests.

Parameters
Requestpointer to request object to determine if this handler handles the request.
Returns
bool true if this handler handles type

Referenced by handleRequest().

void corelinux::Handler::precedeHandler ( HandlerPtr  aHandler)
throw (Assertion
)

Have this tie itself as the predecessor to the argument handler pointer.

Parameters
Handlerpointer to preceed.
Exceptions
Assertionif HandlerPtr is NULLPTR

References setSuccessor(), thePredecessor, and theSuccessor.

void corelinux::Handler::succeedHandler ( HandlerPtr  aHandler)
throw (Assertion
)

Have this tie itself as the successor to the argument handler pointer.

Parameters
Handlerpointer to succeed
Exceptions
Assertionif HandlerPtr is NULLPTR

References setPredecessor(), thePredecessor, and theSuccessor.


The documentation for this class was generated from the following files:

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