Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

CascadeMessage Class Reference

type of messages received from a wormhole More...

#include <cascade/interprocess/CascadeMessage.h>

Inheritance diagram for CascadeMessage:

CascadeObject List of all members.

Public Member Functions

const CascadeTime::TimeBaseGetTimeSent () const
const CascadeTime::TimeBaseGetTimeReceived () const
const char * GetSourceWormholeURL () const
const char * GetTargetWormholeURL () const
bool IsReplyRequired () const
u32 GetMessageID () const
u32 GetMessageId () const
u32 ID () const
u32 Id () const
void * GetData () const
u32 GetDataSize () const

Static Public Member Functions

static u32 FindOrCreateMessage (const char *pMessageName)
static u32 FindMessage (const char *pMessageName)
static bool GetMessageNameFromID (u32 nID, char *pBuff, u32 nBuffLen)

Friends

class CascadeWormhole

Detailed Description

type of messages received from a wormhole

Skip the description

CascadeMessage is the class type for messages sent through CascadeWormholes. CascadeMessage is also used (via static functions) to generate unique message ids from string names for use in wormhole delivery functions. These messageIDs serve to type clients' messages as they travel through the wormhole.

As the class type that is received from CascadeWormholes, CascadeMessage contains only opaque members. Use the accessor functions to retrieve interesting values from CascadeMessage.

The CascadeMessage Lifetime

The data referred to by a CascadeMessage is only valid from the point at which the message is received until the point at which the next message is waited for. Accessor functions for CascadeMessage return values which are only valid for the lifetime of the CascadeMessage. If you need to preserve these values then copy them, do not cache them.


class CascadeMessage


Member Function Documentation

static u32 CascadeMessage::FindMessage const char *  pMessageName  )  [static]
 

returns an existing messageID

FindMessage() finds and returns the ID for the message named pMessageName. FindMessage() returns 0 if the message named pMessageName was not found.

Parameters:
pMessageName the message name for which to find the messageID
Returns:
the messageID or 0 if the message was not found

static u32 CascadeMessage::FindOrCreateMessage const char *  pMessageName  )  [static]
 

returns an existing or allocates a new messageID

Call FindOrCreateMessage() to find or create a new ID for the message named pMessageName. FindOrCreateMessage() returns the messageID or 0 if a messageID could not be created.

Parameters:
pMessageName the message name for which to find or create a messageID
Returns:
the messageID or 0 if no messageID could be created

void* CascadeMessage::GetData  )  const
 

gets the message data

GetData() returns the data that was sent with the wormhole message.

Returns:
a pointer to the data sent with the wormhole message or NULL if no data was sent
Note:
the return value is only valid for the lifetime of the CascadeMessage
See also:
The CascadeMessage Lifetime

GetDataSize();

u32 CascadeMessage::GetDataSize  )  const
 

gets the size in bytes of the message data

GetDataSize() returns the size of the data pointed to by the return value of GetData()

Returns:
the size in bytes of the message data
Note:
the return value is only valid for the lifetime of the CascadeMessage
See also:
The CascadeMessage Lifetime

GetData()

u32 CascadeMessage::GetMessageId  )  const [inline]
 

gets the messageID of the message

GetMessageId() returns the messageID of the message.

Returns:
the messageID of the message
Note:
the return value is only valid for the lifetime of the CascadeMessage
See also:
The CascadeMessage Lifetime

u32 CascadeMessage::GetMessageID  )  const
 

gets the messageID of the message

GetMessageID() returns the messageID of the message.

Returns:
the messageID of the message
Note:
the return value is only valid for the lifetime of the CascadeMessage
See also:
The CascadeMessage Lifetime

static bool CascadeMessage::GetMessageNameFromID u32  nID,
char *  pBuff,
u32  nBuffLen
[static]
 

converts a messageID to its string name

GetMessageNameFromID() fills *pBuff with the message name of the message identified by nID. nID must refer to a previously created custom message created with FindOrCreateMessage(). GetMessageNameFromID() returns false if there is no message registered with id nID or if the pBuff whose length is identified by nBuffLen is too short to hold the message name.

Parameters:
nID the messageID of the message
pBuff the buffer to fill with the name of the message
nBuffLen the length of pBuff in bytes
Returns:
whether or not pBuff was successfully filled with the message name

const char* CascadeMessage::GetSourceWormholeURL  )  const
 

gets the URL of the wormhole that sent the message

GetSourceWormholeURL() gets the URL of the wormhole that sent the message.

Returns:
the URL of the wormhole that sent the message
Note:
the const char * return value is only valid for the lifetime of the CascadeMessage
See also:
The CascadeMessage Lifetime

const char* CascadeMessage::GetTargetWormholeURL  )  const
 

gets the URL of the delivery target

GetTargetWormholeURL() gets the URL that was used as the destination for the CascadeMessage. In the case of a broadcast message, this URL is the URL that was used for the broadcast. In the case of a message sent or posted to a specific wormhole, this URL is the URL of that wormhole.

Returns:
the URL that was used as the target URL when the message was delivered
Note:
the const char * return value is only valid for the lifetime of the CascadeMessage
See also:
The CascadeMessage Lifetime

const CascadeTime::TimeBase& CascadeMessage::GetTimeReceived  )  const
 

gets the time a message was received

GetTimeReceived() returns the time the message was received

Returns:
the time the message was received

const CascadeTime::TimeBase& CascadeMessage::GetTimeSent  )  const
 

gets the time a message was sent

GetTimeSent() returns the time the message was sent

Returns:
the time the message was sent

u32 CascadeMessage::Id  )  const [inline]
 

gets the messageID of the message

Id() returns the messageID of the message.

Note:
the return value is only valid for the lifetime of the CascadeMessage
See also:
The CascadeMessage Lifetime
Returns:
the messageID of the message

u32 CascadeMessage::ID  )  const [inline]
 

gets the messageID of the message

ID() returns the messageID of the message.

Note:
the return value is only valid for the lifetime of the CascadeMessage
See also:
The CascadeMessage Lifetime
Returns:
the messageID of the message

bool CascadeMessage::IsReplyRequired  )  const
 

determines whether or not a reply to this message is required

IsReplyRequired() determines whether or not a reply to this message is required. If a reply is required, the sending process is blocked until a reply is sent. If no reply is explicitly sent, an auto reply message will be sent when the lifetime of the CascadeMessage has expired.

Returns:
whether or not a reply is required
Note:
the return value is only valid for the lifetime of the CascadeMessage
See also:
CascadeWormhole::SendReply()

The CascadeMessage Lifetime


Friends And Related Function Documentation

friend class CascadeWormhole [friend]
 


The documentation for this class was generated from the following file:
Generated on Sun Jul 24 14:27:19 2005 for Cascade Library by  doxygen 1.4.1