TAO::DynAnyBasicTypeUtils< T > Struct Template Reference

#include <DynAnyUtils_T.h>

List of all members.

Static Public Member Functions

void insert_value (const T &val, TAO_DynCommon *the_dynany)
BasicTypeTraits< T >::return_type get_value (TAO_DynCommon *the_dynany)

template<typename T>
struct TAO::DynAnyBasicTypeUtils< T >


Member Function Documentation

template<typename T>
BasicTypeTraits< T >::return_type TAO::DynAnyBasicTypeUtils< T >::get_value TAO_DynCommon the_dynany  )  [static]
 

Definition at line 61 of file DynAnyUtils_T.cpp.

References TAO_DynCommon::check_component(), TAO_DynCommon::destroyed(), TAO_DynCommon::has_components(), and TAO_DynCommon::the_any().

Referenced by TAO_DynCommon::get_boolean(), TAO_DynCommon::get_boolean_seq(), TAO_DynCommon::get_char(), TAO_DynCommon::get_char_seq(), TAO_DynCommon::get_double(), TAO_DynCommon::get_double_seq(), TAO_DynCommon::get_float(), TAO_DynCommon::get_float_seq(), TAO_DynCommon::get_long(), TAO_DynCommon::get_long_seq(), TAO_DynCommon::get_longdouble(), TAO_DynCommon::get_longdouble_seq(), TAO_DynCommon::get_longlong(), TAO_DynCommon::get_longlong_seq(), TAO_DynCommon::get_octet(), TAO_DynCommon::get_octet_seq(), TAO_DynCommon::get_short(), TAO_DynCommon::get_short_seq(), TAO_DynCommon::get_ulong(), TAO_DynCommon::get_ulong_seq(), TAO_DynCommon::get_ulonglong(), TAO_DynCommon::get_ulonglong_seq(), TAO_DynCommon::get_ushort(), TAO_DynCommon::get_ushort_seq(), and TAO_DynCommon::get_wchar_seq().

00062   {
00063     if (the_dynany->destroyed ())
00064       {
00065         throw ::CORBA::OBJECT_NOT_EXIST ();
00066       }
00067 
00068     if (the_dynany->has_components ())
00069       {
00070         DynamicAny::DynAny_var cc = the_dynany->check_component ();
00071         TAO_DynCommon *dc = dynamic_cast<TAO_DynCommon *> (cc.in ());
00072         return DynAnyBasicTypeUtils<T>::get_value (dc);
00073       }
00074     else
00075       {
00076         typedef typename BasicTypeTraits<T>::return_type ret_type;
00077         typedef typename BasicTypeTraits<T>::extract_type ext_type;
00078         ret_type retval = ret_type ();
00079         ext_type extval (retval);
00080         const CORBA::Any &my_any = the_dynany->the_any ();
00081 
00082         if (!(my_any >>= extval))
00083           {
00084             throw DynamicAny::DynAny::TypeMismatch ();
00085           }
00086 
00087         return BasicTypeTraits<T>::convert (extval);
00088       }
00089   }

template<typename T>
void TAO::DynAnyBasicTypeUtils< T >::insert_value const T &  val,
TAO_DynCommon the_dynany
[static]
 

Definition at line 35 of file DynAnyUtils_T.cpp.

References TAO_DynCommon::check_component(), TAO_DynCommon::check_type(), TAO_DynCommon::destroyed(), TAO_DynCommon::has_components(), and TAO_DynCommon::the_any().

Referenced by TAO_DynCommon::insert_any(), TAO_DynCommon::insert_boolean(), TAO_DynCommon::insert_boolean_seq(), TAO_DynCommon::insert_char(), TAO_DynCommon::insert_char_seq(), TAO_DynCommon::insert_double(), TAO_DynCommon::insert_double_seq(), TAO_DynCommon::insert_float(), TAO_DynCommon::insert_float_seq(), TAO_DynCommon::insert_long(), TAO_DynCommon::insert_long_seq(), TAO_DynCommon::insert_longdouble(), TAO_DynCommon::insert_longdouble_seq(), TAO_DynCommon::insert_longlong(), TAO_DynCommon::insert_longlong_seq(), TAO_DynCommon::insert_octet(), TAO_DynCommon::insert_octet_seq(), TAO_DynCommon::insert_short(), TAO_DynCommon::insert_short_seq(), TAO_DynCommon::insert_typecode(), TAO_DynCommon::insert_ulong(), TAO_DynCommon::insert_ulong_seq(), TAO_DynCommon::insert_ulonglong(), TAO_DynCommon::insert_ulonglong_seq(), TAO_DynCommon::insert_ushort(), TAO_DynCommon::insert_ushort_seq(), TAO_DynCommon::insert_wchar(), and TAO_DynCommon::insert_wchar_seq().

00037   {
00038     if (the_dynany->destroyed ())
00039       {
00040         throw ::CORBA::OBJECT_NOT_EXIST ();
00041       }
00042 
00043     if (the_dynany->has_components ())
00044       {
00045         DynamicAny::DynAny_var cc = the_dynany->check_component ();
00046         TAO_DynCommon *dc = dynamic_cast<TAO_DynCommon *> (cc.in ());
00047         DynAnyBasicTypeUtils<T>::insert_value (val, dc);
00048       }
00049     else
00050       {
00051         the_dynany->check_type (BasicTypeTraits<T>::tc_value);
00052         CORBA::Any &my_any = the_dynany->the_any ();
00053         typedef typename TAO::BasicTypeTraits<T>::insert_type i_type;
00054         i_type insert_arg (val);
00055         my_any <<= insert_arg;
00056       }
00057   }


The documentation for this struct was generated from the following files:
Generated on Sun Jan 27 13:37:13 2008 for TAO_DynamicAny by doxygen 1.3.6