CDR.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  TAO_OutputCDR
 A CDR stream for writing, i.e. for marshalling. More...
class  TAO_InputCDR
 A CDR stream for reading, i.e. for demarshalling. More...

Functions

TAO_END_VERSIONED_NAMESPACE_DECL
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
TAO_Export CORBA::Boolean 
operator<< (TAO_OutputCDR &os, CORBA::Short x)
TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os, CORBA::UShort x)
TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os, CORBA::Long x)
TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os, CORBA::ULong x)
TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os, CORBA::LongLong x)
TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os, CORBA::ULongLong x)
TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os, CORBA::LongDouble x)
TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os, CORBA::Float x)
TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os, CORBA::Double x)
TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os, const CORBA::Char *x)
TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os, const CORBA::WChar *x)
TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os, ACE_OutputCDR::from_string x)
TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os, ACE_OutputCDR::from_wstring x)
TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is, CORBA::Short &x)
TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is, CORBA::UShort &x)
TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is, CORBA::Long &x)
TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is, CORBA::ULong &x)
TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is, CORBA::LongLong &x)
TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is, CORBA::ULongLong &x)
TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is, CORBA::LongDouble &x)
TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is, CORBA::Float &x)
TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is, CORBA::Double &x)
TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is, CORBA::Char *&x)
TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is, CORBA::WChar *&x)
TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &os, ACE_InputCDR::to_string x)
TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &os, ACE_InputCDR::to_wstring x)

Detailed Description

Id
CDR.h 84457 2009-02-13 14:52:13Z msmit

Common Data Representation (CDR) marshaling streams.

This implementation assumes that the native numeric representation is two's complement for integers, IEEE single/double for floats. Also that characters are in ISO Latin/1.

Note that CDR itself makes no such assumptions, but this implementation makes such assumptions for reasons of efficiency. Careful enhancements could preserve that efficiency where the assumptions are true, yet still allow the code to work when they aren't true.

The implementation expects that buffers are aligned according to the strongest CDR alignment restriction.

NOTE: this does everything "CDR 1.1" does ... that is, it supports the five extended OMG-IDL data types in UNO Appendix A, which provide richer arithmetic types (64 bit integers, "quad precision" FP) and UNICODE-based characters and strings. Those types are not standard parts of OMG-IDL at this time.

THREADING NOTE: CDR data structures must be protected against concurrent access by their owning thread.

Author:
Copyright 1994-1995 by Sun Microsystems Inc.
Aniruddha Gokhale
Carlos O'Ryan

Definition in file CDR.h.


Function Documentation

TAO_Export CORBA::Boolean operator<< ( TAO_OutputCDR os,
ACE_OutputCDR::from_wstring  x 
)

Definition at line 328 of file CDR.inl.

00330 {
00331   if (x.bound_ != 0 && x.val_ != 0 &&
00332       ACE_OS::strlen (x.val_) > x.bound_)
00333     {
00334       throw ::CORBA::BAD_PARAM ();
00335     }
00336   return os << x.val_;
00337 }

TAO_Export CORBA::Boolean operator<< ( TAO_OutputCDR os,
ACE_OutputCDR::from_string  x 
)

Definition at line 317 of file CDR.inl.

00319 {
00320   if (x.bound_ != 0 && x.val_ != 0 &&
00321       ACE_OS::strlen (x.val_) > x.bound_)
00322     {
00323       throw ::CORBA::BAD_PARAM ();
00324     }
00325   return os << x.val_;
00326 }

TAO_Export CORBA::Boolean operator<< ( TAO_OutputCDR os,
const CORBA::WChar x 
)

Definition at line 306 of file CDR.inl.

00308 {
00309   return
00310     os.fragment_stream ((sizeof (CORBA::WChar) == 2
00311                          ? ACE_CDR::SHORT_ALIGN
00312                          : ACE_CDR::LONG_ALIGN),
00313                         sizeof (CORBA::WChar))
00314     && static_cast<ACE_OutputCDR &> (os) << x;
00315 }

