summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-03-29 18:54:36 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-03-29 18:54:36 +0000
commit9fb68716513d06b249f7130e8fc8938c59e7aa6e (patch)
tree7c334d9b36ac4aa98986895db40c4f7a3c4cf4d4
parent5c1cdf897eda58661fd8cf9c0e672987a7fd7ecb (diff)
downloadATCD-9fb68716513d06b249f7130e8fc8938c59e7aa6e.tar.gz
ChangeLogTag: Mon Mar 29 18:49:32 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r--modules/TAO/ChangeLog23
-rw-r--r--modules/TAO/TAO_IDL/be/be_codegen.cpp13
-rw-r--r--modules/TAO/TAO_IDL/be/be_global.cpp15
-rw-r--r--modules/TAO/TAO_IDL/be/be_visitor_sequence/any_op_ch.cpp31
-rw-r--r--modules/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp60
-rw-r--r--modules/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp4
6 files changed, 116 insertions, 30 deletions
diff --git a/modules/TAO/ChangeLog b/modules/TAO/ChangeLog
index 4948507ced1..3c3047875f5 100644
--- a/modules/TAO/ChangeLog
+++ b/modules/TAO/ChangeLog
@@ -1,3 +1,26 @@
+Mon Mar 29 18:49:32 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp:
+
+ Cosmetic changes.
+
+ * TAO_IDL/be/be_codegen.cpp:
+
+ Added generation of includes for CDR and Any operator
+ template header files.
+
+ * TAO_IDL/be/be_visitor_sequence/any_op_ch.cpp:
+ * TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp:
+
+ Added code generation for Any insertions and extraction
+ operators for std::vector<> types representing IDL
+ sequences.
+
+ * TAO_IDL/be/be_global.cpp:
+
+ Added command line option to trigger code generation for
+ alternate C++ mapping.
+
Mon Mar 29 18:46:20 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
* tao/AnyTypeCode/Any.h:
diff --git a/modules/TAO/TAO_IDL/be/be_codegen.cpp b/modules/TAO/TAO_IDL/be/be_codegen.cpp
index 060a99f8caa..607f0dd548b 100644
--- a/modules/TAO/TAO_IDL/be/be_codegen.cpp
+++ b/modules/TAO/TAO_IDL/be/be_codegen.cpp
@@ -2501,6 +2501,19 @@ TAO_CodeGen::gen_stub_src_includes (void)
this->gen_standard_include (this->client_stubs_,
"ace/Auto_Ptr.h");
}
+
+ if (be_global->alt_mapping () && idl_global->seq_seen_)
+ {
+ this->gen_standard_include (this->client_stubs_,
+ "tao/Vector_CDR_T.h");
+
+ if (be_global->any_support ())
+ {
+ this->gen_standard_include (
+ this->client_stubs_,
+ "tao/AnyTypeCode/Vector_AnyOp_T.h");
+ }
+ }
}
void
diff --git a/modules/TAO/TAO_IDL/be/be_global.cpp b/modules/TAO/TAO_IDL/be/be_global.cpp
index dde78ddc05f..0f3782b9ccb 100644
--- a/modules/TAO/TAO_IDL/be/be_global.cpp
+++ b/modules/TAO/TAO_IDL/be/be_global.cpp
@@ -33,10 +33,6 @@
#include "ace/OS_NS_sys_stat.h"
#include "ace/OS_NS_ctype.h"
-ACE_RCSID (be,
- be_global,
- "$Id$")
-
TAO_IDL_BE_Export BE_GlobalData *be_global = 0;
BE_GlobalData::BE_GlobalData (void)
@@ -2537,6 +2533,12 @@ BE_GlobalData::parse_args (long &i, char **av)
// CIAO static configuration code generation.
be_global->gen_ciao_static_config (true);
}
+ else if (av[i][3] == 't' && av[i][4] == 'l')
+ {
+ // Generate code using STL types for strings
+ // and sequences.
+ be_global->alt_mapping (true);
+ }
else
{
ACE_ERROR ((
@@ -3418,6 +3420,11 @@ BE_GlobalData::usage (void) const
));
ACE_DEBUG ((
LM_DEBUG,
+ ACE_TEXT (" -Gstl\t\t\tGenerate the alternate C++ mapping for")
+ ACE_TEXT (" IDL strings and sequences\n")
+ ));
+ ACE_DEBUG ((
+ LM_DEBUG,
ACE_TEXT (" -Gt\t\t\tenable optimized TypeCode support")
ACE_TEXT (" (unopt by default)\n")
));
diff --git a/modules/TAO/TAO_IDL/be/be_visitor_sequence/any_op_ch.cpp b/modules/TAO/TAO_IDL/be/be_visitor_sequence/any_op_ch.cpp
index b1b74da85cf..ee0bfddb75e 100644
--- a/modules/TAO/TAO_IDL/be/be_visitor_sequence/any_op_ch.cpp
+++ b/modules/TAO/TAO_IDL/be/be_visitor_sequence/any_op_ch.cpp
@@ -18,10 +18,6 @@
//
// ============================================================================
-ACE_RCSID (be_visitor_sequence,
- any_op_ch,
- "$Id$")
-
// ***************************************************************************
// Sequence visitor for generating Any operator declarations in the client header
// ***************************************************************************
@@ -54,7 +50,9 @@ be_visitor_sequence_any_op_ch::visit_sequence (be_sequence *node)
ACE_CString name;
- if (be_global->alt_mapping ())
+ bool alt = be_global->alt_mapping ();
+
+ if (alt)
{
be_type *bt =
be_type::narrow_from_decl (node->base_type ());
@@ -77,17 +75,20 @@ be_visitor_sequence_any_op_ch::visit_sequence (be_sequence *node)
<< name.c_str ()
<< " &); // copying version" << be_nl;
- *os << macro
- << " void"
- << " operator<<= ( ::CORBA::Any &, "
- << name.c_str ()
- << "*); // noncopying version" << be_nl;
+ if (!alt)
+ {
+ *os << macro
+ << " void"
+ << " operator<<= ( ::CORBA::Any &, "
+ << name.c_str ()
+ << "*); // noncopying version" << be_nl;
- *os << macro
- << " ::CORBA::Boolean"
- << " operator>>= (const ::CORBA::Any &, "
- << name.c_str ()
- << " *&); // deprecated" << be_nl;
+ *os << macro
+ << " ::CORBA::Boolean"
+ << " operator>>= (const ::CORBA::Any &, "
+ << name.c_str ()
+ << " *&); // deprecated" << be_nl;
+ }
*os << macro
<< " ::CORBA::Boolean"
diff --git a/modules/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp b/modules/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp
index 0dd2aa5aa3d..cf33df441df 100644
--- a/modules/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp
+++ b/modules/TAO/TAO_IDL/be/be_visitor_sequence/any_op_cs.cpp
@@ -18,10 +18,6 @@
//
// ============================================================================
-ACE_RCSID (be_visitor_sequence,
- any_op_cs,
- "$Id$")
-
// ***************************************************************************
// Sequence visitor for generating Any operator declarations in the client
// stubs file
@@ -61,12 +57,62 @@ be_visitor_sequence_any_op_cs::visit_sequence (be_sequence *node)
be_type *bt =
be_type::narrow_from_decl (node->base_type ());
+ if (bt->node_type () == AST_Decl::NT_typedef)
+ {
+ be_typedef *td = be_typedef::narrow_from_decl (bt);
+ bt = td->primitive_base_type ();
+ }
+
+ enum type_category
+ {
+ ANY_VALUE,
+ ANY_OBJREF,
+ ANY_ARRAY
+ };
+
+ type_category tc = ANY_VALUE;
+
+ if (bt->node_type () == AST_Decl::NT_array)
+ {
+ tc = ANY_ARRAY;
+ }
+ else if (be_interface::narrow_from_decl (bt) != 0
+ && be_valuetype::narrow_from_decl (bt) == 0)
+ {
+ tc = ANY_OBJREF;
+ }
+
*os << be_nl
<< "void operator<<= (" << be_idt_nl
- << "::CORBA::Any &," << be_nl
+ << "::CORBA::Any &any," << be_nl
<< "const std::vector<" << bt->full_name ()
- << ">" << be_uidt_nl
- << "{" << be_nl
+ << "> &val" << be_uidt_nl
+ << "{" << be_idt_nl
+ << "return" << be_idt_nl
+ << "TAO_VERSIONED_NAMESPACE_NAME::TAO::";
+
+ switch (tc)
+ {
+ case ANY_OBJREF:
+ *os << "insert_objref_vector<"
+ << bt->full_name () << "_ptr> (";
+
+ break;
+ case ANY_ARRAY:
+ *os << "insert_array_vector<"
+ << bt->full_name () << "_forany> (";
+
+ break;
+ default:
+ *os << "insert_value_vector<"
+ << bt->full_name () << "> (";
+
+ break;
+ }
+
+ *os << be_idt_nl
+ << "any," << be_nl
+ << "val);" << be_uidt << be_uidt << be_uidt_nl
<< "}";
*os << be_nl << be_nl
diff --git a/modules/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp b/modules/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp
index bc63444ec1c..9410c295486 100644
--- a/modules/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp
+++ b/modules/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp
@@ -19,10 +19,6 @@
//
// ============================================================================
-ACE_RCSID (be_visitor_sequence,
- cdr_op_ch,
- "$Id$")
-
// ***************************************************************************
// Sequence visitor for generating CDR operator declarations in the client header
// ***************************************************************************