class Message

A message container class. More...

Full nameTelEngine::Message
Definition#include <telengine.h>
InheritsTelEngine::NamedList [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Methods


Detailed Description

This class holds the messages that are moved around in the engine.

 Message (const char *name, const char *retval = 0)

Message

Creates a new message.

Parameters:
nameName of the message - must not be NULL or empty
retvalDefault return value

inline String & retValue ()

retValue

Retrive a reference to the value returned by the message.

Returns: A reference to the value the message will return

inline void * userData ()

userData

[const]

Retrive the obscure data associated with the message

Returns: Pointer to arbitrary user data

inline void  userData (void *_data)

userData

Set obscure data associated with the message

Parameters:
_dataPointer to arbitrary user data

inline Time & msgTime ()

msgTime

Retrive a reference to the creation time of the message.

Returns: A reference to the Time when the message was created

inline Message&  operator= (const char *value)

operator=

Name assignment operator

Reimplemented from NamedList.

String  encode (const char *id)

encode

[const]

Encode the message into a string adequate for sending for processing to an external communication interface

Parameters:
idUnique identifier to add to the string

String  encode (bool received, const char *id)

encode

[const]

Encode the message into a string adequate for sending as answer to an external communication interface

Parameters:
receivedTrue if message was processed locally
idUnique identifier to add to the string

int  decode (const char *str, String &id)

decode

Decode a string from an external communication interface for processing in the engine. The message is modified accordingly.

Parameters:
strString to decode
idA String object in which the identifier is stored

Returns: -2 for success, -1 if the string was not a text form of a message, index of first erroneous character if failed

int  decode (const char *str, bool &received, const char *id)

decode

Decode a string from an external communication interface that is an answer to a specific external processing request.

Parameters:
strString to decode
receivedPointer to variable to store the dispatch return value
idThe identifier expected

Returns: -2 for success, -1 if the string was not the expected answer, index of first erroneous character if failed

void  dispatched (bool accepted)

dispatched

[protected virtual]

Notify the message it has been dispatched


Generated by: kk on nyx on Sat Jun 4 19:29:41 2005, using kdoc 2.0a54.