Codemesh Runtime v3 C++ API Reference  3.9.205
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
xmog_reply Class Reference
Inheritance diagram for xmog_reply:
Inheritance graph
[legend]

Public Types

enum  Disposition { SUCCESS = 1, TIMEOUT, COMM_FAILURE }
 The Disposition indicates whether the requested operation was even carried out. If not SUCCESS, the operation was not executed for the indicated reason. If SUCCESS, the rest of the reply's data indicates the actual result of the operation.
 
enum  { INIT_BLOCK_SIZE = 4096 }
 

Public Member Functions

 xmog_reply (Disposition disp, xmog::xmog_message_id t=xmog::NONE, ACE_Message_Block *b=0)
 
 xmog_reply (const xmog_reply &r)
 
xmog_replyoperator= (const xmog_reply &r)
 
Disposition disposition (void) const
 
xmog::xmog_message_id type (void) const
 type() returns the message reply type. If the disposition is not SUCCESS, this value is meaningless.
 
virtual bool matches (const xmog_request *req) const
 Check to see if the specified xmog_request matches this xmog_reply. The reply type needs to match the request type and the JVM pointer needs to match as well. More specific reply types can refine the check as needed.
 
void dump ()
 

Static Public Member Functions

static xmog_replydecode (ACE_Message_Block *b)
 Factory function that decodes an incoming reply and creates a xmog_reply-descended reply object. More...
 

Protected Member Functions

virtual bool unmarshal (void)
 
int readBoolean (bool &b)
 Reads a bool from the message.
 
int readByte (jbyte &b)
 Reads a byte from the message.
 
int readChar (jchar &c)
 Reads a jchar from the message.
 
int readDouble (jdouble &d)
 Reads a jdouble from the message.
 
int readFloat (jfloat &f)
 Reads a jfloat from the message.
 
int readInt (jint &i)
 Reads a 32bit integer from the message. More...
 
int readShort (jshort &s)
 Reads a 16bit integer from the message. More...
 
int readLong (jlong &l)
 Reads a 64-bit integer from the message. More...
 
int readClassName (char **str)
 Reads a UTF string from the message. More...
 
int readUTF (char **str, jint *len=NULL)
 Reads a UTF string from the message. More...
 
int readLongUTF (char **str, jint *len=NULL)
 Reads a long UTF string from the message. More...
 
int readStringProxy (xmog_remote_java_value &data, xmog::xmog_data_code code)
 Reads a string proxy from the message.
 
int read_data_code (xmog::xmog_data_code &code)
 Reads a data code. More...
 
int readData (xmog_remote_java_value &data)
 Reads a data object from the message. More...
 
int readExc (xmog_remote_java_exception &data)
 Reads an exception from the message. More...
 
int readDataProxy (xmog_remote_java_value &data)
 Reads a data proxy object from the message. More...
 

Constructor & Destructor Documentation

◆ xmog_reply()

xmog_reply::xmog_reply ( Disposition  disp,
xmog::xmog_message_id  t = xmog::NONE,
ACE_Message_Block *  b = 0 
)

Constructor, specifying the reply type and the associated ACE_Message_Block, if there is one.

Parameters
bACE_Message_Block pointer with any data associated with the reply. The block's rd_ptr should be pointing to the reply data. Upon return, the xmog_reply owns the block and the caller must no longer refer to it.

Member Function Documentation

◆ decode()

static xmog_reply* xmog_reply::decode ( ACE_Message_Block *  b)
static

Factory function that decodes an incoming reply and creates a xmog_reply-descended reply object.

Parameters
bPointer to an ACE_Message_Block containing the raw reply data. The block's rd_ptr is expected to point to the byte following the message's length field. The block's wr_ptr is expected to reflect the end of the reply's data. The created xmog_reply object will control b.
Return values
Pointerto an xmog_reply object; 0 if an error occurs. If an error occurs, the caller retains control of
  • b. Upon success, the caller must no longer refer to
  • b.

◆ read_data_code()

int xmog_reply::read_data_code ( xmog::xmog_data_code &  code)
protected

Reads a data code.

Parameters
codethe object's code.

◆ readClassName()

int xmog_reply::readClassName ( char **  str)
protected

Reads a UTF string from the message.

Parameters
strreceives the classname in UTF encoding.

◆ readData()

int xmog_reply::readData ( xmog_remote_java_value data)
protected

Reads a data object from the message.

Parameters
datathe utility object that will hold that data.

◆ readDataProxy()

int xmog_reply::readDataProxy ( xmog_remote_java_value data)
protected

Reads a data proxy object from the message.

Parameters
datathe utility object that will hold that data.

◆ readExc()

int xmog_reply::readExc ( xmog_remote_java_exception data)
protected

Reads an exception from the message.

Parameters
datathe utility object that will hold that data.

◆ readInt()

int xmog_reply::readInt ( jint &  i)
protected

Reads a 32bit integer from the message.

This method converts the number from network to host order.

◆ readLong()

int xmog_reply::readLong ( jlong &  l)
protected

Reads a 64-bit integer from the message.

This method converts the number from network to host order.

◆ readLongUTF()

int xmog_reply::readLongUTF ( char **  str,
jint *  len = NULL 
)
protected

Reads a long UTF string from the message.

Parameters
strreceives the string in UTF encoding. In many cases, developers can directly use this method, which is much faster than the corresponding readString() methods because no conversion has to be performed.
lenan optional pointer to hold the number of bytes that were read.

◆ readShort()

int xmog_reply::readShort ( jshort &  s)
protected

Reads a 16bit integer from the message.

This method converts the number from network to host order.

◆ readUTF()

int xmog_reply::readUTF ( char **  str,
jint *  len = NULL 
)
protected

Reads a UTF string from the message.

Parameters
strreceives the string in UTF encoding. In many cases, developers can directly use this method, which is much faster than the corresponding readString() methods because no conversion has to be performed.
lenan optional pointer to hold the number of bytes that were read.

The documentation for this class was generated from the following file:

Copyright (c) 1999-2020 by Codemesh, Inc., ALL RIGHTS RESERVED.