TAO_Export CORBA::Boolean operator<< ( TAO_OutputCDR os,
const CORBA::Char x 
)
TAO_Export CORBA::Boolean operator<< ( TAO_OutputCDR os,
CORBA::Double  x 
)

Definition at line 288 of file CDR.inl.

00290 {
00291   return
00292     os.fragment_stream (ACE_CDR::LONGLONG_ALIGN,
00293                         sizeof (CORBA::Double))
00294     && static_cast<ACE_OutputCDR &> (os) << x;
00295 }

TAO_Export CORBA::Boolean operator<< ( TAO_OutputCDR os,
CORBA::Float  x 
)

Definition at line 279 of file CDR.inl.

00281 {
00282   return
00283     os.fragment_stream (ACE_CDR::LONG_ALIGN,
00284                         sizeof (CORBA::Float))
00285     && static_cast<ACE_OutputCDR &> (os) << x;
00286 }

TAO_Export CORBA::Boolean operator<< ( TAO_OutputCDR os,
CORBA::LongDouble  x 
)

Definition at line 270 of file CDR.inl.

00272 {
00273   return
00274     os.fragment_stream (ACE_CDR::LONGDOUBLE_ALIGN,
00275                         sizeof (CORBA::LongDouble))
00276     && static_cast<ACE_OutputCDR &> (os) << x;
00277 }

TAO_Export CORBA::Boolean operator<< ( TAO_OutputCDR os,
CORBA::ULongLong  x 
)

Definition at line 261 of file CDR.inl.

00263 {
00264   return
00265     os.fragment_stream (ACE_CDR::LONGLONG_ALIGN,
00266                         sizeof (CORBA::ULongLong))
00267     && static_cast<ACE_OutputCDR &> (os) << x;
00268 }

TAO_Export CORBA::Boolean operator<< ( TAO_OutputCDR os,
CORBA::LongLong  x 
)

Definition at line 252 of file CDR.inl.

00254 {
00255   return
00256     os.fragment_stream (ACE_CDR::LONGLONG_ALIGN,
00257                         sizeof (CORBA::LongLong))
00258     && static_cast<ACE_OutputCDR &> (os) << x;
00259 }

TAO_Export CORBA::Boolean operator<< ( TAO_OutputCDR os,
CORBA::ULong  x 
)

Definition at line 243 of file CDR.inl.

00245 {
00246   return
00247     os.fragment_stream (ACE_CDR::LONG_ALIGN,
00248                         sizeof (CORBA::ULong))
00249     && static_cast<ACE_OutputCDR &> (os) << x;
00250 }

TAO_Export CORBA::Boolean operator<< ( TAO_OutputCDR os,
CORBA::Long  x 
)

Definition at line 234 of file CDR.inl.

00236 {
00237   return
00238     os.fragment_stream (ACE_CDR::LONG_ALIGN,
00239                         sizeof (CORBA::Long))
00240     && static_cast<ACE_OutputCDR &> (os) << x;
00241 }

TAO_Export CORBA::Boolean operator<< ( TAO_OutputCDR os,
CORBA::UShort  x 
)

Definition at line 225 of file CDR.inl.

00227 {
00228   return
00229     os.fragment_stream (ACE_CDR::SHORT_ALIGN,
00230                         sizeof (CORBA::UShort))
00231     && static_cast<ACE_OutputCDR &> (os) << x;
00232 }

TAO_END_VERSIONED_NAMESPACE_DECL TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_Export CORBA::Boolean operator<< ( TAO_OutputCDR os,
CORBA::Short  x 
)

Definition at line 216 of file CDR.inl.

00218 {
00219   return
00220     os.fragment_stream (ACE_CDR::SHORT_ALIGN,
00221                         sizeof (CORBA::Short))
00222     && static_cast<ACE_OutputCDR &> (os) << x;
00223 }

TAO_Export CORBA::Boolean operator>> ( TAO_InputCDR os,
ACE_InputCDR::to_wstring  x 
)

