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
00056 #include "ace/CORBA_macros.h"
00057 #include "ace/CDR_Stream.h"
00058
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 namespace CORBA
00067 {
00068 class Environment;
00069 }
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089 class TAO_Export TAO_OutputCDR : public ACE_OutputCDR
00090 {
00091 public:
00092
00093 friend class TAO_InputCDR;
00094
00095
00096
00097
00098
00099
00100
00101
00102 TAO_OutputCDR (size_t size = 0,
00103 int byte_order = ACE_CDR_BYTE_ORDER,
00104 ACE_Allocator* buffer_allocator = 0,
00105 ACE_Allocator* data_block_allocator = 0,
00106 ACE_Allocator* message_block_allocator = 0,
00107 size_t memcpy_tradeoff = 0,
00108 ACE_CDR::Octet major_version =
00109 TAO_DEF_GIOP_MAJOR,
00110 ACE_CDR::Octet minor_version =
00111 TAO_DEF_GIOP_MINOR);
00112
00113
00114
00115 TAO_OutputCDR (char *data,
00116 size_t size,
00117 int byte_order = ACE_CDR_BYTE_ORDER,
00118 ACE_Allocator* buffer_allocator = 0,
00119 ACE_Allocator* data_block_allocator = 0,
00120 ACE_Allocator* message_block_allocator = 0,
00121 size_t memcpy_tradeoff = 0,
00122 ACE_CDR::Octet major_version =
00123 TAO_DEF_GIOP_MAJOR,
00124 ACE_CDR::Octet minor_version =
00125 TAO_DEF_GIOP_MINOR);
00126
00127
00128
00129
00130 TAO_OutputCDR (char *data,
00131 size_t size,
00132 int byte_order,
00133 ACE_Allocator* buffer_allocator,
00134 ACE_Allocator* data_block_allocator,
00135 ACE_Allocator* message_block_allocator,
00136 size_t memcpy_tradeoff,
00137 TAO_GIOP_Fragmentation_Strategy * fs,
00138 ACE_CDR::Octet major_version,
00139 ACE_CDR::Octet minor_version);
00140
00141
00142
00143 TAO_OutputCDR (ACE_Message_Block *data,
00144 int byte_order = ACE_CDR_BYTE_ORDER,
00145 size_t memcpy_tradeoff = 0,
00146 ACE_CDR::Octet major_version =
00147 TAO_DEF_GIOP_MAJOR,
00148 ACE_CDR::Octet minor_version =
00149 TAO_DEF_GIOP_MINOR);
00150
00151
00152 ~TAO_OutputCDR (void);
00153
00154
00155
00156
00157
00158 static void throw_stub_exception (int error_num ACE_ENV_ARG_DECL);
00159 static void throw_skel_exception (int error_num ACE_ENV_ARG_DECL);
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173 bool fragment_stream (ACE_CDR::ULong pending_alignment,
00174 ACE_CDR::ULong pending_length);
00175
00176
00177 bool more_fragments (void) const;
00178
00179
00180 void more_fragments (bool more);
00181
00182
00183 void message_attributes (CORBA::ULong request_id,
00184 TAO_Stub * stub,
00185 int message_semantics,
00186 ACE_Time_Value * timeout);
00187
00188
00189 CORBA::ULong request_id (void) const;
00190
00191
00192 TAO_Stub * stub (void) const;
00193
00194
00195 int message_semantics (void) const;
00196
00197
00198 ACE_Time_Value * timeout (void) const;
00199
00200
00201 private:
00202
00203
00204 TAO_OutputCDR (const TAO_OutputCDR& rhs);
00205 TAO_OutputCDR& operator= (const TAO_OutputCDR& rhs);
00206
00207 private:
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218 TAO_GIOP_Fragmentation_Strategy * const fragmentation_strategy_;
00219
00220
00221 bool more_fragments_;
00222
00223
00224 CORBA::ULong request_id_;
00225
00226
00227 TAO_Stub * stub_;
00228
00229
00230
00231
00232
00233 int message_semantics_;
00234
00235
00236 ACE_Time_Value * timeout_;
00237
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 =
00273 TAO_DEF_GIOP_MAJOR,
00274 ACE_CDR::Octet minor_version =
00275 TAO_DEF_GIOP_MINOR,
00276 TAO_ORB_Core* orb_core = 0);
00277
00278
00279
00280 TAO_InputCDR (size_t bufsiz,
00281 int byte_order = ACE_CDR_BYTE_ORDER,
00282 ACE_CDR::Octet major_version =
00283 TAO_DEF_GIOP_MAJOR,
00284 ACE_CDR::Octet minor_version =
00285 TAO_DEF_GIOP_MINOR,
00286 TAO_ORB_Core* orb_core = 0);
00287
00288
00289 TAO_InputCDR (const ACE_Message_Block *data,
00290 int byte_order = ACE_CDR_BYTE_ORDER,
00291 ACE_CDR::Octet major_version =
00292 TAO_DEF_GIOP_MAJOR,
00293 ACE_CDR::Octet minor_version =
00294 TAO_DEF_GIOP_MINOR,
00295 TAO_ORB_Core* orb_core = 0);
00296
00297
00298
00299 TAO_InputCDR (const ACE_Message_Block *data,
00300 ACE_Lock* lock,
00301 int byte_order = ACE_CDR_BYTE_ORDER,
00302 ACE_CDR::Octet major_version = TAO_DEF_GIOP_MAJOR,
00303 ACE_CDR::Octet minor_version = TAO_DEF_GIOP_MINOR,
00304 TAO_ORB_Core* orb_core = 0);
00305
00306
00307
00308 TAO_InputCDR (ACE_Data_Block *data,
00309 ACE_Message_Block::Message_Flags flag = 0,
00310 int byte_order = ACE_CDR_BYTE_ORDER,
00311 ACE_CDR::Octet major_version =
00312 TAO_DEF_GIOP_MAJOR,
00313 ACE_CDR::Octet minor_version =
00314 TAO_DEF_GIOP_MINOR,
00315 TAO_ORB_Core* orb_core = 0);
00316
00317
00318 TAO_InputCDR (ACE_Data_Block *data,
00319 ACE_Message_Block::Message_Flags flag,
00320 size_t read_pointer_position,
00321 size_t write_pointer_position,
00322 int byte_order = ACE_CDR_BYTE_ORDER,
00323 ACE_CDR::Octet major_version =
00324 TAO_DEF_GIOP_MAJOR,
00325 ACE_CDR::Octet minor_version =
00326 TAO_DEF_GIOP_MINOR,
00327 TAO_ORB_Core* orb_core = 0);
00328
00329
00330
00331
00332
00333
00334 TAO_InputCDR (const TAO_InputCDR& rhs);
00335
00336
00337
00338 TAO_InputCDR (const TAO_InputCDR& rhs,
00339 size_t size,
00340 ACE_CDR::Long offset);
00341
00342
00343
00344
00345
00346
00347
00348
00349 TAO_InputCDR (const TAO_InputCDR& rhs,
00350 size_t size);
00351
00352
00353 TAO_InputCDR (const TAO_OutputCDR& rhs,
00354 ACE_Allocator* buffer_allocator = 0,
00355 ACE_Allocator* data_block_allocator = 0,
00356 ACE_Allocator* message_block_allocator = 0,
00357 TAO_ORB_Core* orb_core = 0);
00358
00359
00360
00361 TAO_InputCDR (ACE_InputCDR::Transfer_Contents rhs,
00362 TAO_ORB_Core* orb_core = 0);
00363
00364
00365 ~TAO_InputCDR (void);
00366
00367
00368
00369
00370 TAO_ORB_Core *orb_core (void) const;
00371
00372 ACE_Message_Block::Message_Flags
00373 clr_mb_flags( ACE_Message_Block::Message_Flags less_flags );
00374
00375
00376 static void throw_stub_exception (int error_num ACE_ENV_ARG_DECL);
00377 static void throw_skel_exception (int error_num ACE_ENV_ARG_DECL);
00378
00379 private:
00380
00381 TAO_ORB_Core* orb_core_;
00382 };
00383
00384 TAO_END_VERSIONED_NAMESPACE_DECL
00385
00386 #if defined(__ACE_INLINE__)
00387 # include "tao/CDR.i"
00388 #else
00389
00390 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00391
00392
00393
00394 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00395 CORBA::Short x);
00396 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00397 CORBA::UShort x);
00398 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00399 CORBA::Long x);
00400 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00401 CORBA::ULong x);
00402 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00403 CORBA::LongLong x);
00404 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00405 CORBA::ULongLong x);
00406 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR& os,
00407 CORBA::LongDouble x);
00408 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00409 CORBA::Float x);
00410 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00411 CORBA::Double x);
00412 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00413 const CORBA::Char* x);
00414 TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os,
00415 const CORBA::WChar* x);
00416
00417
00418
00419 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00420 CORBA::Short &x);
00421 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00422 CORBA::UShort &x);
00423 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00424 CORBA::Long &x);
00425 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00426 CORBA::ULong &x);
00427 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00428 CORBA::LongLong &x);
00429 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00430 CORBA::ULongLong &x);
00431 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00432 CORBA::LongDouble &x);
00433 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00434 CORBA::Float &x);
00435 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00436 CORBA::Double &x);
00437 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00438 CORBA::Char* &x);
00439 TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is,
00440 CORBA::WChar* &x);
00441
00442 TAO_END_VERSIONED_NAMESPACE_DECL
00443
00444 #endif
00445
00446 #include "ace/post.h"
00447 #endif