|
|
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:
name | Name of the message - must not be NULL or empty |
retval | Default 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:
_data | Pointer 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:
id | Unique 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:
received | True if message was processed locally |
id | Unique 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:
str | String to decode |
id | A 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:
str | String to decode |
received | Pointer to variable to store the dispatch return value |
id | The 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. |