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/Transport.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_Transport::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_Transport::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_Transport::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
00262 class TAO_Export TAO_InputCDR : public ACE_InputCDR
00263 {
00264 public:
00265
00266
00267
00268
00269
00270 TAO_InputCDR (const char* buf,
00271 size_t bufsiz,
00272 int byte_order = ACE_CDR_BYTE_ORDER,
00273 ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
00274 ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR,
00275 TAO_ORB_Core* orb_core = 0);
00276
00277
00278
00279 TAO_InputCDR (size_t bufsiz,
00280 int byte_order = ACE_CDR_BYTE_ORDER,
00281 ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
00282 ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR,
00283 TAO_ORB_Core* orb_core = 0);
00284
00285
00286 TAO_InputCDR (const ACE_Message_Block *data,
00287 int byte_order = ACE_CDR_BYTE_ORDER,
00288 ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
00289 ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR,
00290 TAO_ORB_Core* orb_core = 0);
00291
00292
00293
00294 TAO_InputCDR (const ACE_Message_Block *data,
00295 ACE_Lock* lock,
00296 int byte_order = ACE_CDR_BYTE_ORDER,
00297 ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
00298 ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR,
00299 TAO_ORB_Core* orb_core = 0);
00300
00301
00302
00303 TAO_InputCDR (ACE_Data_Block *data,
00304 ACE_Message_Block::Message_Flags flag = 0,
00305 int byte_order = ACE_CDR_BYTE_ORDER,
00306 ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
00307 ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR,
00308 TAO_ORB_Core* orb_core = 0);
00309
00310
00311 TAO_InputCDR (ACE_Data_Block *data,
00312 ACE_Message_Block::Message_Flags flag,
00313 size_t read_pointer_position,
00314 size_t write_pointer_position,
00315 int byte_order = ACE_CDR_BYTE_ORDER,
00316 ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
00317 ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR,
00318 TAO_ORB_Core* orb_core = 0);
00319
00320
00321
00322
00323
00324
00325 TAO_InputCDR (const TAO_InputCDR& rhs);
00326
00327
00328
00329 TAO_InputCDR (const TAO_InputCDR& rhs,
00330 size_t size,
00331 ACE_CDR::Long offset);
00332
00333
00334
00335
00336
00337
00338
00339
00340 TAO_InputCDR (const TAO_InputCDR& rhs,
00341 size_t size);
00342
00343
00344 TAO_InputCDR (const TAO_OutputCDR& rhs,
00345 ACE_Allocator* buffer_allocator = 0,
00346 ACE_Allocator* data_block_allocator = 0,
00347 ACE_Allocator* message_block_allocator = 0,
00348 TAO_ORB_Core* orb_core = 0);
00349
00350
00351
00352 TAO_InputCDR (ACE_InputCDR::Transfer_Contents rhs,
00353 TAO_ORB_Core* orb_core = 0);
00354
00355
00356 ~TAO_InputCDR (void);
00357
00358
00359
00360
00361 TAO_ORB_Core *orb_core (void) const;
00362
00363 ACE_Message_Block::Message_Flags
00364 clr_mb_flags( ACE_Message_Block::Message_Flags less_flags );
00365
00366
00367 static void throw_stub_exception (int error_num);
00368 static void throw_skel_exception (int error_num);
00369
00370 private:
00371
00372 TAO_ORB_Core* orb_core_;
00373 };
00374
00375 TAO_END_VERSIONED_NAMESPACE_DECL
00376
00377 #if defined(__ACE_INLINE__)
00378 # include "tao/CDR.inl"
00379 #else
00380
00381 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00382
00383
00384
00385 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00386 CORBA::Short x);
00387 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00388 CORBA::UShort x);
00389 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00390 CORBA::Long x);
00391 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00392 CORBA::ULong x);
00393 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00394 CORBA::LongLong x);
00395 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00396 CORBA::ULongLong x);
00397 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR& os,
00398 CORBA::LongDouble x);
00399 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00400 CORBA::Float x);
00401 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00402 CORBA::Double x);
00403 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00404 const CORBA::Char* x);
00405 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00406 const CORBA::WChar* x);
00407
00408
00409
00410 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00411 CORBA::Short &x);
00412 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00413 CORBA::UShort &x);
00414 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00415 CORBA::Long &x);
00416 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00417 CORBA::ULong &x);
00418 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00419 CORBA::LongLong &x);
00420 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00421 CORBA::ULongLong &x);
00422 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00423 CORBA::LongDouble &x);
00424 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00425 CORBA::Float &x);
00426 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00427 CORBA::Double &x);
00428 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00429 CORBA::Char* &x);
00430 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00431 CORBA::WChar* &x);
00432
00433 TAO_END_VERSIONED_NAMESPACE_DECL
00434
00435 #endif
00436
00437 #include "ace/post.h"
00438 #endif