diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-06-14 13:48:01 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-06-14 13:48:01 +0000 |
commit | 6cfe365eae869dd44380f0cb69b989124c474dd0 (patch) | |
tree | 5ec2a74f3ec75217b0c98078a56d0b562c35b806 /TAO/tao/AnyTypeCode | |
parent | c36e79cbbcb744a8bc4e1929b7ad0c1b725d6739 (diff) | |
download | ATCD-6cfe365eae869dd44380f0cb69b989124c474dd0.tar.gz |
ChangeLogTag: Mon Jun 14 13:45:43 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
Diffstat (limited to 'TAO/tao/AnyTypeCode')
-rw-r--r-- | TAO/tao/AnyTypeCode/Any.cpp | 22 | ||||
-rw-r--r-- | TAO/tao/AnyTypeCode/Any.h | 4 | ||||
-rw-r--r-- | TAO/tao/AnyTypeCode/Vector_AnyOp_T.h | 103 |
3 files changed, 129 insertions, 0 deletions
diff --git a/TAO/tao/AnyTypeCode/Any.cpp b/TAO/tao/AnyTypeCode/Any.cpp index bd769921aed..bc967972886 100644 --- a/TAO/tao/AnyTypeCode/Any.cpp +++ b/TAO/tao/AnyTypeCode/Any.cpp @@ -516,6 +516,18 @@ operator<<= (CORBA::Any &any, const CORBA::WChar *ws) 0); } +ACE_INLINE void +operator <<= (CORBA::Any &any, const std::string & str) +{ + any <<= str.c_str (); +} + +ACE_INLINE void +operator <<= (CORBA::Any &any, std::string * str) +{ + // TODO +} + // Extraction: these are safe and hence we have to check that the // typecode of the Any is equal to the one we are trying to extract // into. @@ -721,6 +733,16 @@ operator>>= (const CORBA::Any &any, CORBA::TypeCode_ptr &tc) ); } +CORBA::Boolean +operator >>= (const CORBA::Any &any, std::string &str) +{ + const char *buf = 0; + CORBA::Boolean flag = any >>= buf; + str.assign (buf); + ACE::strdelete (const_cast <char *> (buf)); + return flag; +} + // ================================================================ // Any_Impl_T template specializations. diff --git a/TAO/tao/AnyTypeCode/Any.h b/TAO/tao/AnyTypeCode/Any.h index 85184997880..6f6dfe69e7e 100644 --- a/TAO/tao/AnyTypeCode/Any.h +++ b/TAO/tao/AnyTypeCode/Any.h @@ -301,6 +301,8 @@ TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::TypeCode_ptr); TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::TypeCode_ptr *); TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const CORBA::Object_ptr); TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, CORBA::Object_ptr *); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, const std::string &); +TAO_AnyTypeCode_Export void operator<<= (CORBA::Any &, std::string *); /// Typesafe extraction. @@ -330,6 +332,8 @@ TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::Char *&); TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, const CORBA::WChar *&); +TAO_AnyTypeCode_Export CORBA::Boolean operator>>= (const CORBA::Any &, + std::string &); TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/AnyTypeCode/Vector_AnyOp_T.h b/TAO/tao/AnyTypeCode/Vector_AnyOp_T.h new file mode 100644 index 00000000000..20b44708ac0 --- /dev/null +++ b/TAO/tao/AnyTypeCode/Vector_AnyOp_T.h @@ -0,0 +1,103 @@ +#ifndef guard_vector_anyop +#define guard_vector_anyop +/** + * @file + * + * @brief CORBA::Any insertion/extraction for std::vector + * + * $Id$ + * + * @author Jeff Parsons + */ + +#include <vector> + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + +namespace TAO +{ + /// Copying + template<typename T> + void + insert_value_vector ( + CORBA::Any &, + const std::vector<T> &) + { + } + + /// Non-copying + template<typename T> + void + insert_value_vector ( + CORBA::Any &, + std::vector<T> *) + { + } + + template<typename T> + bool + extract_value_vector ( + const CORBA::Any &, + std::vector<T> &) + { + return true; + } + + /// Copying + template<typename T> + void + insert_objref_vector ( + CORBA::Any &, + const std::vector<typename T::_ptr_type> &) + { + } + + /// Non-copying + template<typename T> + void + insert_objref_vector ( + CORBA::Any &, + std::vector<typename T::_ptr_type> *) + { + } + + template<typename T> + bool + extract_objref_vector ( + const CORBA::Any &, + std::vector<typename T::_ptr_type> &) + { + return true; + } + + /// Copying + template<typename T_forany> + void + insert_array_vector ( + CORBA::Any &, + const std::vector<typename T_forany::_slice_type *> &) + { + } + + /// Non-copying + template<typename T_forany> + void + insert_array_vector ( + CORBA::Any &, + std::vector<typename T_forany::_slice_type *> *) + { + } + + template<typename T_forany> + bool + extract_array_vector ( + const CORBA::Any &, + std::vector<typename T_forany::_slice_type *> &) + { + return true; + } +} + +TAO_END_VERSIONED_NAMESPACE_DECL + +#endif // guard_vector_anyop |