summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-01-11 19:28:43 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-01-11 19:28:43 +0000
commitae5ed598fae6b614fff9d80fb72db49df377eeaa (patch)
tree95ef989b10d334c721ebfe16b0498a2a77b4f344
parentcf3d7d8ce59ba17ca299c09310ab94979f8ee23b (diff)
downloadATCD-ae5ed598fae6b614fff9d80fb72db49df377eeaa.tar.gz
ChangeLogTag: Mon Jan 11 19:17:57 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r--modules/TAO/ChangeLog26
-rw-r--r--modules/TAO/tao/Basic_Arguments.h10
-rw-r--r--modules/TAO/tao/PortableServer/Basic_SArguments.h7
-rw-r--r--modules/TAO/tests/Param_Test/README7
-rw-r--r--modules/TAO/tests/Param_Test/param_testC.cpp10
-rw-r--r--modules/TAO/tests/Param_Test/param_testS.cpp70
-rw-r--r--modules/TAO/tests/Param_Test/param_testS.h16
-rw-r--r--modules/TAO/tests/Param_Test/param_test_i.cpp35
-rw-r--r--modules/TAO/tests/Param_Test/param_test_i.h29
9 files changed, 136 insertions, 74 deletions
diff --git a/modules/TAO/ChangeLog b/modules/TAO/ChangeLog
index f5281a4ad5f..1b9d5bf7334 100644
--- a/modules/TAO/ChangeLog
+++ b/modules/TAO/ChangeLog
@@ -1,3 +1,29 @@
+Mon Jan 11 19:17:57 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * tao/Basic_Arguments.h:
+ * tao/PortableServer/Basic_SArguments.h:
+
+ Added specializations Arg_Traits<std::string> and
+ SArg_Traits<std::string>.
+
+ * tests/Param_Test/param_testC.cpp:
+
+ Removed specializations Arg_Traits<std::string>
+ since it is now in the ORB (see above).
+
+ * tests/Param_Test/param_test_i.cpp:
+ * tests/Param_Test/param_testS.cpp:
+ * tests/Param_Test/param_testS.h:
+ * tests/Param_Test/param_test_i.h:
+
+ Modified test_unbounded_string() and test_long_sequence()
+ to use std::string and std::vector<CORBA::Long>, respectively,
+ as parameter/return types.
+
+ * tests/README:
+
+ Updated to reflect the changes above.
+
Thu Dec 10 19:38:04 UTC 2009 Jeff Parsons <j.parsons@vanderbilt.edu>
* tests/Param_Test/README:
diff --git a/modules/TAO/tao/Basic_Arguments.h b/modules/TAO/tao/Basic_Arguments.h
index ccbda13ca28..81c1c4ace85 100644
--- a/modules/TAO/tao/Basic_Arguments.h
+++ b/modules/TAO/tao/Basic_Arguments.h
@@ -114,6 +114,16 @@ namespace TAO
TAO::Any_Insert_Policy_AnyTypeCode_Adapter <CORBA::LongDouble> >
{
};
+
+ template<>
+ class TAO_Export Arg_Traits<std::string>
+ : public
+ Basic_Arg_Traits_T <
+ std::string,
+ TAO::Any_Insert_Policy_Stream <std::string>
+ >
+ {
+ };
}
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/modules/TAO/tao/PortableServer/Basic_SArguments.h b/modules/TAO/tao/PortableServer/Basic_SArguments.h
index 433002d391f..438000340e8 100644
--- a/modules/TAO/tao/PortableServer/Basic_SArguments.h
+++ b/modules/TAO/tao/PortableServer/Basic_SArguments.h
@@ -105,6 +105,13 @@ namespace TAO
{
};
+ template<>
+ class TAO_PortableServer_Export SArg_Traits<std::string>
+ : public Basic_SArg_Traits_T<
+ std::string,
+ TAO::Any_Insert_Policy_Stream <std::string> >
+ {
+ };
}
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/modules/TAO/tests/Param_Test/README b/modules/TAO/tests/Param_Test/README
index 36be2c53ec9..f92bfc2397a 100644
--- a/modules/TAO/tests/Param_Test/README
+++ b/modules/TAO/tests/Param_Test/README
@@ -4,10 +4,9 @@
// This version of Param_Test has been modified to use std::string for
// the test_unbounded_string operation, and std::vector for the
// test_long_sequence operation. Since modifications were done to generated
-// stub code, Param_TestC.h and Param_TestC.cpp have been added to the
-// repository in this branch, for the time being until the branch is merged
-// or until a dedicated test/example is created. So far, these modifications
-// are to the client side only.
+// code, Param_TestC.h, Param_TestC.cpp, Param_TestS.h, and Param_TestS.cpp
+// have been added to the repository in this branch, for the time being until
+// the branch is merged or until a dedicated test/example is created.
//
// Each data type tested in Param_Test has its own class that plugs into the
// test framework. In this version, the classes in ub_string.{h,cpp} and
diff --git a/modules/TAO/tests/Param_Test/param_testC.cpp b/modules/TAO/tests/Param_Test/param_testC.cpp
index 91131a55085..61cf0d63023 100644
--- a/modules/TAO/tests/Param_Test/param_testC.cpp
+++ b/modules/TAO/tests/Param_Test/param_testC.cpp
@@ -108,16 +108,6 @@ namespace TAO
#endif /* end #if !defined */
- template<>
- class Arg_Traits<std::string>
- : public
- Basic_Arg_Traits_T <
- std::string,
- TAO::Any_Insert_Policy_Stream <std::string>
- >
- {
- };
-
// TAO_IDL - Generated from
// .\be\be_visitor_arg_traits.cpp:620
diff --git a/modules/TAO/tests/Param_Test/param_testS.cpp b/modules/TAO/tests/Param_Test/param_testS.cpp
index 1ab9e52c697..36aa6f7ccdc 100644
--- a/modules/TAO/tests/Param_Test/param_testS.cpp
+++ b/modules/TAO/tests/Param_Test/param_testS.cpp
@@ -108,8 +108,18 @@ namespace TAO
{
};
+ template<>
+ class SArg_Traits<Param_Test::UB_Long_Seq>
+ : public
+ Basic_SArg_Traits_T <
+ Param_Test::UB_Long_Seq,
+ TAO::Any_Insert_Policy_Stream <Param_Test::UB_Long_Seq>
+ >
+ {
+ };
+
#endif /* end #if !defined */
-
+
// TAO_IDL - Generated from
// .\be\be_visitor_arg_traits.cpp:620
@@ -681,6 +691,16 @@ namespace TAO
{
};
+ template<>
+ class Arg_Traits<Param_Test::UB_Long_Seq>
+ : public
+ Basic_Arg_Traits_T <
+ Param_Test::UB_Long_Seq,
+ TAO::Any_Insert_Policy_Stream <Param_Test::UB_Long_Seq>
+ >
+ {
+ };
+
#endif /* end #if !defined */
// TAO_IDL - Generated from
@@ -2423,25 +2443,25 @@ public:
virtual void execute (void)
{
- TAO::SArg_Traits< char *>::ret_arg_type retval =
- TAO::Portable_Server::get_ret_arg< char *> (
+ TAO::SArg_Traits<std::string>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg<std::string> (
this->operation_details_,
this->args_);
- TAO::SArg_Traits< char *>::in_arg_type arg_1 =
- TAO::Portable_Server::get_in_arg< char *> (
+ TAO::SArg_Traits<std::string>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg<std::string> (
this->operation_details_,
this->args_,
1);
- TAO::SArg_Traits< char *>::inout_arg_type arg_2 =
- TAO::Portable_Server::get_inout_arg< char *> (
+ TAO::SArg_Traits<std::string>::inout_arg_type arg_2 =
+ TAO::Portable_Server::get_inout_arg<std::string> (
this->operation_details_,
this->args_,
2);
- TAO::SArg_Traits< char *>::out_arg_type arg_3 =
- TAO::Portable_Server::get_out_arg< char *> (
+ TAO::SArg_Traits<std::string>::out_arg_type arg_3 =
+ TAO::Portable_Server::get_out_arg<std::string> (
this->operation_details_,
this->args_,
3);
@@ -2472,10 +2492,10 @@ void POA_Param_Test::test_unbounded_string_skel (
static ::CORBA::ULong const nexceptions = 0;
#endif /* TAO_HAS_INTERCEPTORS */
- TAO::SArg_Traits< char *>::ret_val retval;
- TAO::SArg_Traits< char *>::in_arg_val _tao_s1;
- TAO::SArg_Traits< char *>::inout_arg_val _tao_s2;
- TAO::SArg_Traits< char *>::out_arg_val _tao_s3;
+ TAO::SArg_Traits<std::string>::ret_val retval;
+ TAO::SArg_Traits<std::string>::in_arg_val _tao_s1;
+ TAO::SArg_Traits<std::string>::inout_arg_val _tao_s2;
+ TAO::SArg_Traits<std::string>::out_arg_val _tao_s3;
TAO::Argument * const args[] =
{
@@ -3271,25 +3291,25 @@ public:
virtual void execute (void)
{
- TAO::SArg_Traits< ::CORBA::LongSeq>::ret_arg_type retval =
- TAO::Portable_Server::get_ret_arg< ::CORBA::LongSeq> (
+ TAO::SArg_Traits<Param_Test::UB_Long_Seq>::ret_arg_type retval =
+ TAO::Portable_Server::get_ret_arg<Param_Test::UB_Long_Seq> (
this->operation_details_,
this->args_);
- TAO::SArg_Traits< ::CORBA::LongSeq>::in_arg_type arg_1 =
- TAO::Portable_Server::get_in_arg< ::CORBA::LongSeq> (
+ TAO::SArg_Traits<Param_Test::UB_Long_Seq>::in_arg_type arg_1 =
+ TAO::Portable_Server::get_in_arg<Param_Test::UB_Long_Seq> (
this->operation_details_,
this->args_,
1);
- TAO::SArg_Traits< ::CORBA::LongSeq>::inout_arg_type arg_2 =
- TAO::Portable_Server::get_inout_arg< ::CORBA::LongSeq> (
+ TAO::SArg_Traits<Param_Test::UB_Long_Seq>::inout_arg_type arg_2 =
+ TAO::Portable_Server::get_inout_arg<Param_Test::UB_Long_Seq> (
this->operation_details_,
this->args_,
2);
- TAO::SArg_Traits< ::CORBA::LongSeq>::out_arg_type arg_3 =
- TAO::Portable_Server::get_out_arg< ::CORBA::LongSeq> (
+ TAO::SArg_Traits<Param_Test::UB_Long_Seq>::out_arg_type arg_3 =
+ TAO::Portable_Server::get_out_arg<Param_Test::UB_Long_Seq> (
this->operation_details_,
this->args_,
3);
@@ -3320,10 +3340,10 @@ void POA_Param_Test::test_long_sequence_skel (
static ::CORBA::ULong const nexceptions = 0;
#endif /* TAO_HAS_INTERCEPTORS */
- TAO::SArg_Traits< ::CORBA::LongSeq>::ret_val retval;
- TAO::SArg_Traits< ::CORBA::LongSeq>::in_arg_val _tao_s1;
- TAO::SArg_Traits< ::CORBA::LongSeq>::inout_arg_val _tao_s2;
- TAO::SArg_Traits< ::CORBA::LongSeq>::out_arg_val _tao_s3;
+ TAO::SArg_Traits<Param_Test::UB_Long_Seq>::ret_val retval;
+ TAO::SArg_Traits<Param_Test::UB_Long_Seq>::in_arg_val _tao_s1;
+ TAO::SArg_Traits<Param_Test::UB_Long_Seq>::inout_arg_val _tao_s2;
+ TAO::SArg_Traits<Param_Test::UB_Long_Seq>::out_arg_val _tao_s3;
TAO::Argument * const args[] =
{
diff --git a/modules/TAO/tests/Param_Test/param_testS.h b/modules/TAO/tests/Param_Test/param_testS.h
index 1cdd057cb80..d65796aa6da 100644
--- a/modules/TAO/tests/Param_Test/param_testS.h
+++ b/modules/TAO/tests/Param_Test/param_testS.h
@@ -243,10 +243,10 @@ public:
// TAO_IDL - Generated from
// w:\tao\tao_idl\be\be_visitor_operation/operation_sh.cpp:45
- virtual char * test_unbounded_string (
- const char * s1,
- char *& s2,
- ::CORBA::String_out s3) = 0;
+ virtual std::string test_unbounded_string (
+ const std::string s1,
+ std::string & s2,
+ std::string & s3) = 0;
static void test_unbounded_string_skel (
TAO_ServerRequest & server_request,
@@ -355,10 +355,10 @@ public:
// TAO_IDL - Generated from
// w:\tao\tao_idl\be\be_visitor_operation/operation_sh.cpp:45
- virtual ::CORBA::LongSeq * test_long_sequence (
- const ::CORBA::LongSeq & s1,
- ::CORBA::LongSeq & s2,
- ::CORBA::LongSeq_out s3) = 0;
+ virtual Param_Test::UB_Long_Seq test_long_sequence (
+ Param_Test::UB_Long_Seq & s1,
+ Param_Test::UB_Long_Seq & s2,
+ Param_Test::UB_Long_Seq & s3) = 0;
static void test_long_sequence_skel (
TAO_ServerRequest & server_request,
diff --git a/modules/TAO/tests/Param_Test/param_test_i.cpp b/modules/TAO/tests/Param_Test/param_test_i.cpp
index f0b9a3ee916..78d36e18f88 100644
--- a/modules/TAO/tests/Param_Test/param_test_i.cpp
+++ b/modules/TAO/tests/Param_Test/param_test_i.cpp
@@ -104,17 +104,14 @@ Param_Test_i::test_ulonglong (CORBA::ULongLong s1,
// test unbounded strings. For return and out types, we return duplicates of
// the in string. For the inout, we append the same string to itself and send
// it back
-char *
-Param_Test_i::test_unbounded_string (const char *s1,
- char *&s2,
- CORBA::String_out s3)
+std::string
+Param_Test_i::test_unbounded_string (std::string s1,
+ std::string &s2,
+ std::string &s3)
{
- char *retstr = CORBA::string_dup (s1);
- s3 = CORBA::string_dup (s1);
- char *tmp = CORBA::string_alloc (2*ACE_OS::strlen (s2));
- ACE_OS::sprintf (tmp, "%s%s", s2, s2);
- CORBA::string_free (s2);
- s2 = tmp;
+ std::string retstr = s1;
+ s3 = s1;
+ s2 = s1 + s1;
return retstr;
}
@@ -190,19 +187,17 @@ Param_Test_i::test_fixed_struct (const Param_Test::Fixed_Struct &s1,
// = Sequences
-CORBA::LongSeq *
-Param_Test_i::test_long_sequence (const CORBA::LongSeq & s1,
- CORBA::LongSeq & s2,
- CORBA::LongSeq_out s3)
+Param_Test::UB_Long_Seq
+Param_Test_i::test_long_sequence (Param_Test::UB_Long_Seq & s1,
+ Param_Test::UB_Long_Seq & s2,
+ Param_Test::UB_Long_Seq & s3)
{
- CORBA::LongSeq
- *ret = new CORBA::LongSeq,
- *out = new CORBA::LongSeq;
+ Param_Test::UB_Long_Seq ret;
s2 = s1;
- *out = s1;
- *ret = s1;
- s3 = out;
+ s3 = s1;
+ ret = s1;
+
return ret;
}
diff --git a/modules/TAO/tests/Param_Test/param_test_i.h b/modules/TAO/tests/Param_Test/param_test_i.h
index 321df2bb9b3..04d6c18f243 100644
--- a/modules/TAO/tests/Param_Test/param_test_i.h
+++ b/modules/TAO/tests/Param_Test/param_test_i.h
@@ -67,9 +67,9 @@ public:
CORBA::ULongLong_out s3);
// test for unsigned long long
- virtual char *test_unbounded_string (const char *s1,
- char *&s2,
- CORBA::String_out s3);
+ virtual std::string test_unbounded_string (const std::string s1,
+ std::string &s2,
+ std::string &s3);
// test for unbounded strings
virtual char *test_bounded_string (const char *s1,
@@ -94,66 +94,81 @@ public:
// test for fixed structures
// = Start of sequences tests...
- virtual CORBA::LongSeq * test_long_sequence (
- const CORBA::LongSeq & s1,
- CORBA::LongSeq & s2,
- CORBA::LongSeq_out s3);
+ virtual Param_Test::UB_Long_Seq test_long_sequence (
+ Param_Test::UB_Long_Seq & s1,
+ Param_Test::UB_Long_Seq & s2,
+ Param_Test::UB_Long_Seq & s3);
+
virtual Param_Test::Bounded_Long_Seq * test_bounded_long_sequence (
const Param_Test::Bounded_Long_Seq & s1,
Param_Test::Bounded_Long_Seq & s2,
Param_Test::Bounded_Long_Seq_out s3);
+
virtual CORBA::ShortSeq * test_short_sequence (
const CORBA::ShortSeq & s1,
CORBA::ShortSeq & s2,
CORBA::ShortSeq_out s3);
+
virtual Param_Test::Bounded_Short_Seq * test_bounded_short_sequence (
const Param_Test::Bounded_Short_Seq & s1,
Param_Test::Bounded_Short_Seq & s2,
Param_Test::Bounded_Short_Seq_out s3);
+
virtual CORBA::StringSeq * test_strseq (
const CORBA::StringSeq & s1,
CORBA::StringSeq & s2,
CORBA::StringSeq_out s3);
+
virtual Param_Test::Bounded_StrSeq * test_bounded_strseq (
const Param_Test::Bounded_StrSeq & s1,
Param_Test::Bounded_StrSeq & s2,
Param_Test::Bounded_StrSeq_out s3);
+
virtual CORBA::WStringSeq * test_wstrseq (
const CORBA::WStringSeq & ws1,
CORBA::WStringSeq & ws2,
CORBA::WStringSeq_out ws3);
+
virtual Param_Test::Bounded_WStrSeq * test_bounded_wstrseq (
const Param_Test::Bounded_WStrSeq & ws1,
Param_Test::Bounded_WStrSeq & ws2,
Param_Test::Bounded_WStrSeq_out ws3);
+
virtual Param_Test::StructSeq * test_struct_sequence (
const Param_Test::StructSeq & s1,
Param_Test::StructSeq & s2,
Param_Test::StructSeq_out s3);
+
virtual Param_Test::PathSpec * test_unbounded_struct_sequence (
const Param_Test::PathSpec & s1,
Param_Test::PathSpec & s2,
Param_Test::PathSpec_out s3);
+
virtual Param_Test::Bounded_StructSeq * test_bounded_struct_sequence (
const Param_Test::Bounded_StructSeq & s1,
Param_Test::Bounded_StructSeq & s2,
Param_Test::Bounded_StructSeq_out s3);
+
virtual Param_Test::ArraySeq * test_array_sequence (
const Param_Test::ArraySeq & s1,
Param_Test::ArraySeq & s2,
Param_Test::ArraySeq_out s3);
+
virtual Param_Test::Bounded_ArraySeq * test_bounded_array_sequence (
const Param_Test::Bounded_ArraySeq & s1,
Param_Test::Bounded_ArraySeq & s2,
Param_Test::Bounded_ArraySeq_out s3);
+
virtual Param_Test::Coffee_Mix * test_coffe_mix (
const Param_Test::Coffee_Mix & s1,
Param_Test::Coffee_Mix & s2,
Param_Test::Coffee_Mix_out s3);
+
virtual Param_Test::Bounded_Coffee_Mix * test_bounded_coffe_mix (
const Param_Test::Bounded_Coffee_Mix & s1,
Param_Test::Bounded_Coffee_Mix & s2,
Param_Test::Bounded_Coffee_Mix_out s3);
+
virtual CORBA::AnySeq * test_anyseq (
const CORBA::AnySeq & s1,
CORBA::AnySeq & s2,