diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-03-21 19:24:06 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-03-21 19:24:06 +0000 |
commit | 000736dcdda87888a054978fc0892cc3a6434304 (patch) | |
tree | 3e9647f6b18e26bb1cfc6536602731b02a00e79e | |
parent | 9117a9f445563264633189e9499cc8e878567006 (diff) | |
download | ATCD-000736dcdda87888a054978fc0892cc3a6434304.tar.gz |
ChangeLogTag: Fri Mar 21 13:22:06 2003 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r-- | TAO/ChangeLog | 9 | ||||
-rw-r--r-- | TAO/tao/Any.cpp | 208 |
2 files changed, 113 insertions, 104 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index d2301478833..cb8e743e3f5 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,12 @@ +Fri Mar 21 13:22:06 2003 Jeff Parsons <j.parsons@vanderbilt.edu> + + * tao/Any.cpp: + + Moved the template specializations to the top of the file. This + eliminates a problem with BCB seeing the specializations whe + compiling the Any operators later in the file. Thanks to + Johnny Willemsen <jwillemsen@rememdy.nl> for suggesting the fix. + Fri Mar 21 11:41:10 2003 Jeff Parsons <j.parsons@vanderbilt.edu> * tao/Policy_ForwardC.cpp: diff --git a/TAO/tao/Any.cpp b/TAO/tao/Any.cpp index 10a176b3652..097eade0816 100644 --- a/TAO/tao/Any.cpp +++ b/TAO/tao/Any.cpp @@ -12,6 +12,110 @@ ACE_RCSID (tao, Any, "$Id$") +// Specializations of the create_empty method for long long and long double. + +template<> +TAO::Any_Basic_Impl_T<CORBA::LongLong> * +TAO::Any_Basic_Impl_T<CORBA::LongLong>::create_empty ( + CORBA::TypeCode_ptr tc + ) +{ + CORBA::LongLong zero = ACE_CDR_LONGLONG_INITIALIZER; + TAO::Any_Basic_Impl_T<CORBA::LongLong> * retval = 0; + ACE_NEW_RETURN (retval, + TAO::Any_Basic_Impl_T<CORBA::LongLong> (tc, + zero), + 0); + return retval; +} + +template<> +TAO::Any_Basic_Impl_T<CORBA::LongDouble> * +TAO::Any_Basic_Impl_T<CORBA::LongDouble>::create_empty ( + CORBA::TypeCode_ptr tc + ) +{ + CORBA::LongDouble zero = ACE_CDR_LONG_DOUBLE_INITIALIZER; + TAO::Any_Basic_Impl_T<CORBA::LongDouble> * retval = 0; + ACE_NEW_RETURN (retval, + TAO::Any_Basic_Impl_T<CORBA::LongDouble> (tc, + zero), + 0); + return retval; +} + +// ======================================================================= + +// Specializations for CORBA::Exception + +template<> +TAO::Any_Dual_Impl_T<CORBA::Exception>::Any_Dual_Impl_T ( + _tao_destructor destructor, + CORBA::TypeCode_ptr tc, + const CORBA::Exception & val + ) + : Any_Impl (destructor, + tc) +{ + this->value_ = val._tao_duplicate (); +} + +template<> +CORBA::Boolean +TAO::Any_Dual_Impl_T<CORBA::Exception>::marshal_value (TAO_OutputCDR &cdr) +{ + ACE_TRY_NEW_ENV + { + this->value_->_tao_encode (cdr + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + return 1; + } + ACE_CATCHANY + { + } + ACE_ENDTRY; + + return 0; +} + +template<> +CORBA::Boolean +TAO::Any_Dual_Impl_T<CORBA::Exception>::demarshal_value (TAO_InputCDR &cdr) +{ + ACE_TRY_NEW_ENV + { + this->value_->_tao_decode (cdr + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + return 1; + } + ACE_CATCHANY + { + } + ACE_ENDTRY; + + return 0; +} + +// This should never get called since we don't have extraction operators +// for CORBA::Exception, but it is here to sidestep the constructor call +// in the unspecialized version that causes a problem with compilers that +// require explicit instantiation +template<> +CORBA::Boolean +TAO::Any_Dual_Impl_T<CORBA::Exception>::extract (const CORBA::Any &, + _tao_destructor, + CORBA::TypeCode_ptr, + const CORBA::Exception *&) +{ + return 0; +} + +// ======================================================================= + CORBA::Any::Any (void) : impl_ (0) { @@ -1008,110 +1112,6 @@ operator>>= (const CORBA::Any &any, CORBA::TypeCode_ptr &tc) // ======================================================================= -// Specializations of the create_empty method for long long and long double. - -template<> -TAO::Any_Basic_Impl_T<CORBA::LongLong> * -TAO::Any_Basic_Impl_T<CORBA::LongLong>::create_empty ( - CORBA::TypeCode_ptr tc - ) -{ - CORBA::LongLong zero = ACE_CDR_LONGLONG_INITIALIZER; - TAO::Any_Basic_Impl_T<CORBA::LongLong> * retval = 0; - ACE_NEW_RETURN (retval, - TAO::Any_Basic_Impl_T<CORBA::LongLong> (tc, - zero), - 0); - return retval; -} - -template<> -TAO::Any_Basic_Impl_T<CORBA::LongDouble> * -TAO::Any_Basic_Impl_T<CORBA::LongDouble>::create_empty ( - CORBA::TypeCode_ptr tc - ) -{ - CORBA::LongDouble zero = ACE_CDR_LONG_DOUBLE_INITIALIZER; - TAO::Any_Basic_Impl_T<CORBA::LongDouble> * retval = 0; - ACE_NEW_RETURN (retval, - TAO::Any_Basic_Impl_T<CORBA::LongDouble> (tc, - zero), - 0); - return retval; -} - -// ======================================================================= - -// Specializations for CORBA::Exception - -template<> -TAO::Any_Dual_Impl_T<CORBA::Exception>::Any_Dual_Impl_T ( - _tao_destructor destructor, - CORBA::TypeCode_ptr tc, - const CORBA::Exception & val - ) - : Any_Impl (destructor, - tc) -{ - this->value_ = val._tao_duplicate (); -} - -template<> -CORBA::Boolean -TAO::Any_Dual_Impl_T<CORBA::Exception>::marshal_value (TAO_OutputCDR &cdr) -{ - ACE_TRY_NEW_ENV - { - this->value_->_tao_encode (cdr - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - return 1; - } - ACE_CATCHANY - { - } - ACE_ENDTRY; - - return 0; -} - -template<> -CORBA::Boolean -TAO::Any_Dual_Impl_T<CORBA::Exception>::demarshal_value (TAO_InputCDR &cdr) -{ - ACE_TRY_NEW_ENV - { - this->value_->_tao_decode (cdr - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - return 1; - } - ACE_CATCHANY - { - } - ACE_ENDTRY; - - return 0; -} - -// This should never get called since we don't have extraction operators -// for CORBA::Exception, but it is here to sidestep the constructor call -// in the unspecialized version that causes a problem with compilers that -// require explicit instantiation -template<> -CORBA::Boolean -TAO::Any_Dual_Impl_T<CORBA::Exception>::extract (const CORBA::Any &, - _tao_destructor, - CORBA::TypeCode_ptr, - const CORBA::Exception *&) -{ - return 0; -} - -// ======================================================================= - TAO::Any_Any_Impl::Any_Any_Impl (void) : TAO::Any_Dual_Impl_T<CORBA::Any> (CORBA::_tc_any), any_holder_ (CORBA::Any ()) |