CORBA::TypeCode
implementation for the OMG IDL fixed types.
More...
#include <Fixed_TypeCode.h>
Inheritance diagram for TAO::TypeCode::Fixed< RefCountPolicy >:
@c TAO CORBA::TypeCode Template Methods | |
CORBA::TypeCode template methods specific to tk_fixed TypeCodes .
| |
virtual CORBA::Boolean | equal_i (CORBA::TypeCode_ptr tc) const |
virtual CORBA::Boolean | equivalent_i (CORBA::TypeCode_ptr tc) const |
virtual CORBA::TypeCode_ptr | get_compact_typecode_i (void) const |
virtual CORBA::UShort | fixed_digits_i (void) const |
virtual CORBA::UShort | fixed_scale_i (void) const |
CORBA::UShort const | digits_ |
The number of significant digits. | |
CORBA::UShort const | scale_ |
The scale factor. | |
Public Member Functions | |
Fixed (CORBA::UShort digits, CORBA::UShort scale) | |
Constructor. | |
TAO-specific @c CORBA::TypeCode Methods | |
virtual bool | tao_marshal (TAO_OutputCDR &cdr, CORBA::ULong offset) const |
Marshal this TypeCode into a CDR output stream. | |
virtual void | tao_duplicate (void) |
Increase the reference count on this TypeCode . | |
virtual void | tao_release (void) |
Decrease the reference count on this object. |
CORBA::TypeCode
implementation for the OMG IDL fixed types.
This class implements a CORBA::TypeCode
for the OMG IDL fixed
types.
Definition at line 43 of file Fixed_TypeCode.h.
TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE TAO::TypeCode::Fixed< RefCountPolicy >::Fixed | ( | CORBA::UShort | digits, | |
CORBA::UShort | scale | |||
) |
Constructor.
Definition at line 9 of file Fixed_TypeCode.inl.
00011 : ::CORBA::TypeCode (CORBA::tk_fixed) 00012 , RefCountPolicy () 00013 , digits_ (digits) 00014 , scale_ (scale) 00015 { 00016 }
CORBA::Boolean TAO::TypeCode::Fixed< RefCountPolicy >::equal_i | ( | CORBA::TypeCode_ptr | tc | ) | const [protected, virtual] |
Implements CORBA::TypeCode.
Definition at line 45 of file Fixed_TypeCode.cpp.
References CORBA::TypeCode::fixed_digits(), and CORBA::TypeCode::fixed_scale().
Referenced by TAO::TypeCode::Fixed< RefCountPolicy >::equivalent_i().
00046 { 00047 // The following call won't throw since CORBA::TypeCode::equal() has 00048 // already established the kind of tc is the same as our kind. 00049 CORBA::UShort const tc_digits = tc->fixed_digits (); 00050 00051 CORBA::UShort const tc_scale = tc->fixed_scale (); 00052 00053 return (this->digits_ == tc_digits 00054 && this->scale_ == tc_scale); 00055 }
CORBA::Boolean TAO::TypeCode::Fixed< RefCountPolicy >::equivalent_i | ( | CORBA::TypeCode_ptr | tc | ) | const [protected, virtual] |
Implements CORBA::TypeCode.
Definition at line 59 of file Fixed_TypeCode.cpp.
References TAO::TypeCode::Fixed< RefCountPolicy >::equal_i().
00060 { 00061 // Since TCKind comparisons must be performed before equal_i() is 00062 // called, we can also call it to determine equivalence of 00063 // tk_fixed TypeCodes. 00064 return this->equal_i (tc); 00065 }
CORBA::UShort TAO::TypeCode::Fixed< RefCountPolicy >::fixed_digits_i | ( | void | ) | const [protected, virtual] |
Reimplemented from CORBA::TypeCode.
Definition at line 89 of file Fixed_TypeCode.cpp.
References TAO::TypeCode::Fixed< RefCountPolicy >::digits_.
00090 { 00091 return this->digits_; 00092 }
CORBA::UShort TAO::TypeCode::Fixed< RefCountPolicy >::fixed_scale_i | ( | void | ) | const [protected, virtual] |
Reimplemented from CORBA::TypeCode.
Definition at line 96 of file Fixed_TypeCode.cpp.
References TAO::TypeCode::Fixed< RefCountPolicy >::scale_.
00097 { 00098 return this->scale_; 00099 }
CORBA::TypeCode_ptr TAO::TypeCode::Fixed< RefCountPolicy >::get_compact_typecode_i | ( | void | ) | const [protected, virtual] |
Implements CORBA::TypeCode.
Definition at line 69 of file Fixed_TypeCode.cpp.
References CORBA::TypeCode::_duplicate().
00070 { 00071 // Already compact since tk_fixed TypeCodes have no name or member 00072 // names, meaning that we can simply call _duplicate() on this 00073 // TypeCode. 00074 00075 00076 // @@ There is a potential problem here if this TypeCode is a static 00077 // and const since it may have been placed in read-only memory by 00078 // the compiler. A const_cast<> can return undefined results in 00079 // that case. 00080 00081 CORBA::TypeCode_ptr mutable_tc = 00082 const_cast<TAO::TypeCode::Fixed<RefCountPolicy> *> (this); 00083 00084 return CORBA::TypeCode::_duplicate (mutable_tc); 00085 }
void TAO::TypeCode::Fixed< RefCountPolicy >::tao_duplicate | ( | void | ) | [virtual] |
Increase the reference count on this TypeCode
.
Implements CORBA::TypeCode.
Definition at line 31 of file Fixed_TypeCode.cpp.
TAO_BEGIN_VERSIONED_NAMESPACE_DECL bool TAO::TypeCode::Fixed< RefCountPolicy >::tao_marshal | ( | TAO_OutputCDR & | cdr, | |
CORBA::ULong | offset | |||
) | const [virtual] |
Marshal this TypeCode
into a CDR output stream.
Marshal this TypeCode
into the cdr output CDR stream, excluding the TypeCode
kind. Existing cdr contents will not be altered. The marshaled TypeCode
will be appended to the given cdr CDR output stream.
cdr | Output CDR stream into which the TypeCode will be marshaled. | |
offset | Number of bytes currently in the output CDR stream, including the top-level TypeCode TCKind . This argument is useful for recursive TypeCodes . TypeCodes that contain other TypeCodes should pass an updated offset value to the marshaling operation for those contained TypeCodes . |
true
if marshaling was successful.CORBA::TypeCode
interface.If this method returns false, the contents of the cdr output CDR stream are undefined.
Implements CORBA::TypeCode.
Definition at line 17 of file Fixed_TypeCode.cpp.
References TAO::TypeCode::Fixed< RefCountPolicy >::scale_.
00019 { 00020 // A tk_fixed TypeCode has a "simple" parameter list type (see 00021 // Table 15-2 in Section 15.3.5.1 "TypeCode" in the CDR section of 00022 // the CORBA specification), meaning that its parameter(s) must be 00023 // marshaled immediately following the TCKind. No CDR encapsulation 00024 // is to be created. 00025 00026 return (cdr << this->digits_) && (cdr << this->scale_); 00027 }
void TAO::TypeCode::Fixed< RefCountPolicy >::tao_release | ( | void | ) | [virtual] |
Decrease the reference count on this object.
Implements CORBA::TypeCode.
Definition at line 38 of file Fixed_TypeCode.cpp.
CORBA::UShort const TAO::TypeCode::Fixed< RefCountPolicy >::digits_ [private] |
The number of significant digits.
Definition at line 86 of file Fixed_TypeCode.h.
Referenced by TAO::TypeCode::Fixed< RefCountPolicy >::fixed_digits_i().
CORBA::UShort const TAO::TypeCode::Fixed< RefCountPolicy >::scale_ [private] |
The scale factor.
Definition at line 89 of file Fixed_TypeCode.h.
Referenced by TAO::TypeCode::Fixed< RefCountPolicy >::fixed_scale_i(), and TAO::TypeCode::Fixed< RefCountPolicy >::tao_marshal().