Codemesh Runtime v3 C++ API Reference
3.9.205
|
A class that provides services for creating message packages or decoding message packages. More...
#include <xmog_remote_message.h>
Public Types | |
enum | xmog_message_id { NONE = 0, SIGN_ON = 1, SIGN_ON_STATUS = 2, THREAD_ID_REQUEST = 3, THREAD_ID_ASSIGNMENT = 4, THREAD_TERMINATED = 5, SESSION_TERMINATED = 6, DROP_OBJECT_REFS = 7, CLASS_INFO_REQUEST = 11, CLASS_INFO_RESPONSE = 12, MEMBER_IDS_REQUEST = 13, MEMBER_IDS_ASSIGNMENT = 14, METHOD_CALL = 15, METHOD_RETURN = 16, GET_FIELD_REQUEST = 17, GET_FIELD_RESPONSE = 18, SET_FIELD_REQUEST = 19, SET_FIELD_RESPONSE = 20, CONSTRUCTOR_CALL = 21, CONSTRUCTOR_RETURN = 22 } |
The message types that are used in the framework. | |
enum | xmog_signon_status { STATUS_OK = 0, STATUS_NO_NEW_SESSIONS = 1, STATUS_NOT_AUTHORIZED = 2, STATUS_SHUTTING_DOWN = 3 } |
The signon request reply codes used by the server. | |
Public Member Functions | |
xmog_remote_message (size_t size=512) | |
int | get_iovecs (iovec *vec) |
Returns the number of entries in the iovec[]. More... | |
void * | body () const |
Returns the message body. More... | |
void | prependLength () |
Prepends the message length to the message. | |
void | writeBoolean (bool b) |
Appends a bool to the message. | |
bool | readBoolean () |
Reads a bool from the message. | |
void | writeByte (jbyte b) |
Appends a byte to the message. | |
jbyte | readByte () |
Reads a byte from the message. | |
void | writeChar (jchar c) |
Appends a jchar to the message. | |
jchar | readChar () |
Reads a jchar from the message. | |
void | writeDouble (jdouble d) |
Appends a jdouble to the message. | |
jdouble | readDouble () |
Reads a jdouble from the message. | |
void | writeFloat (jfloat d) |
Appends a jfloat to the message. | |
jfloat | readFloat () |
Reads a jfloat from the message. | |
void | writeInt (jint i) |
Appends a 32bit integer to the message. More... | |
jint | readInt () |
Reads a 32bit integer from the message. More... | |
void | writeShort (jshort s) |
Appends a 16bit integer to the message. More... | |
jshort | readShort () |
Reads a 16bit integer from the message. More... | |
void | writeString (const char *str, size_t len=(size_t) -1) |
Appends a platform string to the message. More... | |
void | writeString (const XMOG_WCHAR *str, size_t len=(size_t) -1) |
Appends a wide string to the message. More... | |
void | writeUTF (const char *utf, size_t len=(size_t) -1) |
Appends a UTF string to the message. More... | |
int | getMessageCode (int &code) |
Retrieves the message code. | |
int | getSignOnReplyCode (int &code) |
Retrieves the sign-on reply code. | |
void | dump () |
Static Public Member Functions | |
static xmog_remote_message * | createSignOnMessage (const char *serverAppNameUTF, const char *clientDisplayNameUTF=NULL, bool alignDataForClient=true, const char *clientSignOnNameUTF=NULL, const char *clientCredentialsUTF=NULL, int authenticationType=0) |
Returns a dynamically allocated, fully initialized message object that can be used to sign on to the server. More... | |
static xmog_remote_message * | createSignOffMessage () |
Returns a dynamically allocated, fully initialized message object that can be used to sign off the server. | |
static xmog_remote_message * | createMemberIDsRequestMessage (xmog_java_class *_clazz) |
Returns a dynamically allocates, fully initialized message object that can be used to query the member ids. More... | |
static xmog_remote_message * | createMessage (void *body) |
Returns a message that represents a server's reply to a client request. More... | |
A class that provides services for creating message packages or decoding message packages.
void* xmog_remote_message::body | ( | ) | const |
Returns the message body.
The message body is an opaque handle to the message content. It is currently implemented as an ACE_Message_Block pointer, but that is an implementation detail that shouldn't be relied upon by a user.
|
static |
Returns a dynamically allocates, fully initialized message object that can be used to query the member ids.
_clazz | the proxy type for which we're asking for an ID and member IDs. |
|
static |
Returns a message that represents a server's reply to a client request.
the | message body as an ACE_Message_Block pointer. |
|
static |
Returns a dynamically allocated, fully initialized message object that can be used to sign on to the server.
serverAppNameUTF | The server can host more than one logical application, each of which is identified by a unique name. A logical application maps to a directory in the server's application root directory. This directory contains all information necessary to initialize the the application. If NULL or the empty string is used here, a default application is used. |
clientDisplayNameUTF | The name under which the session is known on the server. This name is mostly useful for debugging and identifying a particular session in the server monitoring console. |
alignDataForClient | A flag governing whether message data should be aligned or not. |
clientSignOnNameUTF | The username for autenticated login. |
clientCredentialsUTF | The credentials used for authenticated login. |
authenticationType | An index used to select an authentication mechanism. |
int xmog_remote_message::get_iovecs | ( | iovec * | vec | ) |
Returns the number of entries in the iovec[].
vec | the iovec that will be filled with the message contents. |
jint xmog_remote_message::readInt | ( | ) |
Reads a 32bit integer from the message.
This method converts the number from network to host order.
jshort xmog_remote_message::readShort | ( | ) |
Reads a 16bit integer from the message.
This method converts the number from network to host order.
void xmog_remote_message::writeInt | ( | jint | i | ) |
Appends a 32bit integer to the message.
This method converts the number from host to network order.
void xmog_remote_message::writeShort | ( | jshort | s | ) |
Appends a 16bit integer to the message.
This method converts the number from host to network order.
void xmog_remote_message::writeString | ( | const char * | str, |
size_t | len = (size_t) -1 |
||
) |
Appends a platform string to the message.
This method converts the platform string to UTF before appending it to the message.
str | a string in platform encoding. |
len | the optional number of characters to encode. The default is -1, which stands for all characters. |
void xmog_remote_message::writeString | ( | const XMOG_WCHAR * | str, |
size_t | len = (size_t) -1 |
||
) |
Appends a wide string to the message.
This method converts the wide string to UTF before appending it to the message.
str | a string in platform encoding. |
len | the optional number of characters to encode. The default is -1, which stands for all characters. Notice that the argument is the number of characters, not the number of bytes. |
void xmog_remote_message::writeUTF | ( | const char * | utf, |
size_t | len = (size_t) -1 |
||
) |
Appends a UTF string to the message.
str | a string in UTF encoding. In many cases, developers can directly use this method, which is much faster than the corresponding writeString() methods because no conversion has to be performed. |
len | the optional number of characters to encode. The default is -1, which stands for all characters. |