cmsg::cMsg Class Reference

#include <cMsg.hxx>

List of all members.


Detailed Description

Wraps most cMsg C calls, provides main functionality.

Definition at line 363 of file cMsg.hxx.

Public Member Functions

 cMsg (const string &UDL, const string &name, const string &descr)
 Constructor for cMsg system object.
virtual ~cMsg (void)
 Destructor disconects from cMsg system.
virtual void connect () throw (cMsgException)
 Connects to cMsg system.
virtual void disconnect (void) throw (cMsgException)
 Disconnects from cMsg system.
virtual void send (cMsgMessage &msg) throw (cMsgException)
 Sends message.
virtual void send (cMsgMessage *msg) throw (cMsgException)
 Sends message.
virtual int syncSend (cMsgMessage &msg, const struct timespec *timeout=NULL) throw (cMsgException)
 Synchronously sends message.
virtual int syncSend (cMsgMessage *msg, const struct timespec *timeout=NULL) throw (cMsgException)
 Synchronously sends message.
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.
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.
virtual void unsubscribe (void *handle) throw (cMsgException)
 Unsubscribes.
virtual void subscriptionPause (void *handle) throw (cMsgException)
 Pause delivery of messages to the given subscription's callback.
virtual void subscriptionResume (void *handle) throw (cMsgException)
 Resume delivery of messages to the given subscription's callback if paused.
virtual void subscriptionQueueClear (void *handle) throw (cMsgException)
 Clear all messages from the given subscription callback's queue.
virtual int subscriptionQueueCount (void *handle) throw (cMsgException)
 Return the number of messages currently in the given subscription callback's queue.
virtual bool subscriptionQueueIsFull (void *handle) throw (cMsgException)
 Returns whether the given subscription callback's queue is full (true) or not.
virtual int subscriptionMessagesTotal (void *handle) throw (cMsgException)
 Return the total number of messages passed to the given subscription's callback.
virtual cMsgMessagesendAndGet (cMsgMessage &sendMsg, const struct timespec *timeout=NULL) throw (cMsgException)
 Sends message and gets reply.
virtual cMsgMessagesendAndGet (cMsgMessage *sendMsg, const struct timespec *timeout=NULL) throw (cMsgException)
 Sends message and gets reply.
virtual cMsgMessagesubscribeAndGet (const string &subject, const string &type, const struct timespec *timeout=NULL) throw (cMsgException)
 Subscribes to subject/type, returns one matching message, then unsubscribes.
virtual void flush (const struct timespec *timeout=NULL) throw (cMsgException)
 Flushes outgoing message queues.
virtual void start (void) throw (cMsgException)
 Enables delivery of messages to callbacks.
virtual void stop (void) throw (cMsgException)
 Disables delivery of messages to callbacks.
virtual void setUDL (const string &udl) throw (cMsgException)
 Sets the connection UDL.
virtual string getUDL (void) const
 Gets connection UDL.
virtual string getCurrentUDL (void) const throw (cMsgException)
 Gets UDL of the current connection, "null" if no connection.
virtual string getName (void) const
 Gets connection name.
virtual string getDescription (void) const
 Gets connection description.
virtual bool isConnected (void) const throw (cMsgException)
 True if connected.
virtual bool isReceiving (void) const throw (cMsgException)
 True if receiving messages.
virtual void setShutdownHandler (cMsgShutdownHandler *handler, void *userArg) throw (cMsgException)
 Sets shutdown handler.
virtual void shutdownClients (const string &client, int flag) throw (cMsgException)
 Shuts down a client.
virtual void shutdownServers (const string &server, int flag) throw (cMsgException)
 Shuts down a server.
virtual cMsgMessagemonitor (const string &monString) throw (cMsgException)
 Returns domain-dependent monitoring information.


Constructor & Destructor Documentation

cMsg::cMsg const string &  UDL,
const string &  name,
const string &  descr
 

Constructor for cMsg system object.

Parameters:
UDL Connection UDL
name Name
descr Description

Definition at line 1642 of file cMsgWrapper.cc.

cMsg::~cMsg void   )  [virtual]
 

Destructor disconects from cMsg system.

Exceptions:
cMsgException 

Definition at line 1654 of file cMsgWrapper.cc.


Member Function Documentation

void cMsg::connect void   )  throw (cMsgException) [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.

Exceptions:
cMsgException 

Definition at line 1673 of file cMsgWrapper.cc.

void cMsg::disconnect void   )  throw (cMsgException) [virtual]
 

Disconnects from cMsg system.

Exceptions:
cMsgException 

