class Dispatcher


Full nameArts::Dispatcher
Definition#include <arts/dispatcher.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Public Static Methods

Protected Methods

Protected Members


Detailed Description

static Dispatcher * _instance

[protected: ]

Pool<Buffer> requestResultPool

[protected: ]

Pool<Object_skel> objectPool

[protected: ]

std::list<Connection *> connections

[protected: ]

std::string serverID

[protected: ]

void  generateServerID ()

[protected: ]

bool deleteIOManagerOnExit

[protected: ]

TCPServer * tcpServer

[protected: ]

UnixServer * unixServer

[protected: ]

IOManager * _ioManager

[protected: ]

FlowSystem_impl * _flowSystem

[protected: ]

ObjectManager * objectManager

[protected: ]

ReferenceClean * referenceClean

[protected: ]

NotificationManager * notificationManager

[protected: ]

mcop_sighandler orig_sigpipe

[protected: ]

Connection * _activeConnection

[protected: ]

enum StartServer {noServer = 0, startUnixServer = 1, startTCPServer = 2, noAuthentication = 4 }

 Dispatcher (IOManager *ioManager = 0, StartServer startServer = noServer)

 ~Dispatcher ()

Dispatcher * the ()

[static]

inline IOManager * ioManager ()

InterfaceRepo  interfaceRepo ()

FlowSystem_impl * flowSystem ()

GlobalComm  globalComm ()

void  setFlowSystem (FlowSystem_impl *fs)

void  refillRequestIDs ()

Buffer * waitForResult (long requestID,Connection *connection)

Buffer * createRequest (long& requestID, long objectID, long methodID)

Buffer * createOnewayRequest (long objectID, long methodID)

void  handle (Connection *conn, Buffer *buffer, long messageType)

void  handleCorrupt (Connection *conn)

long  addObject (Object_skel *object)

object registration

do not call manually, this is used by the Object_skel constructor to register itself

void  removeObject (long objectID)

object deregistration

do not call manually, this is called by the Object_skel destructor as soon as the object is deleted

void * connectObjectLocal (ObjectReference& reference, std::string interface)

connects to a local object, returning a readily casted "interface" * if success, or NULL if this object is not local

Connection * connectObjectRemote (ObjectReference& reference)

connects to a remote object, establishing a connection if necessary

returns NULL if connecting fails or object isn't present or whatever else could go wrong

std::string  objectToString (long objectID)

stringification of objects (only used by the object implementations, which in turn provide a _toString method)

bool  stringToObjectReference (ObjectReference& r, std::string s)

destringification of objects (mainly used by the object implementations, which in turn provide a _fromString method)

void  run ()

main loop

void  terminate ()

this function quits the main loop (it must be running, of course) and causes the run() function to return.

void  initiateConnection (Connection *connection)

Is called by the transport services as soon as a new connection is created - this will send authentication request, etc.

void  handleConnectionClose (Connection *connection)

Is called by the Connection as soon as the connection goes down, which may happen due to a normal cause (client exits), and may happen if an error occurs as well (network down)

void  lock ()

[static]

Locks the dispatcher. Whenever you want to do anything with any kind of aRts object, you will hold a lock on Arts::Dispatcher. There is only one exception to the rule, and that is: you don't have to lock the dispatcher when the lock is already held.

Generally, that is very often the case. Typical situations where you don't need to lock() the Dispatcher are:

void  unlock ()

[static]

Unlocks the dispatcher. Do this to release a lock you hold on the Arts::Dispatcher.

Connection * activeConnection ()

- internal usage only -

this will return the Connection the last request came from

Connection * loopbackConnection ()

- internal usage only -

this will return a loopback Connection for sending requests to myself

DelayedReturn * delayReturn ()

- internal usage only -

this will cause a function to return from a request later


Generated by: stefan@stefan on Sat Feb 24 19:11:23 2001, using kdoc 2.0a47.