Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

MPS::InterfaceServer Class Reference

Base class for MPS object servers. More...

#include <server.h>

Inheritance diagram for MPS::InterfaceServer:

Inheritance graph
[legend]
Collaboration diagram for MPS::InterfaceServer:

Collaboration graph
[legend]
List of all members.

Public Types

typedef void (* request_handler_t )(ref< Interface > const &__impl, InputStream &__input, OutputStream &__output)

Public Methods

 InterfaceServer (string const &objectName, ref< Interface > const &impl)
virtual void dispatch (InputStream &request, OutputStream &reply)

Protected Methods

void registerMethod (int methodIndex, string const &methodName, request_handler_t handler)

Private Types

typedef vector<request_handler_trequesthandlervec_t

Private Attributes

ref<Interface__impl
requesthandlervec_t methods

Friends

class  Transport

Detailed Description

Base class for MPS object servers.

The dispatcher here reads a message, takes the first int from it, and uses it to index into a list of request-handler function pointers, which then further deconstruct the incoming message, call their implementation object, and fill in a reply message, which is sent along the Connection by the InterfaceServer::dispatch() method.

Definition at line 106 of file server.h.


Member Typedef Documentation

typedef void(* MPS::InterfaceServer::request_handler_t)(ref< Interface > const &__impl, InputStream &__input, OutputStream &__output)
 

This is the type that each method in the MPS automatically-generated server-glue should have.

The __impl parameter is used to pass down a handle on the implementation object; the __input and __output parameters are used for communication with the client.

Request handlers that do not wish to send a reply message containing any data (ie. void-typed methods) should not fill in any bytes in __output. The dispatch() method below takes this as an indication of a void response.

Parameters:
__impl   the implementation object this method is operating on
__input   the input message
__output   the reply message

typedef vector< request_handler_t > MPS::InterfaceServer::requesthandlervec_t<request_handler_t> [private]
 

A list of method-handlers.

Definition at line 131 of file server.h.


Constructor & Destructor Documentation

MPS::InterfaceServer::InterfaceServer ( string const & objectName,
ref< Interface > const & impl ) [inline]
 

Create an MPS object server called objectName, implemented by impl.

Definition at line 138 of file server.h.


Member Function Documentation

virtual void MPS::InterfaceServer::dispatch ( InputStream & request,
OutputStream & reply ) [virtual]
 

Dispatches an method request coming in over a connection.

Reimplemented from MPS::Server.

void MPS::InterfaceServer::registerMethod ( int methodIndex,
string const & methodName,
request_handler_t handler ) [protected]
 

Called by (automatically-generated) subclasses to register method-handlers.


Friends And Related Function Documentation

friend class Transport [friend]
 

Allows access to bindName() and unbindName().

Reimplemented from MPS::Server.

Definition at line 129 of file server.h.


Member Data Documentation

ref< Interface > MPS::InterfaceServer::__impl<Interface> [private]
 

Our implementation object.

Definition at line 133 of file server.h.

requesthandlervec_t MPS::InterfaceServer::methods [private]
 

All the methods we implement.

Definition at line 134 of file server.h.


The documentation for this class was generated from the following file:
Generated at Wed Aug 15 01:05:30 2001 for mps-cpp by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001