Definition at line 1699 of file cMsgWrapper.cc.

void cMsg::flush const struct timespec *  timeout = NULL  )  throw (cMsgException) [virtual]
 

Flushes outgoing message queues.

Parameters:
timeout Timeout
Exceptions:
cMsgException 

Definition at line 2131 of file cMsgWrapper.cc.

string cMsg::getCurrentUDL void   )  const throw (cMsgException) [virtual]
 

Gets UDL of the current connection, "null" if no connection.

Returns:
UDL of current connection
Exceptions:
cMsgException 

Definition at line 2248 of file cMsgWrapper.cc.

string cMsg::getDescription void   )  const [virtual]
 

Gets connection description.

Returns:
Description

Definition at line 2189 of file cMsgWrapper.cc.

string cMsg::getName void   )  const [virtual]
 

Gets connection name.

Returns:
Name

Definition at line 2202 of file cMsgWrapper.cc.

string cMsg::getUDL void   )  const [virtual]
 

Gets connection UDL.

Returns:
UDL

Definition at line 2215 of file cMsgWrapper.cc.

bool cMsg::isConnected void   )  const throw (cMsgException) [virtual]
 

True if connected.

Returns:
True if connected
Exceptions:
cMsgException 

Definition at line 2273 of file cMsgWrapper.cc.

bool cMsg::isReceiving void   )  const throw (cMsgException) [virtual]
 

True if receiving messages.

Returns:
True if receiving messages
Exceptions:
cMsgException 

Definition at line 2295 of file cMsgWrapper.cc.

cMsgMessage * cMsg::monitor const string &  monString  )  throw (cMsgException) [virtual]
 

Returns domain-dependent monitoring information.

Parameters:
monString Monitoring request string
Returns:
Message containing monitoring information in text field
Exceptions:
cMsgException 

Definition at line 2384 of file cMsgWrapper.cc.

void cMsg::send cMsgMessage msg  )  throw (cMsgException) [virtual]
 

Sends message.

Parameters:
msg Message to send
Exceptions:
cMsgException 

Definition at line 1739 of file cMsgWrapper.cc.

void cMsg::send cMsgMessage msg  )  throw (cMsgException) [virtual]
 

Sends message.

Parameters:
msg Message to send
Exceptions:
cMsgException 

Definition at line 1718 of file cMsgWrapper.cc.

cMsgMessage * cMsg::sendAndGet cMsgMessage sendMsg,
const struct timespec *  timeout = NULL
throw (cMsgException) [virtual]
 

Sends message and gets reply.

Parameters:
sendMsg Message to send
timeout Timeout
Returns:
Reply message
Exceptions:
cMsgException 

Definition at line 2078 of file cMsgWrapper.cc.

cMsgMessage * cMsg::sendAndGet cMsgMessage sendMsg,
const struct timespec *  timeout = NULL
throw (cMsgException) [virtual]
 

Sends message and gets reply.

Parameters:
sendMsg Message to send
timeout Timeout
Returns:
Reply message
Exceptions:
cMsgException 

Definition at line 2050 of file cMsgWrapper.cc.

void cMsg::setShutdownHandler cMsgShutdownHandler *  handler,
void *  userArg
throw (cMsgException) [virtual]
 

Sets shutdown handler.

Parameters:
handler Shutdown handler
userArg Arg passed to handler upon shutdown
Exceptions:
cMsgException 

Definition at line 2318 of file cMsgWrapper.cc.

void cMsg::setUDL const string &  udl  )  throw (cMsgException) [virtual]
 

Sets the connection UDL.

Any subsequent failovers or reconnects will use the new UDL.

Parameters:
udl new UDL
Exceptions:
cMsgException 

Definition at line 2230 of file cMsgWrapper.cc.

void cMsg::shutdownClients const string &  client,
int  flag
throw (cMsgException) [virtual]
 

Shuts down a client.

Parameters:
client The client
flag Shutdown flag
Exceptions:
cMsgException 

Definition at line 2340 of file cMsgWrapper.cc.

void cMsg::shutdownServers const string &  server,
int  flag
throw (cMsgException) [virtual]
 

Shuts down a server.

Parameters:
server The server
flag Shutdown flag
Exceptions:
cMsgException 

Definition at line 2362 of file cMsgWrapper.cc.

void cMsg::start void   )  throw (cMsgException) [virtual]
 

Enables delivery of messages to callbacks.

Exceptions:
cMsgException 

Definition at line 2150 of file cMsgWrapper.cc.

void cMsg::stop void   )  throw (cMsgException) [virtual]
 