Definition at line 420 of file CDR.inl.

00422 {
00423   CORBA::Boolean const marshal_flag =
00424     is >> const_cast<ACE_CDR::WChar *&> (x.val_);
00425   if (marshal_flag && x.bound_ != 0 && x.val_ != 0 &&
00426       ACE_OS::strlen (x.val_) > x.bound_)
00427     {
00428       throw ::CORBA::BAD_PARAM ();
00429     }
00430   return marshal_flag;
00431 }

TAO_Export CORBA::Boolean operator>> ( TAO_InputCDR os,
ACE_InputCDR::to_string  x 
)

Definition at line 407 of file CDR.inl.

00409 {
00410   CORBA::Boolean const marshal_flag =
00411     is >> const_cast<ACE_CDR::Char *&> (x.val_);
00412   if (marshal_flag && x.bound_ != 0 && x.val_ != 0 &&
00413       ACE_OS::strlen (x.val_) > x.bound_)
00414     {
00415       throw ::CORBA::BAD_PARAM ();
00416     }
00417   return marshal_flag;
00418 }

TAO_Export CORBA::Boolean operator>> ( TAO_InputCDR is,
CORBA::WChar *&  x 
)

Definition at line 401 of file CDR.inl.

00403 {
00404   return static_cast<ACE_InputCDR &> (is) >> x;
00405 }

TAO_Export CORBA::Boolean operator>> ( TAO_InputCDR is,
CORBA::Char *&  x 
)

Definition at line 395 of file CDR.inl.

00397 {
00398   return static_cast<ACE_InputCDR &> (is) >> x;
00399 }

TAO_Export CORBA::Boolean operator>> ( TAO_InputCDR is,
CORBA::Double x 
)

Definition at line 389 of file CDR.inl.

00391 {
00392   return static_cast<ACE_InputCDR &> (is) >> x;
00393 }

TAO_Export CORBA::Boolean operator>> ( TAO_InputCDR is,
CORBA::Float x 
)

Definition at line 383 of file CDR.inl.

00385 {
00386   return static_cast<ACE_InputCDR &> (is) >> x;
00387 }

TAO_Export CORBA::Boolean operator>> ( TAO_InputCDR is,
CORBA::LongDouble x 
)

Definition at line 377 of file CDR.inl.

00379 {
00380   return static_cast<ACE_InputCDR &> (is) >> x;
00381 }

TAO_Export CORBA::Boolean operator>> ( TAO_InputCDR is,
CORBA::ULongLong x 
)

Definition at line 371 of file CDR.inl.

00373 {
00374   return static_cast<ACE_InputCDR &> (is) >> x;
00375 }

TAO_Export CORBA::Boolean operator>> ( TAO_InputCDR is,
CORBA::LongLong x 
)

Definition at line 365 of file CDR.inl.

00367 {
00368   return static_cast<ACE_InputCDR &> (is) >> x;
00369 }

TAO_Export CORBA::Boolean operator>> ( TAO_InputCDR is,
CORBA::ULong x 
)

Definition at line 359 of file CDR.inl.

00361 {
00362   return static_cast<ACE_InputCDR &> (is) >> x;
00363 }

TAO_Export CORBA::Boolean operator>> ( TAO_InputCDR is,
CORBA::Long x 
)

Definition at line 353 of file CDR.inl.

00355 {
00356   return static_cast<ACE_InputCDR&> (is) >> x;
00357 }

TAO_Export CORBA::Boolean operator>> ( TAO_InputCDR is,
CORBA::UShort x 
)

Definition at line 347 of file CDR.inl.

00349 {
00350   return static_cast<ACE_InputCDR &> (is) >> x;
00351 }

TAO_Export CORBA::Boolean operator>> ( TAO_InputCDR is,
CORBA::Short x 
)

Definition at line 341 of file CDR.inl.

00343 {
00344   return static_cast<ACE_InputCDR &> (is) >> x;
00345 }

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Sun Nov 22 23:23:39 2009 for TAO by  doxygen 1.6.1