summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-08-17 20:56:05 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-08-17 20:56:05 +0000
commit53f0f5e55cdc61a5baf25b705396fef1de6e3e1a (patch)
tree009f04dc8b733ba7a545ee4dc91934b77c5e2dcd
parent600b17a8047ae4c2f875277f308e17fe429c871a (diff)
downloadATCD-53f0f5e55cdc61a5baf25b705396fef1de6e3e1a.tar.gz
ChangeLogTag:Mon Aug 17 15:10:25 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
-rw-r--r--TAO/ChangeLog-98c13
-rw-r--r--TAO/TAO_IDL/be/be_visitor_context.cpp21
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp28
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/tie_si.cpp30
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/tie_si.cpp22
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_context.h11
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_interface/tie_sh.h5
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_interface/tie_si.h5
8 files changed, 118 insertions, 17 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c
index 8ce3c2d37f5..b6000ac2c55 100644
--- a/TAO/ChangeLog-98c
+++ b/TAO/ChangeLog-98c
@@ -1,3 +1,16 @@
+Mon Aug 17 15:10:25 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
+
+ * TAO_IDL/be_include/be_visitor_context.h:
+ * TAO_IDL/be/be_visitor_context.cpp:
+ * TAO_IDL/be_include/be_visitor_interface/tie_si.h:
+ * TAO_IDL/be_include/be_visitor_interface/tie_sh.h:
+ * TAO_IDL/be/be_visitor_operation/tie_si.cpp:
+ * TAO_IDL/be/be_visitor_interface/tie_si.cpp:
+ * TAO_IDL/be/be_visitor_interface/tie_sh.cpp:
+ The _tie classes did not override the methods of the base
+ classes, thus, some _tie classes were abstract and thus
+ useless.
+
Mon Aug 17 15:27:22 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
* docs/releasenotes/ec.html:
diff --git a/TAO/TAO_IDL/be/be_visitor_context.cpp b/TAO/TAO_IDL/be/be_visitor_context.cpp
index 57d8b991bae..9d6d7e342ba 100644
--- a/TAO/TAO_IDL/be/be_visitor_context.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_context.cpp
@@ -35,7 +35,8 @@ be_visitor_context::be_visitor_context (void)
tdef_ (0),
attr_ (0),
exception_ (0),
- comma_ (0)
+ comma_ (0),
+ interface_ (0)
{
}
@@ -48,7 +49,8 @@ be_visitor_context::be_visitor_context (const be_visitor_context &ctx)
tdef_ (ctx.tdef_),
attr_ (ctx.attr_),
exception_ (ctx.exception_),
- comma_ (ctx.comma_)
+ comma_ (ctx.comma_),
+ interface_ (ctx.interface_)
{
}
@@ -64,6 +66,7 @@ be_visitor_context::operator= (const be_visitor_context &ctx)
this->attr_ = ctx.attr_;
this->exception_ = ctx.exception_;
this->comma_ = ctx.comma_;
+ this->interface_ = ctx.interface_;
return *this;
}
@@ -198,6 +201,20 @@ be_visitor_context::comma (void)
return this->comma_;
}
+void
+be_visitor_context::interface (be_interface *interface)
+{
+ this->interface_ = interface;
+}
+
+be_interface *
+be_visitor_context::interface (void) const
+{
+ return this->interface_;
+}
+
+// ****************************************************************
+
// return the node as argument if possible
be_argument *
be_visitor_context::be_node_as_argument (void)
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp
index 911ef7ad0ca..d42afcb6f13 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp
@@ -116,13 +116,12 @@ be_visitor_interface_tie_sh::visit_interface (be_interface *node)
<< "// overridden ServantBase operations" << be_nl
<< "PortableServer::POA_ptr _default_POA (CORBA::Environment &env);\n";
- // generate code for the operations in the scope
- if (this->visit_scope (node) == -1)
+ if (node->traverse_inheritance_graph (be_visitor_interface_tie_sh::method_helper, os) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_tie_sh::"
+ "be_visitor_interface_tie_sh_ss::"
"visit_interface - "
- "codegen for scope failed\n"),
+ "traversal of inhertance graph failed\n"),
-1);
}
@@ -142,3 +141,24 @@ be_visitor_interface_tie_sh::visit_interface (be_interface *node)
return 0;
}
+
+int
+be_visitor_interface_tie_sh::method_helper (be_interface *,
+ be_interface *node,
+ TAO_OutStream *os)
+{
+ be_visitor_context ctx;
+ ctx.state (TAO_CodeGen::TAO_INTERFACE_TIE_SH);
+ ctx.stream (os);
+ be_visitor* visitor = tao_cg->make_visitor (&ctx);
+ if (visitor == 0 || visitor->visit_scope (node) == -1)
+ {
+ delete visitor;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "be_visitor_interface_tie_sh::"
+ "method_helper\n"), -1);
+ }
+ delete visitor;
+ return 0;
+}
+
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/tie_si.cpp b/TAO/TAO_IDL/be/be_visitor_interface/tie_si.cpp
index 47553306ffa..124987cd3bd 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/tie_si.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/tie_si.cpp
@@ -171,13 +171,12 @@ be_visitor_interface_tie_si::visit_interface (be_interface *node)
<< "}" << be_uidt
<< "}\n\n";
- // generate code for the operations in the scope
- if (this->visit_scope (node) == -1)
+ if (node->traverse_inheritance_graph (be_visitor_interface_tie_si::method_helper, os) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_interface_tie_si::"
+ "be_visitor_interface_tie_sh_ss::"
"visit_interface - "
- "codegen for scope failed\n"),
+ "traversal of inhertance graph failed\n"),
-1);
}
@@ -188,3 +187,26 @@ be_visitor_interface_tie_si::visit_interface (be_interface *node)
return 0;
}
+
+int
+be_visitor_interface_tie_si::method_helper (be_interface *derived,
+ be_interface *node,
+ TAO_OutStream *os)
+{
+ be_visitor_context ctx;
+ ctx.state (TAO_CodeGen::TAO_INTERFACE_TIE_SI);
+ ctx.interface (derived);
+ ctx.stream (os);
+
+ be_visitor* visitor = tao_cg->make_visitor (&ctx);
+ if (visitor == 0 || visitor->visit_scope (node) == -1)
+ {
+ delete visitor;
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "be_visitor_interface_tie_sh::"
+ "method_helper\n"), -1);
+ }
+ delete visitor;
+ return 0;
+}
+
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/tie_si.cpp b/TAO/TAO_IDL/be/be_visitor_operation/tie_si.cpp
index 0116bbbe466..d0fb0cf1733 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/tie_si.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/tie_si.cpp
@@ -45,13 +45,21 @@ int be_visitor_operation_tie_si::visit_operation (be_operation *node)
{
TAO_OutStream *os = this->ctx_->stream ();
- // We need the interface node in which this operation was defined. However,
- // if this operation node was an attribute node in disguise, we get this
- // information from the context
- be_interface *intf;
- intf = this->ctx_->attribute ()
- ? be_interface::narrow_from_scope (this->ctx_->attribute ()->defined_in ())
- : be_interface::narrow_from_scope (node->defined_in ());
+#if 1
+ be_interface *intf =
+ this->ctx_->interface ();
+#else
+ // We need the interface node in which this operation was
+ // defined. However, if this operation node was an attribute node in
+ // disguise, we get this information from the context
+ be_interface *intf =
+ be_interface::narrow_from_scope (node->defined_in ());
+ if (this->ctx_->atttribute () != 0)
+ {
+ intf =
+ be_interface::narrow_from_scope (this->ctx_->attribute ()->defined_in ());
+ }
+#endif
if (!intf)
{
diff --git a/TAO/TAO_IDL/be_include/be_visitor_context.h b/TAO/TAO_IDL/be_include/be_visitor_context.h
index 5896f2dd892..9ae68dca747 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_context.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_context.h
@@ -100,6 +100,14 @@ public:
idl_bool comma (void);
// are we supposed to generate a comma?
+ be_interface* interface (void) const;
+ void interface (be_interface*);
+ // In some cases we need to generate the objects of one interface as
+ // members of a derived visitor (the TIE classes are a good
+ // example). This field is use to hold the interface where we are
+ // *generating* code, as opposed to the interfaces where the methods
+ // or structures are defined.
+
// = helpers
// visitors may need the actual type of the node stored in this context. We
@@ -223,6 +231,9 @@ private:
idl_bool comma_;
// whether scope should generate a comma after every element
+
+ be_interface* interface_;
+ // See the method declaration above.
};
diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/tie_sh.h b/TAO/TAO_IDL/be_include/be_visitor_interface/tie_sh.h
index c9417e04d22..7516337310e 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_interface/tie_sh.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_interface/tie_sh.h
@@ -41,6 +41,11 @@ public:
virtual int visit_interface (be_interface *node);
// set the right context and make a visitor
+
+ static int method_helper (be_interface *,
+ be_interface *,
+ TAO_OutStream *os);
+ // helper method to generate method declaration in the TIE classes.
};
#endif /* _BE_INTERFACE_TIE_SH_H_ */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface/tie_si.h b/TAO/TAO_IDL/be_include/be_visitor_interface/tie_si.h
index 51221dfedc5..fe3fb0ac09b 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_interface/tie_si.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_interface/tie_si.h
@@ -42,6 +42,11 @@ public:
virtual int visit_interface (be_interface *node);
// set the right context and make a visitor
+
+ static int method_helper (be_interface *,
+ be_interface *,
+ TAO_OutStream *os);
+ // helper method to generate method declaration in the TIE classes.
};
#endif /* _BE_INTERFACE_TIE_SI_H_ */