diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-03-29 16:26:32 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-03-29 16:26:32 +0000 |
commit | e2371152cd5d5c838821e771bce8b8b007a6df26 (patch) | |
tree | 5ac3086c9049a7db14d1cb4976f821ba6723e44e | |
parent | 0c648a449bbbb41bf77ae28f999eb5d495bb3671 (diff) | |
download | ATCD-e2371152cd5d5c838821e771bce8b8b007a6df26.tar.gz |
ChangeLogTag: Mon Mar 29 16:25:57 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r-- | TAO/ChangeLog | 25 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_attribute.cpp | 1 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp | 11 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_component/component_exh.cpp | 5 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_component/component_exs.cpp | 6 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_component/executor_exs.cpp | 15 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_component/facet_exh.cpp | 22 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_component/facet_exs.cpp | 21 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_operation.cpp | 1 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_operation/operation_exs.cpp | 10 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_operation/operation_svs.cpp | 3 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_visitor_attribute/attribute.h | 6 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_visitor_component/facet_exs.h | 2 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_visitor_operation/operation_exs.h | 6 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_visitor_operation/operation_svs.h | 4 |
15 files changed, 78 insertions, 60 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 61a46a4694e..f73b4cb955c 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,28 @@ +Mon Mar 29 16:25:57 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu> + + * TAO_IDL/be/be_visitor_operation/operation_exs.cpp: + * TAO_IDL/be/be_visitor_operation/operation_svs.cpp: + * TAO_IDL/be/be_visitor_operation.cpp: + * TAO_IDL/be/be_visitor_component/facet_exs.cpp: + * TAO_IDL/be/be_visitor_component/component_exh.cpp: + * TAO_IDL/be/be_visitor_component/executor_exs.cpp: + * TAO_IDL/be/be_visitor_component/component_exs.cpp: + * TAO_IDL/be/be_visitor_component/facet_exh.cpp: + * TAO_IDL/be/be_visitor_attribute.cpp: + * TAO_IDL/be/be_visitor_attribute/attribute.cpp: + * TAO_IDL/be_include/be_visitor_operation/operation_exs.h: + * TAO_IDL/be_include/be_visitor_operation/operation_svs.h: + * TAO_IDL/be_include/be_visitor_component/facet_exs.h: + * TAO_IDL/be_include/be_visitor_attribute/attribute.h: + + Changed code generation for the facet executor implementation + class to use a name built on the facet name rather than on + the interface name. If two facets in a component use the + same interface, it's likely that the intention is to + implement the operations of this interface differently + in each facet. This change allows the application developer + to do that. + Fri Mar 26 20:30:48 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu> * TAO_IDL/be/be_visitor_operation/operation.cpp: diff --git a/TAO/TAO_IDL/be/be_visitor_attribute.cpp b/TAO/TAO_IDL/be/be_visitor_attribute.cpp index 67a651f7d4e..8db04380d7a 100644 --- a/TAO/TAO_IDL/be/be_visitor_attribute.cpp +++ b/TAO/TAO_IDL/be/be_visitor_attribute.cpp @@ -12,7 +12,6 @@ */ //============================================================================= - #include "be_array.h" #include "be_component.h" #include "be_enum.h" diff --git a/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp b/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp index 1dd199c106d..1b9b1724d4f 100644 --- a/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp +++ b/TAO/TAO_IDL/be/be_visitor_attribute/attribute.cpp @@ -12,7 +12,6 @@ */ //============================================================================= - // Attribute gets mapped to one or possibly two operations based on whether // it is readonly or not. The two operations "get" and "set" the value of the // attribute. @@ -182,6 +181,7 @@ be_visitor_attribute::visit_attribute (be_attribute *node) { be_visitor_operation_exs visitor (&ctx); visitor.scope (this->op_scope_); + visitor.port_prefix (this->port_prefix_); status = get_op.accept (&visitor); break; } @@ -398,6 +398,7 @@ be_visitor_attribute::visit_attribute (be_attribute *node) { be_visitor_operation_exs visitor (&ctx); visitor.scope (this->op_scope_); + visitor.port_prefix (this->port_prefix_); status = set_op.accept (&visitor); break; } @@ -488,7 +489,13 @@ be_visitor_attribute::for_facets (bool val) } void -be_visitor_attribute::op_scope (be_interface *node) +be_visitor_attribute::op_scope (be_decl *node) { this->op_scope_ = node; } + +void +be_visitor_attribute::port_prefix (ACE_CString &prefix) +{ + this->port_prefix_ = prefix; +}
\ No newline at end of file diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_exh.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_exh.cpp index 687a790bca1..34c70b74ce8 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/component_exh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/component_exh.cpp @@ -42,10 +42,7 @@ be_visitor_component_exh::visit_component (be_component *node) be_visitor_facet_exh facet_visitor (this->ctx_); facet_visitor.node (node); - // (JP) Should this be visit_component_scope(), i.e., - // generate inherited facets as well? Probably the - // behavior should be tied to the LEM force-all option. - if (facet_visitor.visit_scope (node) == -1) + if (facet_visitor.visit_component_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("be_visitor_component_exh::") diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_exs.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_exs.cpp index 2c5af096aa6..f5e01b0641c 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/component_exs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/component_exs.cpp @@ -12,7 +12,6 @@ */ //============================================================================= - be_visitor_component_exs::be_visitor_component_exs ( be_visitor_context *ctx) : be_visitor_component_scope (ctx) @@ -43,10 +42,7 @@ be_visitor_component_exs::visit_component (be_component *node) be_visitor_facet_exs facet_visitor (this->ctx_); facet_visitor.node (node); - // (JP) Should this be visit_component_scope(), i.e., - // generate inherited facets as well? Probably the - // behavior should be tied to the LEM force-all option. - if (facet_visitor.visit_scope (node) == -1) + if (facet_visitor.visit_component_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("be_visitor_component_exs::") diff --git a/TAO/TAO_IDL/be/be_visitor_component/executor_exs.cpp b/TAO/TAO_IDL/be/be_visitor_component/executor_exs.cpp index f62260dd52f..0bfd02ae93d 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/executor_exs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/executor_exs.cpp @@ -194,18 +194,21 @@ be_visitor_executor_exs::visit_provides (be_provides *node) const char *port_name = prefix.c_str (); be_type *obj = node->provides_type (); + const char *iname = + obj->original_local_name ()->get_string (); AST_Decl *scope = ScopeAsDecl (obj->defined_in ()); ACE_CString sname_str (scope->full_name ()); const char *sname = sname_str.c_str (); const char *global = (sname_str == "" ? "" : "::"); - // No '_cxx_' prefix. - const char *lname = obj->original_local_name ()->get_string (); + ACE_CString lname_str (this->port_prefix_); + lname_str += node->original_local_name ()->get_string (); + const char *lname = lname_str.c_str (); os_ << be_nl << be_nl - << global << sname << "::CCM_" << lname - << "_ptr" << be_nl + << global << sname << "::CCM_" + << iname << "_ptr" << be_nl << node_->local_name () << "_exec_i::get_" << port_name << " (void)" << be_nl << "{" << be_idt_nl @@ -217,12 +220,12 @@ be_visitor_executor_exs::visit_provides (be_provides *node) << "tmp," << be_nl << lname << "_exec_i (" << be_idt_nl << "this->ciao_context_.in ())," << be_uidt_nl - << global << sname << "::CCM_" << lname << "::_nil ());" + << global << sname << "::CCM_" << iname << "::_nil ());" << be_uidt_nl << be_nl << "this->ciao_" << port_name << "_ = tmp;" << be_uidt_nl << "}" << be_uidt_nl << be_nl << "return" << be_idt_nl - << global << sname << "::CCM_" << lname + << global << sname << "::CCM_" << iname << "::_duplicate (" << be_idt_nl << "this->ciao_" << port_name << "_.in ());" << be_uidt << be_uidt << be_uidt_nl diff --git a/TAO/TAO_IDL/be/be_visitor_component/facet_exh.cpp b/TAO/TAO_IDL/be/be_visitor_component/facet_exh.cpp index 5774037b767..4a4365ec2cb 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/facet_exh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/facet_exh.cpp @@ -31,21 +31,13 @@ int be_visitor_facet_exh::visit_provides (be_provides *node) { be_type *impl = node->provides_type (); - - /// For the moment, we are generating multiple facet - /// executor classes if the same interface is used in - /// multiple components. I'm leaving the code here in - /// case we change our minds later. -/* - if (impl->exec_hdr_facet_gen ()) - { - return 0; - } -*/ - // We don't want a '_cxx_' prefix here. - const char *lname = + const char *iname = impl->original_local_name ()->get_string (); + ACE_CString lname_str (this->port_prefix_); + lname_str += node->original_local_name ()->get_string (); + const char *lname = lname_str.c_str (); + AST_Decl *s = ScopeAsDecl (impl->defined_in ()); ACE_CString sname_str = IdentifierHelper::orig_sn (s->name (), false); @@ -64,7 +56,7 @@ be_visitor_facet_exh::visit_provides (be_provides *node) << "class " << export_macro_.c_str () << " " << lname << "_exec_i" << be_idt_nl << ": public virtual " << global << sname << "::CCM_" - << lname << "," << be_idt_nl + << iname << "," << be_idt_nl << "public virtual ::CORBA::LocalObject" << be_uidt << be_uidt_nl << "{" << be_nl @@ -120,8 +112,6 @@ be_visitor_facet_exh::visit_provides (be_provides *node) << "_Context_var ciao_context_;" << be_uidt_nl << "};"; -// impl->exec_hdr_facet_gen (true); - return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_component/facet_exs.cpp b/TAO/TAO_IDL/be/be_visitor_component/facet_exs.cpp index 1d33848a65e..ade9d63b1dd 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/facet_exs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/facet_exs.cpp @@ -40,6 +40,7 @@ be_visitor_facet_exs::visit_operation (be_operation *node) be_visitor_operation_exs v (this->ctx_); v.scope (op_scope_); + v.port_prefix (this->port_prefix_); return v.visit_operation (node); } @@ -66,19 +67,9 @@ be_visitor_facet_exs::visit_provides (be_provides *node) { be_type *impl = node->provides_type (); - /// For the moment, we are generating multiple facet - /// executor classes if the same interface is used in - /// multiple components. I'm leaving the code here in - /// case we change our minds later. -/* - if (impl->exec_src_facet_gen ()) - { - return 0; - } -*/ - // We don't want any '_cxx_' prefix here. - const char *lname = - impl->original_local_name ()->get_string (); + ACE_CString lname_str (this->port_prefix_); + lname_str += node->original_local_name ()->get_string (); + const char *lname = lname_str.c_str (); os_ << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl @@ -114,13 +105,13 @@ be_visitor_facet_exs::visit_provides (be_provides *node) << "{" << be_nl << "}"; + op_scope_ = node; + if (impl->node_type () == AST_Decl::NT_interface) { be_interface *intf = be_interface::narrow_from_decl (impl); - op_scope_ = intf; - os_ << be_nl << be_nl << "// Operations from ::" << intf->full_name (); diff --git a/TAO/TAO_IDL/be/be_visitor_operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation.cpp index e5bbad3dc04..e10a53caaee 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation.cpp @@ -36,6 +36,7 @@ #include "be_eventtype.h" #include "be_eventtype_fwd.h" #include "be_home.h" +#include "be_provides.h" #include "be_factory.h" #include "be_extern.h" #include "be_helper.h" diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_exs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_exs.cpp index 794ff672a1c..853e51efc16 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_exs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_exs.cpp @@ -12,7 +12,6 @@ */ //============================================================================= - be_visitor_operation_exs::be_visitor_operation_exs (be_visitor_context *ctx) : be_visitor_scope (ctx), os_ (*ctx->stream ()), @@ -60,6 +59,7 @@ be_visitor_operation_exs::visit_operation (be_operation *node) // Generate the operation name os_ << be_nl + << this->port_prefix_.c_str () << scope_->original_local_name ()->get_string () << "_exec_i::" << node->local_name (); @@ -86,11 +86,17 @@ be_visitor_operation_exs::visit_operation (be_operation *node) } void -be_visitor_operation_exs::scope (be_interface *node) +be_visitor_operation_exs::scope (be_decl *node) { this->scope_ = node; } +void +be_visitor_operation_exs::port_prefix (ACE_CString &prefix) +{ + this->port_prefix_ = prefix; +} + int be_visitor_operation_exs::gen_op_body (be_type *return_type) { diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_svs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_svs.cpp index 5fefae41801..5567f6f66c1 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_svs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_svs.cpp @@ -12,7 +12,6 @@ */ //============================================================================= - be_visitor_operation_svs::be_visitor_operation_svs ( be_visitor_context *ctx) : be_visitor_scope (ctx), @@ -155,7 +154,7 @@ be_visitor_operation_svs::post_process (be_decl *bd) } void -be_visitor_operation_svs::scope (be_interface *node) +be_visitor_operation_svs::scope (be_decl *node) { this->scope_ = node; } diff --git a/TAO/TAO_IDL/be_include/be_visitor_attribute/attribute.h b/TAO/TAO_IDL/be_include/be_visitor_attribute/attribute.h index 209959093d4..6c37127e98a 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_attribute/attribute.h +++ b/TAO/TAO_IDL/be_include/be_visitor_attribute/attribute.h @@ -42,11 +42,13 @@ public: virtual int visit_attribute (be_attribute *node); void for_facets (bool val); - void op_scope (be_interface *node); + void op_scope (be_decl *node); + void port_prefix (ACE_CString &prefix); private: bool for_facets_; - be_interface *op_scope_; + be_decl *op_scope_; + ACE_CString port_prefix_; }; #endif /* _BE_VISITOR_ATTRIBUTE_ATTRIBUTE_H*/ diff --git a/TAO/TAO_IDL/be_include/be_visitor_component/facet_exs.h b/TAO/TAO_IDL/be_include/be_visitor_component/facet_exs.h index 6d16c3dd6df..1b4b5e83e81 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_component/facet_exs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_component/facet_exs.h @@ -38,7 +38,7 @@ public: virtual int visit_provides (be_provides *node); private: - be_interface *op_scope_; + be_provides *op_scope_; const char *comment_border_; }; diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/operation_exs.h b/TAO/TAO_IDL/be_include/be_visitor_operation/operation_exs.h index 03a4fbe9063..929d1524cb8 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/operation_exs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/operation_exs.h @@ -38,14 +38,16 @@ public: virtual int visit_operation (be_operation *node); - void scope (be_interface *node); + void scope (be_decl *node); + void port_prefix (ACE_CString &prefix); private: int gen_op_body (be_type *return_type); private: TAO_OutStream &os_; - be_interface *scope_; + be_decl *scope_; + ACE_CString port_prefix_; const char *your_code_here_; }; diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/operation_svs.h b/TAO/TAO_IDL/be_include/be_visitor_operation/operation_svs.h index efcd5684a70..27f040fb0b6 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation/operation_svs.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/operation_svs.h @@ -41,13 +41,13 @@ public: virtual int post_process (be_decl *bd); - void scope (be_interface *node); + void scope (be_decl *node); private: int gen_op_body (be_operation *node); private: - be_interface *scope_; + be_decl *scope_; }; #endif /* _BE_VISITOR_OPERATION_OPERATION_SVS_H_ */ |