summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-11-30 19:28:52 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-11-30 19:28:52 +0000
commitb53c223c6d9ad0af1bcbf55922a6aea42182a122 (patch)
treee4cb0bb5b10615e8dd5b9a3a50add01d3d424ce0
parentb7c6974db164dbc0245d6d2f5eff1bc0a30ec212 (diff)
downloadATCD-b53c223c6d9ad0af1bcbf55922a6aea42182a122.tar.gz
ChangeLogTag: Tue Nov 30 11:42:50 2004 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r--TAO/ChangeLog30
-rw-r--r--TAO/TAO_IDL/be/be_codegen.cpp6
-rw-r--r--TAO/TAO_IDL/be/be_decl.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_arg_traits.cpp43
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_arg_traits.h2
-rw-r--r--TAO/TAO_IDL/include/idl_global.h1
-rw-r--r--TAO/TAO_IDL/util/utl_global.cpp4
-rw-r--r--TAO/tao/Any_Arg_Traits.h62
8 files changed, 104 insertions, 46 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 78cdb3e9226..fd58576c3f9 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,33 @@
+Tue Nov 30 11:42:50 2004 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * tao/Any_Arg_Traits.h:
+
+ New file, containing template specializations of the
+ stub and skeleton arg traits classes for CORBA::Any.
+ These specializations were formerly in generated code.
+
+ * TAO_IDL/be/be_codegen.cpp:
+ * TAO_IDL/be/be_decl.cpp:
+ * TAO_IDL/be/be_visitor_arg_traits.cpp:
+ * TAO_IDL/be_include/be_visitor_arg_traits.h:
+ * TAO_IDL/include/idl_global.h:
+ * TAO_IDL/util/utl_global.cpp:
+
+ Added check for an Any used as an operation parameter, and
+ code to include the new file above if one is seen. This
+ was the only predefined type for which arg traits class
+ specializations were generated, so the
+ visit_predefined_type() method was removed from the
+ arg traits visitor, defaulting execution to the base
+ class method which is a no-op. Thanks to Greg Bostrum
+ <greg.bostrom@hp.com> for reporting a problem with code
+ generation in the Notification Service when multiple IDL
+ file are passed to the IDL compiler on a single command
+ line. After processing each file, all nodes in the AST
+ are destroyed except for the predefined types, and now,
+ at least for the arg traits, all predefined types are
+ handled the same.
+
Tue Nov 30 11:15:29 2004 Dale Wilson <wilson_d@ociweb.com>
* orbsvcs/orbsvcs/Notify/ProxyConsumer.h:
diff --git a/TAO/TAO_IDL/be/be_codegen.cpp b/TAO/TAO_IDL/be/be_codegen.cpp
index 0899ae45f6f..190156ddc84 100644
--- a/TAO/TAO_IDL/be/be_codegen.cpp
+++ b/TAO/TAO_IDL/be/be_codegen.cpp
@@ -1856,6 +1856,12 @@ TAO_CodeGen::gen_arg_file_includes (TAO_OutStream *stream)
"tao/Var_Size_Argument_T.h",
stream
);
+
+ this->gen_cond_file_include (
+ idl_global->decls_seen_masks.any_arg_seen_,
+ "tao/Any_Arg_Traits.h",
+ stream
+ );
}
void
diff --git a/TAO/TAO_IDL/be/be_decl.cpp b/TAO/TAO_IDL/be/be_decl.cpp
index b777cf70b7c..f1847f11367 100644
--- a/TAO/TAO_IDL/be/be_decl.cpp
+++ b/TAO/TAO_IDL/be/be_decl.cpp
@@ -914,6 +914,8 @@ be_decl::set_arg_seen_bit (be_type *bt)
case AST_PredefinedType::PT_any:
ACE_SET_BITS (idl_global->decls_seen_info_,
idl_global->decls_seen_masks.var_size_arg_seen_);
+ ACE_SET_BITS (idl_global->decls_seen_info_,
+ idl_global->decls_seen_masks.any_arg_seen_);
break;
case AST_PredefinedType::PT_char:
case AST_PredefinedType::PT_wchar:
diff --git a/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp b/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp
index 740f339c30d..ade81923aad 100644
--- a/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp
@@ -597,49 +597,6 @@ be_visitor_arg_traits::visit_enum (be_enum *node)
}
int
-be_visitor_arg_traits::visit_predefined_type (be_predefined_type *node)
-{
- if (this->generated (node) || !node->seen_in_operation ())
- {
- return 0;
- }
-
- // Only for an Any used in an operation.
- if (node->pt () != AST_PredefinedType::PT_any)
- {
- this->generated (node, I_TRUE);
- return 0;
- }
-
- // This should be generated even for imported nodes. The ifdef guard prevents
- // multiple declarations.
- TAO_OutStream *os = this->ctx_->stream ();
-
- *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
- << "// " << __FILE__ << ":" << __LINE__;
-
- os->gen_ifdef_macro ("corba_any", "arg_traits");
-
- *os << be_nl << be_nl
- << "ACE_TEMPLATE_SPECIALIZATION" << be_nl
- << "class " << be_global->stub_export_macro () << " "
- << this->S_ << "Arg_Traits<CORBA::Any>" << be_idt_nl
- << ": public" << be_idt << be_idt_nl
- << "Var_Size_" << this->S_ << "Arg_Traits_T<" << be_idt << be_idt_nl
- << "CORBA::Any," << be_nl
- << "CORBA::Any_var," << be_nl
- << "CORBA::Any_out" << be_uidt_nl
- << ">" << be_uidt << be_uidt << be_uidt << be_uidt_nl
- << "{" << be_nl
- << "};";
-
- os->gen_endif ();
-
- this->generated (node, I_TRUE);
- return 0;
-}
-
-int
be_visitor_arg_traits::visit_structure (be_structure *node)
{
if (this->generated (node) || !node->seen_in_operation ())
diff --git a/TAO/TAO_IDL/be_include/be_visitor_arg_traits.h b/TAO/TAO_IDL/be_include/be_visitor_arg_traits.h
index 31ed9187232..db7fcec5095 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_arg_traits.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_arg_traits.h
@@ -35,8 +35,6 @@ public:
virtual int visit_enum (be_enum *node);
- virtual int visit_predefined_type (be_predefined_type *node);
-
virtual int visit_interface (be_interface *node);
virtual int visit_interface_fwd (be_interface_fwd *node);
diff --git a/TAO/TAO_IDL/include/idl_global.h b/TAO/TAO_IDL/include/idl_global.h
index f9af6d1a838..9da3521b346 100644
--- a/TAO/TAO_IDL/include/idl_global.h
+++ b/TAO/TAO_IDL/include/idl_global.h
@@ -328,6 +328,7 @@ public:
ACE_UINT64 ub_string_arg_seen_;
ACE_UINT64 var_array_arg_seen_;
ACE_UINT64 var_size_arg_seen_;
+ ACE_UINT64 any_arg_seen_;
} decls_seen_masks;
// Constructor
diff --git a/TAO/TAO_IDL/util/utl_global.cpp b/TAO/TAO_IDL/util/utl_global.cpp
index 1f17a9fb3af..21998af7308 100644
--- a/TAO/TAO_IDL/util/utl_global.cpp
+++ b/TAO/TAO_IDL/util/utl_global.cpp
@@ -146,7 +146,8 @@ IDL_GlobalData::dsf::dsf (void)
special_basic_arg_seen_ (0),
ub_string_arg_seen_ (0),
var_array_arg_seen_ (0),
- var_size_arg_seen_ (0)
+ var_size_arg_seen_ (0),
+ any_arg_seen_ (0)
{}
IDL_GlobalData::IDL_GlobalData (void)
@@ -297,6 +298,7 @@ IDL_GlobalData::IDL_GlobalData (void)
ACE_SET_BITS (this->decls_seen_masks.ub_string_arg_seen_, cursor << 58);
ACE_SET_BITS (this->decls_seen_masks.var_array_arg_seen_, cursor << 59);
ACE_SET_BITS (this->decls_seen_masks.var_size_arg_seen_, cursor << 60);
+ ACE_SET_BITS (this->decls_seen_masks.any_arg_seen_, cursor << 61);
}
IDL_GlobalData::~IDL_GlobalData (void)
diff --git a/TAO/tao/Any_Arg_Traits.h b/TAO/tao/Any_Arg_Traits.h
new file mode 100644
index 00000000000..624e051bdd9
--- /dev/null
+++ b/TAO/tao/Any_Arg_Traits.h
@@ -0,0 +1,62 @@
+// This may look like C, but it's really -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Any_Arg_Traits.h
+ *
+ * $Id$
+ *
+ * @author Jeff Parsons
+ */
+//=============================================================================
+
+
+#ifndef TAO_ANY_ARG_TRAITS_H
+#define TAO_ANY_ARG_TRAITS_H
+
+#include /**/ "ace/pre.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/Arg_Traits_T.h"
+#include "tao/Var_Size_Argument_T.h"
+#include "tao/Var_Size_SArgument_T.h"
+#include "tao/TAO_Export.h"
+
+namespace CORBA
+{
+ class Any;
+ class Any_var;
+ class Any_out;
+}
+
+namespace TAO
+{
+ template<>
+ class TAO_Export Arg_Traits<CORBA::Any>
+ : public
+ Var_Size_Arg_Traits_T<
+ CORBA::Any,
+ CORBA::Any_var,
+ CORBA::Any_out
+ >
+ {
+ };
+
+ template<>
+ class TAO_Export SArg_Traits<CORBA::Any>
+ : public
+ Var_Size_SArg_Traits_T<
+ CORBA::Any,
+ CORBA::Any_var,
+ CORBA::Any_out
+ >
+ {
+ };
+}
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_ANY_ARG_TRAITS_H */