cMsg Messaging System
5.2
|
Wraps most cMsg C calls, provides main functionality. More...
#include <cMsg.hxx>
Public Member Functions | |
cMsg (const string &UDL, const string &name, const string &descr) | |
Constructor for cMsg system object. More... | |
virtual | ~cMsg (void) |
Destructor disconects from cMsg system. More... | |
virtual void | connect () throw (cMsgException) |
Connects to cMsg system. More... | |
virtual void | disconnect (void) throw (cMsgException) |
Disconnects from cMsg system. More... | |
virtual void | send (cMsgMessage &msg) throw (cMsgException) |
Sends message. More... | |
virtual void | send (cMsgMessage *msg) throw (cMsgException) |
Sends message. More... | |
virtual int | syncSend (cMsgMessage &msg, const struct timespec *timeout=NULL) throw (cMsgException) |
Synchronously sends message. More... | |
virtual int | syncSend (cMsgMessage *msg, const struct timespec *timeout=NULL) throw (cMsgException) |
Synchronously sends message. More... | |
virtual void * | subscribe (const string &subject, const string &type, cMsgCallback *cb, void *userArg, const cMsgSubscriptionConfig *cfg=NULL) throw (cMsgException) |
Subscribes to subject,type and specifies callback, userArg. More... | |
virtual void * | subscribe (const string &subject, const string &type, cMsgCallback &cb, void *userArg, const cMsgSubscriptionConfig *cfg=NULL) throw (cMsgException) |
Subscribes to subject,type and specifies callback,userArg. More... | |
virtual void | unsubscribe (void *handle) throw (cMsgException) |
Unsubscribes. More... | |
virtual void | subscriptionPause (void *handle) throw (cMsgException) |
Pause delivery of messages to the given subscription's callback. More... | |
virtual void | subscriptionResume (void *handle) throw (cMsgException) |
Resume delivery of messages to the given subscription's callback if paused. More... | |
virtual void | subscriptionQueueClear (void *handle) throw (cMsgException) |
Clear all messages from the given subscription callback's queue. More... | |
virtual int | subscriptionQueueCount (void *handle) throw (cMsgException) |
Return the number of messages currently in the given subscription callback's queue. More... | |
virtual bool | subscriptionQueueIsFull (void *handle) throw (cMsgException) |
Returns whether the given subscription callback's queue is full (true) or not. More... | |
virtual int | subscriptionMessagesTotal (void *handle) throw (cMsgException) |
Return the total number of messages passed to the given subscription's callback. More... | |
virtual cMsgMessage * | sendAndGet (cMsgMessage &sendMsg, const struct timespec *timeout=NULL) throw (cMsgException) |
Sends message and gets reply. More... | |
virtual cMsgMessage * | sendAndGet (cMsgMessage *sendMsg, const struct timespec *timeout=NULL) throw (cMsgException) |
Sends message and gets reply. More... | |
virtual cMsgMessage * | subscribeAndGet (const string &subject, const string &type, const struct timespec *timeout=NULL) throw (cMsgException) |
Subscribes to subject/type, returns one matching message, then unsubscribes. More... | |
virtual void | flush (const struct timespec *timeout=NULL) throw (cMsgException) |
Flushes outgoing message queues. More... | |
virtual void | start (void) throw (cMsgException) |
Enables delivery of messages to callbacks. More... | |
virtual void | stop (void) throw (cMsgException) |
Disables delivery of messages to callbacks. More... | |
virtual void | setUDL (const string &udl) throw (cMsgException) |
Sets the connection UDL. More... | |
virtual string | getUDL (void) const |
Gets connection UDL. More... | |
virtual string | getCurrentUDL (void) const throw (cMsgException) |
Gets UDL of the current connection, "null" if no connection. More... | |
virtual string | getName (void) const |
Gets connection name. More... | |
virtual string | getDescription (void) const |
Gets connection description. More... | |
virtual bool | isConnected (void) const throw (cMsgException) |
True if connected. More... | |
virtual bool | isReceiving (void) const throw (cMsgException) |
True if receiving messages. More... | |
virtual void | setShutdownHandler (cMsgShutdownHandler *handler, void *userArg) throw (cMsgException) |
Sets shutdown handler. More... | |
virtual void | shutdownClients (const string &client, int flag) throw (cMsgException) |
Shuts down a client. More... | |
virtual void | shutdownServers (const string &server, int flag) throw (cMsgException) |
Shuts down a server. More... | |
virtual cMsgMessage * | monitor (const string &monString) throw (cMsgException) |
Returns domain-dependent monitoring information. More... | |
virtual void | setMonitoringString (const string &monString) throw (cMsgException) |
Sets monitoring string. More... | |
cMsg::cMsg | ( | const string & | UDL, |
const string & | name, | ||
const string & | descr | ||
) |
Constructor for cMsg system object.
UDL | Connection UDL |
name | Name |
descr | Description |
Definition at line 1642 of file cMsgWrapper.cc.
|
virtual |
Destructor disconects from cMsg system.
cMsgException |
Definition at line 1654 of file cMsgWrapper.cc.
References disconnect().
|
virtual |
Connects to cMsg system.
If a connection has already been made, a reconnection will be attempted. In a reconnection, if there is no current connection one will be made. If there is a current, healthy connection and if the UDL to which a connection attempt will be made is identical to the currentUDL, nothing is done. If there is a current, healthy connection, and if the UDL to which a connection attempt will be made is different from the current UDL, the current connection will be disconnected and a new connection attempted with the new UDL.
cMsgException |
Definition at line 1673 of file cMsgWrapper.cc.
|
virtual |
Disconnects from cMsg system.
cMsgException |
Definition at line 1699 of file cMsgWrapper.cc.
Referenced by ~cMsg().
|
virtual |
Flushes outgoing message queues.
timeout | Timeout |
cMsgException |
Definition at line 2131 of file cMsgWrapper.cc.
|
virtual |
Gets UDL of the current connection, "null" if no connection.
cMsgException |
Definition at line 2248 of file cMsgWrapper.cc.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
True if connected.
cMsgException |
Definition at line 2273 of file cMsgWrapper.cc.
|
virtual |
True if receiving messages.
cMsgException |
Definition at line 2295 of file cMsgWrapper.cc.
|
virtual |
Returns domain-dependent monitoring information.
monString | Monitoring request string |
cMsgException |
Definition at line 2384 of file cMsgWrapper.cc.
|
virtual |
Sends message.
msg | Message to send |
cMsgException |
Definition at line 1718 of file cMsgWrapper.cc.
Referenced by send().
|
virtual |
Sends message.
msg | Message to send |
cMsgException |
Definition at line 1739 of file cMsgWrapper.cc.
References send().
|
virtual |
Sends message and gets reply.
sendMsg | Message to send |
timeout | Timeout |
cMsgException |
Definition at line 2050 of file cMsgWrapper.cc.
|
virtual |
Sends message and gets reply.
sendMsg | Message to send |
timeout | Timeout |
cMsgException |
Definition at line 2078 of file cMsgWrapper.cc.
|
virtual |
Sets monitoring string.
monString | Monitoring string |
cMsgException |
Definition at line 2410 of file cMsgWrapper.cc.
|
virtual |
Sets shutdown handler.
handler | Shutdown handler |
userArg | Arg passed to handler upon shutdown |
cMsgException |
Definition at line 2318 of file cMsgWrapper.cc.
|
virtual |
Sets the connection UDL.
Any subsequent failovers or reconnects will use the new UDL.
udl | new UDL |
cMsgException |
Definition at line 2230 of file cMsgWrapper.cc.
|
virtual |
Shuts down a client.
client | The client |
flag | Shutdown flag |
cMsgException |
Definition at line 2340 of file cMsgWrapper.cc.
|
virtual |
Shuts down a server.
server | The server |
flag | Shutdown flag |
cMsgException |
Definition at line 2362 of file cMsgWrapper.cc.
|
virtual |
Enables delivery of messages to callbacks.
cMsgException |
Definition at line 2150 of file cMsgWrapper.cc.
|
virtual |
Disables delivery of messages to callbacks.
cMsgException |
Definition at line 2169 of file cMsgWrapper.cc.
|
virtual |
Subscribes to subject,type and specifies callback, userArg.
subject | Subject, can be regex |
type | Type, can be regex |
cb | Callback object to deliver messages to |
userArg | Passed to callback with message |
cfg | Subscription config object |
cMsgException | if subscription fails, object was not initialized, or for some underlying domain's reason |
Definition at line 1800 of file cMsgWrapper.cc.
Referenced by subscribe().
|
virtual |
Subscribes to subject,type and specifies callback,userArg.
subject | Subject, can be regex |
type | Type, can be regex |
cb | Callback object to deliver messages to |
userArg | Passed to callback with message |
cfg | Subscription config object |
cMsgException | if subscription fails, object was not initialized, or for some underlying domain's reason |
Definition at line 1857 of file cMsgWrapper.cc.
References subscribe().
|
virtual |
Subscribes to subject/type, returns one matching message, then unsubscribes.
subject | Subject, can be regex |
type | Type, can be regex |
timeout | Timeout |
cMsgException |
Definition at line 2106 of file cMsgWrapper.cc.
|
virtual |
Return the total number of messages passed to the given subscription's callback.
handle | Subscription handle |
cMsgException |
Definition at line 1998 of file cMsgWrapper.cc.
|
virtual |
Pause delivery of messages to the given subscription's callback.
handle | Subscription handle |
cMsgException |
Definition at line 1903 of file cMsgWrapper.cc.
|
virtual |
Clear all messages from the given subscription callback's queue.
handle | Subscription handle |
cMsgException |
Definition at line 1949 of file cMsgWrapper.cc.
|
virtual |
Return the number of messages currently in the given subscription callback's queue.
handle | Subscription handle |
cMsgException |
Definition at line 1973 of file cMsgWrapper.cc.
|
virtual |
Returns whether the given subscription callback's queue is full (true) or not.
handle | Subscription handle |
cMsgException |
Definition at line 2023 of file cMsgWrapper.cc.
|
virtual |
Resume delivery of messages to the given subscription's callback if paused.
handle | Subscription handle |
cMsgException |
Definition at line 1926 of file cMsgWrapper.cc.
|
virtual |
Synchronously sends message.
msg | Message to send |
timeout | Timeout |
cMsgException |
Definition at line 1754 of file cMsgWrapper.cc.
Referenced by syncSend().
|
virtual |
Synchronously sends message.
msg | Message to send |
timeout | Timeout |
cMsgException |
Definition at line 1779 of file cMsgWrapper.cc.
References syncSend().
|
virtual |
Unsubscribes.
handle | Subscription handle |
cMsgException |
Definition at line 1872 of file cMsgWrapper.cc.