MPS::InterfaceServer class Reference (original) (raw)
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members
Base class for MPS object servers. More...
#include <[server.h](server%5Fh-source.html)>
Inheritance diagram for MPS::InterfaceServer:

[legend]
Collaboration diagram for MPS::InterfaceServer:

[legend]
| 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_t> | requesthandlervec_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
| | 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 | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| | 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
| | 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]
Member Data Documentation
| | Our implementation object.Definition at line 133 of file server.h. | | -------------------------------------------------------------------------------------------------------------------------------- |
| | 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
1.2.6 written by Dimitri van Heesch, © 1997-2001