Codemesh Runtime v3 C++ API Reference  3.9.205
xmog_remote_message.h
1 //
2 // Copyright (c) 1999-2020 by Codemesh, Inc.. ALL RIGHTS RESERVED.
3 //
4 
5 
6 #ifndef xmog_remote_message_inc
7 #define xmog_remote_message_inc
8 
9 
10 #include "xmog.h"
11 
12 
13 struct iovec;
14 class xmog_java_class;
15 
16 
23 class XMOG_DECLSPEC xmog_remote_message
24 {
25 public:
26 
31  {
32  NONE = 0,
33 
34  SIGN_ON = 1,
35  SIGN_ON_STATUS = 2,
36 
37  THREAD_ID_REQUEST = 3,
38  THREAD_ID_ASSIGNMENT = 4,
39 
40  THREAD_TERMINATED = 5,
41  SESSION_TERMINATED = 6,
42 
43  DROP_OBJECT_REFS = 7,
44 
45  CLASS_INFO_REQUEST = 11,
46  CLASS_INFO_RESPONSE = 12,
47 
48  MEMBER_IDS_REQUEST = 13,
49  MEMBER_IDS_ASSIGNMENT = 14,
50 
51  METHOD_CALL = 15,
52  METHOD_RETURN = 16,
53 
54  GET_FIELD_REQUEST = 17,
55  GET_FIELD_RESPONSE = 18,
56 
57  SET_FIELD_REQUEST = 19,
58  SET_FIELD_RESPONSE = 20,
59 
60  CONSTRUCTOR_CALL = 21,
61  CONSTRUCTOR_RETURN = 22
62  };
63 
68  {
69  STATUS_OK = 0,
70  STATUS_NO_NEW_SESSIONS = 1,
71  STATUS_NOT_AUTHORIZED = 2,
72  STATUS_SHUTTING_DOWN = 3
73  };
74 
75 private:
76 
77  xmog_message_id id_;
78 
79  void * body_;
80 
81  void * current_;
82 
83 public:
84 
85  xmog_remote_message( size_t size = 512 );
86 
88 
93  int get_iovecs( iovec * vec );
94 
102  void * body() const;
103 
107  void prependLength();
108 
112  void writeBoolean( bool b );
113 
117  bool readBoolean();
118 
122  void writeByte( jbyte b );
123 
127  jbyte readByte();
128 
132  void writeChar( jchar c );
133 
137  jchar readChar();
138 
142  void writeDouble( jdouble d );
143 
147  jdouble readDouble();
148 
152  void writeFloat( jfloat d );
153 
157  jfloat readFloat();
158 
164  void writeInt( jint i );
165 
171  jint readInt();
172 
178  void writeShort( jshort s );
179 
185  jshort readShort();
186 
197  void writeString( const char * str, size_t len = (size_t)-1 );
198 
210  void writeString( const XMOG_WCHAR * str, size_t len = (size_t)-1 );
211 
221  void writeUTF( const char * utf, size_t len = (size_t)-1 );
222 
241  static xmog_remote_message * createSignOnMessage( const char * serverAppNameUTF ,
242  const char * clientDisplayNameUTF = NULL,
243  bool alignDataForClient = true,
244  const char * clientSignOnNameUTF = NULL,
245  const char * clientCredentialsUTF = NULL,
246  int authenticationType = 0 );
247 
252  static xmog_remote_message * createSignOffMessage();
253 
259  static xmog_remote_message * createMemberIDsRequestMessage( xmog_java_class * _clazz );
260 
266  static xmog_remote_message * createMessage( void * body );
267 
271  int getMessageCode( int & code );
272 
276  int getSignOnReplyCode( int & code );
277 
278 
279 
280  void dump();
281 };
282 
283 
284 #endif /* xmog_remote_message_inc */
xmog_remote_message::xmog_signon_status
xmog_signon_status
The signon request reply codes used by the server.
Definition: xmog_remote_message.h:67
xmog_remote_message::xmog_message_id
xmog_message_id
The message types that are used in the framework.
Definition: xmog_remote_message.h:30
xmog_remote_message
A class that provides services for creating message packages or decoding message packages.
Definition: xmog_remote_message.h:23
xmog_java_class
A C++ wrapper for Java types.
Definition: xmog_java_class.h:31

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