00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef TAO_CDR_H
00043 #define TAO_CDR_H
00044
00045 #include "ace/pre.h"
00046
00047 #include "tao/orbconf.h"
00048
00049 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00050 # pragma once
00051 #endif
00052
00053 #include "tao/TAO_Export.h"
00054 #include "tao/Basic_Types.h"
00055 #include "tao/GIOP_Message_Version.h"
00056 #include "tao/Message_Semantics.h"
00057
00058 #include "ace/CDR_Stream.h"
00059
00060 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00061
00062 class TAO_ORB_Core;
00063 class TAO_GIOP_Fragmentation_Strategy;
00064 class TAO_Stub;
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084 class TAO_Export TAO_OutputCDR : public ACE_OutputCDR
00085 {
00086 public:
00087
00088 friend class TAO_InputCDR;
00089
00090
00091
00092
00093
00094
00095
00096
00097 TAO_OutputCDR (size_t size = 0,
00098 int byte_order = ACE_CDR_BYTE_ORDER,
00099 ACE_Allocator* buffer_allocator = 0,
00100 ACE_Allocator* data_block_allocator = 0,
00101 ACE_Allocator* message_block_allocator = 0,
00102 size_t memcpy_tradeoff = 0,
00103 ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
00104 ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR);
00105
00106
00107
00108 TAO_OutputCDR (char *data,
00109 size_t size,
00110 int byte_order = ACE_CDR_BYTE_ORDER,
00111 ACE_Allocator* buffer_allocator = 0,
00112 ACE_Allocator* data_block_allocator = 0,
00113 ACE_Allocator* message_block_allocator = 0,
00114 size_t memcpy_tradeoff = 0,
00115 ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
00116 ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR);
00117
00118
00119
00120
00121 TAO_OutputCDR (char *data,
00122 size_t size,
00123 int byte_order,
00124 ACE_Allocator* buffer_allocator,
00125 ACE_Allocator* data_block_allocator,
00126 ACE_Allocator* message_block_allocator,
00127 size_t memcpy_tradeoff,
00128 TAO_GIOP_Fragmentation_Strategy * fs,
00129 ACE_CDR::Octet major_version,
00130 ACE_CDR::Octet minor_version);
00131
00132
00133
00134 TAO_OutputCDR (ACE_Message_Block *data,
00135 int byte_order = ACE_CDR_BYTE_ORDER,
00136 size_t memcpy_tradeoff = 0,
00137 ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
00138 ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR);
00139
00140
00141
00142 TAO_OutputCDR (ACE_Data_Block *data,
00143 int byte_order = ACE_CDR_BYTE_ORDER,
00144 ACE_Allocator* message_block_allocator = 0,
00145 size_t memcpy_tradeoff = 0,
00146 TAO_GIOP_Fragmentation_Strategy * fs = 0,
00147 ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
00148 ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR);
00149
00150
00151 ~TAO_OutputCDR (void);
00152
00153
00154
00155
00156
00157 static void throw_stub_exception (int error_num);
00158 static void throw_skel_exception (int error_num);
00159
00160 void get_version (TAO_GIOP_Message_Version& giop_version);
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174 bool fragment_stream (ACE_CDR::ULong pending_alignment,
00175 ACE_CDR::ULong pending_length);
00176
00177
00178 bool more_fragments (void) const;
00179
00180
00181 void more_fragments (bool more);
00182
00183
00184 void message_attributes (CORBA::ULong request_id,
00185 TAO_Stub * stub,
00186 TAO_Message_Semantics message_semantics,
00187 ACE_Time_Value * timeout);
00188
00189
00190 CORBA::ULong request_id (void) const;
00191
00192
00193 TAO_Stub * stub (void) const;
00194
00195
00196 TAO_Message_Semantics message_semantics (void) const;
00197
00198
00199 ACE_Time_Value * timeout (void) const;
00200
00201
00202 private:
00203
00204
00205 TAO_OutputCDR (const TAO_OutputCDR& rhs);
00206 TAO_OutputCDR& operator= (const TAO_OutputCDR& rhs);
00207
00208 private:
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219 TAO_GIOP_Fragmentation_Strategy * const fragmentation_strategy_;
00220
00221
00222 bool more_fragments_;
00223
00224
00225 CORBA::ULong request_id_;
00226
00227
00228 TAO_Stub * stub_;
00229
00230
00231
00232
00233
00234 TAO_Message_Semantics message_semantics_;
00235
00236
00237 ACE_Time_Value * timeout_;
00238
00239 };
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261 class TAO_Export TAO_InputCDR : public ACE_InputCDR
00262 {
00263 public:
00264
00265
00266
00267
00268
00269 TAO_InputCDR (const char* buf,
00270 size_t bufsiz,
00271 int byte_order = ACE_CDR_BYTE_ORDER,
00272 ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
00273 ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR,
00274 TAO_ORB_Core* orb_core = 0);
00275
00276
00277
00278 TAO_InputCDR (size_t bufsiz,
00279 int byte_order = ACE_CDR_BYTE_ORDER,
00280 ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
00281 ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR,
00282 TAO_ORB_Core* orb_core = 0);
00283
00284
00285 TAO_InputCDR (const ACE_Message_Block *data,
00286 int byte_order = ACE_CDR_BYTE_ORDER,
00287 ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
00288 ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR,
00289 TAO_ORB_Core* orb_core = 0);
00290
00291
00292
00293 TAO_InputCDR (const ACE_Message_Block *data,
00294 ACE_Lock* lock,
00295 int byte_order = ACE_CDR_BYTE_ORDER,
00296 ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
00297 ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR,
00298 TAO_ORB_Core* orb_core = 0);
00299
00300
00301
00302 TAO_InputCDR (ACE_Data_Block *data,
00303 ACE_Message_Block::Message_Flags flag = 0,
00304 int byte_order = ACE_CDR_BYTE_ORDER,
00305 ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
00306 ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR,
00307 TAO_ORB_Core* orb_core = 0);
00308
00309
00310 TAO_InputCDR (ACE_Data_Block *data,
00311 ACE_Message_Block::Message_Flags flag,
00312 size_t read_pointer_position,
00313 size_t write_pointer_position,
00314 int byte_order = ACE_CDR_BYTE_ORDER,
00315 ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
00316 ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR,
00317 TAO_ORB_Core* orb_core = 0);
00318
00319
00320
00321
00322
00323
00324 TAO_InputCDR (const TAO_InputCDR& rhs);
00325
00326
00327
00328 TAO_InputCDR (const TAO_InputCDR& rhs,
00329 size_t size,
00330 ACE_CDR::Long offset);
00331
00332
00333
00334
00335
00336
00337
00338
00339 TAO_InputCDR (const TAO_InputCDR& rhs,
00340 size_t size);
00341
00342
00343 TAO_InputCDR (const TAO_OutputCDR& rhs,
00344 ACE_Allocator* buffer_allocator = 0,
00345 ACE_Allocator* data_block_allocator = 0,
00346 ACE_Allocator* message_block_allocator = 0,
00347 TAO_ORB_Core* orb_core = 0);
00348
00349
00350
00351 TAO_InputCDR (ACE_InputCDR::Transfer_Contents rhs,
00352 TAO_ORB_Core* orb_core = 0);
00353
00354
00355 ~TAO_InputCDR (void);
00356
00357
00358
00359
00360 TAO_ORB_Core *orb_core (void) const;
00361
00362 ACE_Message_Block::Message_Flags
00363 clr_mb_flags( ACE_Message_Block::Message_Flags less_flags );
00364
00365
00366 static void throw_stub_exception (int error_num);
00367 static void throw_skel_exception (int error_num);
00368
00369 private:
00370
00371 TAO_ORB_Core* orb_core_;
00372 };
00373
00374 TAO_END_VERSIONED_NAMESPACE_DECL
00375
00376 #if defined(__ACE_INLINE__)
00377 # include "tao/CDR.inl"
00378 #else
00379
00380 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00381
00382
00383
00384 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00385 CORBA::Short x);
00386 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00387 CORBA::UShort x);
00388 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00389 CORBA::Long x);
00390 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00391 CORBA::ULong x);
00392 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00393 CORBA::LongLong x);
00394 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00395 CORBA::ULongLong x);
00396 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR& os,
00397 CORBA::LongDouble x);
00398 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00399 CORBA::Float x);
00400 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00401 CORBA::Double x);
00402 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00403 const CORBA::Char* x);
00404 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00405 const CORBA::WChar* x);
00406 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00407 ACE_OutputCDR::from_string x);
00408 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00409 ACE_OutputCDR::from_wstring x);
00410
00411
00412
00413 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00414 CORBA::Short &x);
00415 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00416 CORBA::UShort &x);
00417 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00418 CORBA::Long &x);
00419 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00420 CORBA::ULong &x);
00421 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00422 CORBA::LongLong &x);
00423 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00424 CORBA::ULongLong &x);
00425 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00426 CORBA::LongDouble &x);
00427 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00428 CORBA::Float &x);
00429 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00430 CORBA::Double &x);
00431 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00432 CORBA::Char* &x);
00433 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00434 CORBA::WChar* &x);
00435 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &os,
00436 ACE_InputCDR::to_string x);
00437 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &os,
00438 ACE_InputCDR::to_wstring x);
00439
00440 TAO_END_VERSIONED_NAMESPACE_DECL
00441
00442 #endif
00443
00444 #include "ace/post.h"
00445 #endif