Disables delivery of messages to callbacks.

Exceptions:
cMsgException 

Definition at line 2169 of file cMsgWrapper.cc.

void * cMsg::subscribe const string &  subject,
const string &  type,
cMsgCallback cb,
void *  userArg,
const cMsgSubscriptionConfig cfg = NULL
throw (cMsgException) [virtual]
 

Subscribes to subject,type and specifies callback,userArg.

Parameters:
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
Returns:
Subscription handle, needed to unsubscribe
Exceptions:
cMsgException if subscription fails, object was not initialized, or for some underlying domain's reason

Definition at line 1857 of file cMsgWrapper.cc.

void * cMsg::subscribe const string &  subject,
const string &  type,
cMsgCallback cb,
void *  userArg,
const cMsgSubscriptionConfig cfg = NULL
throw (cMsgException) [virtual]
 

Subscribes to subject,type and specifies callback, userArg.

Parameters:
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
Returns:
Subscription handle, needed to unsubscribe
Exceptions:
cMsgException if subscription fails, object was not initialized, or for some underlying domain's reason

Definition at line 1800 of file cMsgWrapper.cc.

cMsgMessage * cMsg::subscribeAndGet const string &  subject,
const string &  type,
const struct timespec *  timeout = NULL
throw (cMsgException) [virtual]
 

Subscribes to subject/type, returns one matching message, then unsubscribes.

Parameters:
subject Subject, can be regex
type Type, can be regex
timeout Timeout
Returns:
Matching message
Exceptions:
cMsgException 

Definition at line 2106 of file cMsgWrapper.cc.

int cMsg::subscriptionMessagesTotal void *  handle  )  throw (cMsgException) [virtual]
 

Return the total number of messages passed to the given subscription's callback.

Parameters:
handle Subscription handle
Returns:
total number of messages passed to the given subscription's callback
Exceptions:
cMsgException 

Definition at line 1998 of file cMsgWrapper.cc.

void cMsg::subscriptionPause void *  handle  )  throw (cMsgException) [virtual]
 

Pause delivery of messages to the given subscription's callback.

Parameters:
handle Subscription handle
Exceptions:
cMsgException 

Definition at line 1903 of file cMsgWrapper.cc.

void cMsg::subscriptionQueueClear void *  handle  )  throw (cMsgException) [virtual]
 

Clear all messages from the given subscription callback's queue.

Parameters:
handle Subscription handle
Exceptions:
cMsgException 

Definition at line 1949 of file cMsgWrapper.cc.

int cMsg::subscriptionQueueCount void *  handle  )  throw (cMsgException) [virtual]
 

Return the number of messages currently in the given subscription callback's queue.

Parameters:
handle Subscription handle
Returns:
number of messages currently in the given subscription callback's queue
Exceptions:
cMsgException 

Definition at line 1973 of file cMsgWrapper.cc.

bool cMsg::subscriptionQueueIsFull void *  handle  )  throw (cMsgException) [virtual]
 

Returns whether the given subscription callback's queue is full (true) or not.

Parameters:
handle Subscription handle
Returns:
boolean stating whether the given subscription callback's queue is full or not
Exceptions:
cMsgException 

Definition at line 2023 of file cMsgWrapper.cc.

void cMsg::subscriptionResume void *  handle  )  throw (cMsgException) [virtual]
 

Resume delivery of messages to the given subscription's callback if paused.

Parameters:
handle Subscription handle
Exceptions:
cMsgException 

Definition at line 1926 of file cMsgWrapper.cc.

int cMsg::syncSend cMsgMessage msg,
const struct timespec *  timeout = NULL
throw (cMsgException) [virtual]
 

Synchronously sends message.

Parameters:
msg Message to send
timeout Timeout
Exceptions:
cMsgException 

Definition at line 1779 of file cMsgWrapper.cc.

int cMsg::syncSend cMsgMessage msg,
const struct timespec *  timeout = NULL
throw (cMsgException) [virtual]
 

Synchronously sends message.

Parameters:
msg Message to send
timeout Timeout
Exceptions:
cMsgException 

Definition at line 1754 of file cMsgWrapper.cc.

void cMsg::unsubscribe void *  handle  )  throw (cMsgException) [virtual]
 

Unsubscribes.

Parameters:
handle Subscription handle
Exceptions:
cMsgException 

Definition at line 1872 of file cMsgWrapper.cc.


The documentation for this class was generated from the following files:
Generated on Fri Oct 21 09:54:18 2011 for cMsg Messaging System by  doxygen 1.3.9.1