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

MPS::SimplTransport Class Reference

Implements a Transport class for accessing and serving MPS objects via the SIMPL protocol (http://www.holoweb.net/~simpl/). More...

#include <transport_simpl.h>

Inheritance diagram for MPS::SimplTransport:

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

Collaboration graph
[legend]
List of all members.

Static Public Methods

void initialise (string const &simplName)
void mainloop ()

Protected Methods

virtual ref<ConnectionconnectTo (Address const &connectionSpec)
virtual string registerServer (Server *server, Address const &spec)
virtual string deregisterServer (Server *server, Address const &spec)

Static Protected Methods

void pushMessage (void *sender, char const *msg, int msglen)
void* popMessage (char *msg, int &msglen)

Private Types

typedef map< int, Server * > serverMap_t

Private Methods

 SimplTransport (string const &simplName)

Private Attributes

int nextOid
string simplName
serverMap_t serverMap

Static Private Attributes

SimplTransport* instance

Friends

class  SimplIOStream

Detailed Description

Implements a Transport class for accessing and serving MPS objects via the SIMPL protocol (http://www.holoweb.net/~simpl/).

Definition at line 48 of file transport_simpl.h.


Member Typedef Documentation

typedef map< int, Server * > MPS::SimplTransport::serverMap_t [private]
 

Definition at line 57 of file transport_simpl.h.


Constructor & Destructor Documentation

MPS::SimplTransport::SimplTransport ( string const & simplName ) [private]
 

Referenced by initialise().


Member Function Documentation

virtual ref<Connection> MPS::SimplTransport::connectTo ( Address const & connectionSpec ) [protected, virtual]
 

Returns a message source/sink that can be used for communication with the object at the address described by the connectionSpec.

The connectionSpec is the broken-down resolved name of the remote object, and must match the address format that this transport expects.

Parameters:
connectionSpec   the address of the remote object
Returns:
a connection handle for remote communication, or NULL if none could be created

Reimplemented from MPS::Transport.

virtual string MPS::SimplTransport::deregisterServer ( Server * server,
Address const & spec ) [protected, virtual]
 

Attempt to deregister a server interface.

Parameters:
server   the server to deregister
spec   the connection specification that the transport may use as a hint in determining the final resolved name to use when unbinding this object.
Returns:
the canonical name of the server-that-was-bound-to-this-transport, or "" if unbinding from this transport fails.

Reimplemented from MPS::Transport.

void MPS::SimplTransport::initialise ( string const & simplName ) [inline, static]
 

Creates the single per-application instance of SimplTransport, and registers it using Transport::registerTransport().

Parameters:
namingServerLocation   resolved address of the naming server to use
simplName   the name to bind to our SIMPL mailbox

Definition at line 85 of file transport_simpl.h.

void MPS::SimplTransport::mainloop ( ) [static]
 

void* MPS::SimplTransport::popMessage ( char * msg,
int & msglen ) [static, protected]
 

void MPS::SimplTransport::pushMessage ( void * sender,
char const * msg,
int msglen ) [static, protected]
 

virtual string MPS::SimplTransport::registerServer ( Server * server,
Address const & spec ) [protected, virtual]
 

Attempt to register a server interface for access using this transport.

Parameters:
server   the server to register
spec   the connection specification that the transport may use as a hint in determining the final resolved name to use when binding this object.
Returns:
the canonical name of the server-bound-to-this-transport, or "" if binding to this transport fails.

Reimplemented from MPS::Transport.


Friends And Related Function Documentation

friend class SimplIOStream [friend]
 

Definition at line 74 of file transport_simpl.h.

Referenced by MPS::SimplTransport::SimplConnection::getInputStream(), and MPS::SimplTransport::SimplConnection::getOutputStream().


Member Data Documentation

SimplTransport* MPS::SimplTransport::instance [static, private]
 

The single, per-application instance of SimplTransport.

Definition at line 50 of file transport_simpl.h.

int MPS::SimplTransport::nextOid [private]
 

Next OID available for registration here.

Definition at line 61 of file transport_simpl.h.

serverMap_t MPS::SimplTransport::serverMap [private]
 

All OIDs we serve.

Definition at line 63 of file transport_simpl.h.

string MPS::SimplTransport::simplName [private]
 

Our local SIMPL server name.

Definition at line 62 of file transport_simpl.h.


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