diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2010-04-08 09:57:13 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2010-04-08 09:57:13 +0000 |
commit | 70f0d5283bbe39cfb16d7ad8a130591cdf9e5a7b (patch) | |
tree | 5da1e6ce83f433aece7bd208b962d5972bcf471e | |
parent | 9b2c2bacc762c81ab2dfe0ed06f8656ac8dc107b (diff) | |
download | ATCD-70f0d5283bbe39cfb16d7ad8a130591cdf9e5a7b.tar.gz |
Thu Apr 8 09:55:25 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
* docs/compiler.html:
* TAO_IDL/be/be_global.cpp
* TAO_IDL/be/be_interface.cpp
* TAO_IDL/be/be_provides.cpp
* TAO_IDL/be/be_visitor_ccm_pre_proc.cpp
* TAO_IDL/be/be_visitor_component/servant_svh.cpp
* TAO_IDL/be/be_visitor_component/servant_svs.cpp
* TAO_IDL/be/be_visitor_home/home_svh.cpp
* TAO_IDL/be/be_visitor_home/home_svs.cpp
* TAO_IDL/be_include/be_global.h
Added support for -Gcl which enabled LwCCM
-rw-r--r-- | TAO/ChangeLog | 26 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_global.cpp | 29 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_interface.cpp | 23 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_provides.cpp | 46 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp | 299 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_component/servant_svh.cpp | 33 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_component/servant_svs.cpp | 83 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_home/home_svh.cpp | 22 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_home/home_svs.cpp | 46 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_global.h | 17 | ||||
-rw-r--r-- | TAO/docs/compiler.html | 7 |
11 files changed, 375 insertions, 256 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 793d76a9483..104a3bd4e90 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,17 @@ +Thu Apr 8 09:55:25 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl> + + * docs/compiler.html: + * TAO_IDL/be/be_global.cpp + * TAO_IDL/be/be_interface.cpp + * TAO_IDL/be/be_provides.cpp + * TAO_IDL/be/be_visitor_ccm_pre_proc.cpp + * TAO_IDL/be/be_visitor_component/servant_svh.cpp + * TAO_IDL/be/be_visitor_component/servant_svs.cpp + * TAO_IDL/be/be_visitor_home/home_svh.cpp + * TAO_IDL/be/be_visitor_home/home_svs.cpp + * TAO_IDL/be_include/be_global.h + Added support for -Gcl which enabled LwCCM + Wed Apr 7 16:44:25 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu> * TAO_IDL/be/be_visitor_structure.cpp: @@ -20,7 +34,7 @@ Wed Apr 7 16:44:25 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu> Wed Apr 7 15:18:40 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu> * be/be_visitor_attribute/component_init.cpp: - + Added check in generated code for the success of extraction from Any. If extraction fails, we throw BAD_PARAM. I didn't see any specific indications in the spec about what to @@ -30,7 +44,7 @@ Wed Apr 7 14:10:10 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu> * TAO_IDL/be/be_visitor_component/servant_svh.cpp: * TAO_IDL/be/be_visitor_component/servant_svs.cpp: - + Added checks to eliminate generation and use of populate_port_tables() if the component has neither facets nor event sinks, since this method will be @@ -40,13 +54,13 @@ Wed Apr 7 13:47:38 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu> * TAO_IDL/be/be_component.cpp: * TAO_IDL/be_include/be_component.h: - + Added additional flag to indicated the presence of a multiplex uses port in the component. - + * TAO_IDL/be/be_visitor_component/servant_svh.cpp: * TAO_IDL/be/be_visitor_component/servant_svs.cpp: - + Added checks for the above flag, to determine if the Cookie argument in a generated disconnect() method will be used or not. If not used, it is generated as commented out. @@ -57,7 +71,7 @@ Wed Apr 7 10:39:12 UTC 2010 Marijke Hengstmengel <mhengstmengel@remedy.nl> * tests/Bug_2953_Regression/run_test.pl * tests/Bug_2953_Regression/server.cpp Pass filenames through commandline. - + Wed Apr 7 09:51:12 UTC 2010 Marijke Hengstmengel <mhengstmengel@remedy.nl> diff --git a/TAO/TAO_IDL/be/be_global.cpp b/TAO/TAO_IDL/be/be_global.cpp index ace71eb2abe..e0e42a8f931 100644 --- a/TAO/TAO_IDL/be/be_global.cpp +++ b/TAO/TAO_IDL/be/be_global.cpp @@ -92,6 +92,7 @@ BE_GlobalData::BE_GlobalData (void) gen_direct_collocation_ (false), gen_corba_e_ (false), gen_minimum_corba_ (false), + gen_lwccm_ (false), opt_tc_ (false), ami4ccm_call_back_ (false), ami_call_back_ (false), @@ -1526,6 +1527,19 @@ BE_GlobalData::gen_minimum_corba (void) const } void +BE_GlobalData::gen_lwccm (bool val) +{ + this->gen_lwccm_ = val; +} + +bool +BE_GlobalData::gen_lwccm (void) const +{ + return this->gen_lwccm_; +} + + +void BE_GlobalData::opt_tc (bool val) { this->opt_tc_ = val; @@ -1674,7 +1688,7 @@ void BE_GlobalData::dds_impl (char const * const val) { ACE_CString tmp (val, 0, false); - + if (tmp == "ndds") { this->dds_impl_ = NDDS; @@ -1828,7 +1842,7 @@ BE_GlobalData::destroy (void) ACE::strdelete (this->dds_typesupport_hdr_ending_); this->dds_typesupport_hdr_ending_ = 0; - + ACE::strdelete (this->ciao_ami_conn_idl_ending_); this->ciao_ami_conn_idl_ending_ = 0; @@ -2861,6 +2875,11 @@ BE_GlobalData::parse_args (long &i, char **av) // CORBA/e. be_global->gen_corba_e (true); } + else if (av[i][3] == 'l') + { + // CORBA/e. + be_global->gen_lwccm (true); + } else { ACE_ERROR (( @@ -3202,7 +3221,7 @@ BE_GlobalData::parse_args (long &i, char **av) av[i] )); } - + break; default: ACE_ERROR (( @@ -3616,6 +3635,10 @@ BE_GlobalData::usage (void) const )); ACE_DEBUG (( LM_DEBUG, + ACE_TEXT (" -Gcl \t\t\tGenerate code optimized for LwCCM\n") + )); + ACE_DEBUG (( + LM_DEBUG, ACE_TEXT (" -Gd \t\t\tGenerate the code for direct collocation. Default ") ACE_TEXT ("is thru-POA collocation\n") )); diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp index 53e84abd0ce..e08bf147121 100644 --- a/TAO/TAO_IDL/be/be_interface.cpp +++ b/TAO/TAO_IDL/be/be_interface.cpp @@ -2913,15 +2913,20 @@ be_interface::gen_facet_svnt_src (be_visitor *visitor, << "if (! ::CORBA::is_nil (sc.in ()))" << be_idt_nl << "{" << be_idt_nl << "return sc->get_CCM_object ();" << be_uidt_nl - << "}" << be_uidt_nl << be_nl - << "::Components::EntityContext_var ec =" << be_idt_nl - << "::Components::EntityContext::_narrow (this->ctx_.in ());" - << be_uidt_nl << be_nl - << "if (! ::CORBA::is_nil (ec.in ()))" << be_idt_nl - << "{" << be_idt_nl - << "return ec->get_CCM_object ();" << be_uidt_nl - << "}" << be_uidt_nl << be_nl - << "throw ::CORBA::INTERNAL ();" << be_uidt_nl + << "}" << be_uidt_nl << be_nl; + + if (!be_global->gen_lwccm ()) + { + os << "::Components::EntityContext_var ec =" << be_idt_nl + << "::Components::EntityContext::_narrow (this->ctx_.in ());" + << be_uidt_nl << be_nl + << "if (! ::CORBA::is_nil (ec.in ()))" << be_idt_nl + << "{" << be_idt_nl + << "return ec->get_CCM_object ();" << be_uidt_nl + << "}" << be_uidt_nl << be_nl; + } + + os << "throw ::CORBA::INTERNAL ();" << be_uidt_nl << "}"; os << be_uidt_nl diff --git a/TAO/TAO_IDL/be/be_provides.cpp b/TAO/TAO_IDL/be/be_provides.cpp index e58276a3cc8..846f35d068f 100644 --- a/TAO/TAO_IDL/be/be_provides.cpp +++ b/TAO/TAO_IDL/be/be_provides.cpp @@ -6,6 +6,7 @@ #include "be_attribute.h" #include "be_visitor.h" #include "be_helper.h" +#include "be_extern.h" #include "be_visitor_operation.h" #include "be_visitor_attribute.h" @@ -207,9 +208,9 @@ be_provides::gen_facet_svnt_defn (TAO_OutStream &os) op_scope->get_insert_queue ().reset (); op_scope->get_del_queue ().reset (); op_scope->get_insert_queue ().enqueue_tail (op_scope); - + be_facet_op_attr_defn_helper helper (op_scope); - + int status = op_scope->traverse_inheritance_graph (helper, &os, @@ -238,15 +239,20 @@ be_provides::gen_facet_svnt_defn (TAO_OutStream &os) << "if (! ::CORBA::is_nil (sc.in ()))" << be_idt_nl << "{" << be_idt_nl << "return sc->get_CCM_object ();" << be_uidt_nl - << "}" << be_uidt_nl << be_nl - << "::Components::EntityContext_var ec =" << be_idt_nl - << "::Components::EntityContext::_narrow (this->ctx_.in ());" - << be_uidt_nl << be_nl - << "if (! ::CORBA::is_nil (ec.in ()))" << be_idt_nl - << "{" << be_idt_nl - << "return ec->get_CCM_object ();" << be_uidt_nl - << "}" << be_uidt_nl << be_nl - << "throw ::CORBA::INTERNAL ();" << be_uidt_nl + << "}" << be_uidt_nl << be_nl; + + if (!be_global->gen_lwccm ()) + { + os << "::Components::EntityContext_var ec =" << be_idt_nl + << "::Components::EntityContext::_narrow (this->ctx_.in ());" + << be_uidt_nl << be_nl + << "if (! ::CORBA::is_nil (ec.in ()))" << be_idt_nl + << "{" << be_idt_nl + << "return ec->get_CCM_object ();" << be_uidt_nl + << "}" << be_uidt_nl << be_nl; + } + + os << "throw ::CORBA::INTERNAL ();" << be_uidt_nl << "}"; os << be_uidt_nl @@ -290,7 +296,7 @@ be_facet_op_attr_defn_helper::emit (be_interface * /* derived_interface */, { return 0; } - + be_visitor_context ctx; ctx.stream (os); ctx.state (TAO_CodeGen::TAO_ROOT_SVS); @@ -301,17 +307,17 @@ be_facet_op_attr_defn_helper::emit (be_interface * /* derived_interface */, { AST_Decl *d = i.item (); AST_Decl::NodeType nt = d->node_type (); - + switch (nt) { case AST_Decl::NT_op: { be_operation *op = be_operation::narrow_from_decl (d); - + be_visitor_operation_svs v (&ctx); v.scope (op_scope_); - + if (v.visit_operation (op) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -320,17 +326,17 @@ be_facet_op_attr_defn_helper::emit (be_interface * /* derived_interface */, ACE_TEXT ("visit_operation() failed\n")), -1); } - + break; } case AST_Decl::NT_attr: { be_attribute *attr = be_attribute::narrow_from_decl (d); - + be_visitor_attribute v (&ctx); v.op_scope (op_scope_); - + if (v.visit_attribute (attr) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -339,14 +345,14 @@ be_facet_op_attr_defn_helper::emit (be_interface * /* derived_interface */, ACE_TEXT ("visit_attribute() failed\n")), -1); } - + break; } default: continue; } } - + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp b/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp index 79aaae3b4b3..ba4a00f8297 100644 --- a/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp +++ b/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp @@ -94,11 +94,11 @@ int be_visitor_ccm_pre_proc::visit_root (be_root *node) { if (be_global->ami4ccm_call_back ()) - { + { /// Do this before traversing the tree so the traversal /// will pick up the implied uses nodes we add, if any. int status = this->generate_ami4ccm_uses (); - + if (status == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -159,10 +159,10 @@ be_visitor_ccm_pre_proc::visit_component (be_component *node) ACE_TEXT ("lookups failed\n")), -1); } - + // Set working node for all port code generation. this->comp_ = node; - + if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -189,37 +189,40 @@ be_visitor_ccm_pre_proc::visit_provides (be_provides *node) { return 0; } - - // If this facet comes from a porttype, the instantiated - // port/mirrorport name is prefixed to the facet name. - ACE_CString prefix ("provide_"); - prefix += this->port_prefix_; - - AST_Operation *provides_op = 0; - UTL_ScopedName *op_name = - this->create_scoped_name (prefix.c_str (), - node->local_name ()->get_string (), - 0, - comp_); - ACE_NEW_RETURN (provides_op, - be_operation (node->provides_type (), - AST_Operation::OP_noflags, - 0, - 0, - 0), - -1); - - provides_op->set_defined_in (comp_); - provides_op->set_imported (comp_->imported ()); - provides_op->set_name (op_name); - if (0 == comp_->be_add_operation (provides_op)) + if (!be_global->gen_lwccm ()) { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("be_visitor_ccm_pre_proc::") - ACE_TEXT ("visit_provides - ") - ACE_TEXT ("be_add_operation() failed\n")), - -1); + // If this facet comes from a porttype, the instantiated + // port/mirrorport name is prefixed to the facet name. + ACE_CString prefix ("provide_"); + prefix += this->port_prefix_; + + AST_Operation *provides_op = 0; + UTL_ScopedName *op_name = + this->create_scoped_name (prefix.c_str (), + node->local_name ()->get_string (), + 0, + comp_); + ACE_NEW_RETURN (provides_op, + be_operation (node->provides_type (), + AST_Operation::OP_noflags, + 0, + 0, + 0), + -1); + + provides_op->set_defined_in (comp_); + provides_op->set_imported (comp_->imported ()); + provides_op->set_name (op_name); + + if (0 == comp_->be_add_operation (provides_op)) + { + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("be_visitor_ccm_pre_proc::") + ACE_TEXT ("visit_provides - ") + ACE_TEXT ("be_add_operation() failed\n")), + -1); + } } return 0; @@ -233,62 +236,65 @@ be_visitor_ccm_pre_proc::visit_uses (be_uses *node) return 0; } - if (node->is_multiple ()) + if (!be_global->gen_lwccm ()) { - if (this->gen_connect_multiple (node) == -1) + if (node->is_multiple ()) { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("be_visitor_ccm_pre_proc::") - ACE_TEXT ("visit_uses - ") - ACE_TEXT ("gen_connect_multiple failed\n")), - -1); + if (this->gen_connect_multiple (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("be_visitor_ccm_pre_proc::") + ACE_TEXT ("visit_uses - ") + ACE_TEXT ("gen_connect_multiple failed\n")), + -1); + } + + if (this->gen_disconnect_multiple (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("be_visitor_ccm_pre_proc::") + ACE_TEXT ("visit_uses - ") + ACE_TEXT ("gen_disconnect_multiple failed\n")), + -1); + } + + if (this->gen_get_connection_multiple (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("be_visitor_ccm_pre_proc::") + ACE_TEXT ("visit_uses - ") + ACE_TEXT ("gen_get_connection_single failed\n")), + -1); + } } - - if (this->gen_disconnect_multiple (node) == -1) + else { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("be_visitor_ccm_pre_proc::") - ACE_TEXT ("visit_uses - ") - ACE_TEXT ("gen_disconnect_multiple failed\n")), - -1); - } - - if (this->gen_get_connection_multiple (node) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("be_visitor_ccm_pre_proc::") - ACE_TEXT ("visit_uses - ") - ACE_TEXT ("gen_get_connection_single failed\n")), - -1); - } - } - else - { - if (this->gen_connect_single (node) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("be_visitor_ccm_pre_proc::") - ACE_TEXT ("visit_uses - ") - ACE_TEXT ("gen_connect_single failed\n")), - -1); - } - - if (this->gen_disconnect_single (node) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("be_visitor_ccm_pre_proc::") - ACE_TEXT ("visit_uses - ") - ACE_TEXT ("gen_disconnect_single failed\n")), - -1); - } - - if (this->gen_get_connection_single (node) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("be_visitor_ccm_pre_proc::") - ACE_TEXT ("visit_uses - ") - ACE_TEXT ("gen_get_connection_single failed\n")), - -1); + if (this->gen_connect_single (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("be_visitor_ccm_pre_proc::") + ACE_TEXT ("visit_uses - ") + ACE_TEXT ("gen_connect_single failed\n")), + -1); + } + + if (this->gen_disconnect_single (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("be_visitor_ccm_pre_proc::") + ACE_TEXT ("visit_uses - ") + ACE_TEXT ("gen_disconnect_single failed\n")), + -1); + } + + if (this->gen_get_connection_single (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("be_visitor_ccm_pre_proc::") + ACE_TEXT ("visit_uses - ") + ACE_TEXT ("gen_get_connection_single failed\n")), + -1); + } } } @@ -365,7 +371,7 @@ be_visitor_ccm_pre_proc::visit_home (be_home *node) { return 0; } - + AST_Interface *xplicit = this->create_explicit (node); if (xplicit == 0) @@ -460,13 +466,16 @@ be_visitor_ccm_pre_proc::gen_implicit_ops (be_home *node, return 0; } - if (this->gen_find_by_primary_key (node, implicit) == -1) + if (!be_global->gen_lwccm ()) { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("be_visitor_ccm_pre_proc::") - ACE_TEXT ("gen_implicit_ops - ") - ACE_TEXT ("gen_find_by_primary_key failed\n")), - -1); + if (this->gen_find_by_primary_key (node, implicit) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("be_visitor_ccm_pre_proc::") + ACE_TEXT ("gen_implicit_ops - ") + ACE_TEXT ("gen_find_by_primary_key failed\n")), + -1); + } } if (this->gen_remove (node, implicit) == -1) @@ -478,13 +487,16 @@ be_visitor_ccm_pre_proc::gen_implicit_ops (be_home *node, -1); } - if (this->gen_get_primary_key (node, implicit) == -1) + if (!be_global->gen_lwccm ()) { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("be_visitor_ccm_pre_proc::") - ACE_TEXT ("gen_implicit_ops - ") - ACE_TEXT ("gen_get_primary_key failed\n")), - -1); + if (this->gen_get_primary_key (node, implicit) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("be_visitor_ccm_pre_proc::") + ACE_TEXT ("gen_implicit_ops - ") + ACE_TEXT ("gen_get_primary_key failed\n")), + -1); + } } return 0; @@ -499,7 +511,7 @@ be_visitor_ccm_pre_proc::gen_connect_single (be_uses *node) // port/mirrorport name is prefixed to the receptacle name. ACE_CString prefix ("connect_"); prefix += this->port_prefix_; - + UTL_ScopedName *op_full_name = this->create_scoped_name (prefix.c_str (), node->local_name ()->get_string (), @@ -555,7 +567,7 @@ be_visitor_ccm_pre_proc::gen_disconnect_single (be_uses *node) // port/mirrorport name is prefixed to the receptacle name. ACE_CString prefix ("disconnect_"); prefix += this->port_prefix_; - + UTL_ScopedName *op_full_name = this->create_scoped_name (prefix.c_str (), node->local_name ()->get_string (), @@ -594,7 +606,7 @@ be_visitor_ccm_pre_proc::gen_get_connection_single (be_uses *node) // port/mirrorport name is prefixed to the receptacle name. ACE_CString prefix ("get_connection_"); prefix += this->port_prefix_; - + UTL_ScopedName *op_full_name = this->create_scoped_name (prefix.c_str (), node->local_name ()->get_string (), @@ -611,7 +623,7 @@ be_visitor_ccm_pre_proc::gen_get_connection_single (be_uses *node) op->set_name (op_full_name); op->set_defined_in (comp_); op->set_imported (comp_->imported ()); - + if (0 == comp_->be_add_operation (op)) { return -1; @@ -627,7 +639,7 @@ be_visitor_ccm_pre_proc::gen_connect_multiple (be_uses *node) // port/mirrorport name is prefixed to the receptacle name. ACE_CString prefix ("connect_"); prefix += this->port_prefix_; - + UTL_ScopedName *op_full_name = this->create_scoped_name (prefix.c_str (), node->local_name ()->get_string (), @@ -683,7 +695,7 @@ be_visitor_ccm_pre_proc::gen_disconnect_multiple (be_uses *node) // port/mirrorport name is prefixed to the receptacle name. ACE_CString prefix ("disconnect_"); prefix += this->port_prefix_; - + UTL_ScopedName *op_full_name = this->create_scoped_name (prefix.c_str (), node->local_name ()->get_string (), @@ -733,7 +745,7 @@ be_visitor_ccm_pre_proc::gen_get_connection_multiple (be_uses *node) // port/mirrorport name is prefixed to the receptacle name. ACE_CString prefix ("get_connections_"); prefix += this->port_prefix_; - + UTL_ScopedName *op_full_name = this->create_scoped_name (prefix.c_str (), node->local_name ()->get_string (), @@ -822,6 +834,11 @@ be_visitor_ccm_pre_proc::gen_push_op (be_eventtype *node, int be_visitor_ccm_pre_proc::gen_subscribe (be_publishes *node) { + if (be_global->gen_lwccm ()) + { + return 0; + } + UTL_ScopedName *op_name = this->create_scoped_name ("subscribe_", node->local_name ()->get_string (), @@ -878,6 +895,11 @@ be_visitor_ccm_pre_proc::gen_subscribe (be_publishes *node) int be_visitor_ccm_pre_proc::gen_unsubscribe (be_publishes *node) { + if (be_global->gen_lwccm ()) + { + return 0; + } + AST_Interface *i = this->lookup_consumer (node); if (i == 0) @@ -933,6 +955,11 @@ be_visitor_ccm_pre_proc::gen_unsubscribe (be_publishes *node) int be_visitor_ccm_pre_proc::gen_emits_connect (be_emits *node) { + if (be_global->gen_lwccm ()) + { + return 0; + } + UTL_ScopedName *op_name = this->create_scoped_name ("connect_", node->local_name ()->get_string (), @@ -988,6 +1015,11 @@ be_visitor_ccm_pre_proc::gen_emits_connect (be_emits *node) int be_visitor_ccm_pre_proc::gen_emits_disconnect (be_emits *node) { + if (be_global->gen_lwccm ()) + { + return 0; + } + AST_Interface *i = this->lookup_consumer (node); if (i == 0) @@ -1033,6 +1065,11 @@ be_visitor_ccm_pre_proc::gen_emits_disconnect (be_emits *node) int be_visitor_ccm_pre_proc::gen_get_consumer (be_consumes *node) { + if (be_global->gen_lwccm ()) + { + return 0; + } + AST_Interface *i = this->lookup_consumer (node); if (i == 0) @@ -1293,7 +1330,7 @@ be_visitor_ccm_pre_proc::gen_extended_port (be_porttype *pt) ACE_TEXT ("visit_scope for porttype failed\n")), -1); } - + return 0; } @@ -1400,11 +1437,11 @@ be_visitor_ccm_pre_proc::create_event_consumer (be_eventtype *node) node->local_name (), "Consumer", ScopeAsDecl (node->defined_in ())); - + /// We need to create event consumers even for forward /// declared eventtypes. Since forward declarations can /// appear any number of times, we need to check that this - /// event consumer hasn't already been created. + /// event consumer hasn't already been created. if (s->lookup_by_name (consumer_name, true) != 0) { return 0; @@ -1496,7 +1533,7 @@ AST_Interface * be_visitor_ccm_pre_proc::create_explicit (be_home *node) { be_visitor_xplicit_pre_proc v (this->ctx_); - + if (v.visit_home (node) != 0) { ACE_ERROR_RETURN ((LM_ERROR, @@ -1505,7 +1542,7 @@ be_visitor_ccm_pre_proc::create_explicit (be_home *node) ACE_TEXT ("home xplicit visitor failed\n")), 0); } - + return v.xplicit (); } @@ -1516,20 +1553,20 @@ be_visitor_ccm_pre_proc::create_implicit (be_home *node) ACE_NEW_RETURN (parent_id, Identifier ("KeylessCCMHome"), 0); - + UTL_ScopedName *parent_local_name = 0; ACE_NEW_RETURN (parent_local_name, UTL_ScopedName (parent_id, 0), 0); - + UTL_ScopedName *parent_full_name = 0; ACE_NEW_RETURN (parent_full_name, UTL_ScopedName (this->module_id_.copy (), parent_local_name), 0); - + UTL_NameList parent_list (parent_full_name, 0); - + UTL_NameList *parent_list_ptr = 0; if (node->primary_key () == 0) @@ -1553,7 +1590,7 @@ be_visitor_ccm_pre_proc::create_implicit (be_home *node) node->local_name (), "Implicit", ScopeAsDecl (node->defined_in ())); - + be_interface *i = 0; ACE_NEW_RETURN (i, be_interface (implicit_name, @@ -1567,19 +1604,19 @@ be_visitor_ccm_pre_proc::create_implicit (be_home *node) // Back to reality. idl_global->scopes ().pop (); - + header.destroy (); parent_list.destroy (); i->set_name (implicit_name); i->set_defined_in (node->defined_in ()); i->set_imported (node->imported ()); - + i->gen_fwd_helper_name (); i->original_interface (node); AST_Module *m = AST_Module::narrow_from_scope (node->defined_in ()); m->be_add_interface (i); - + return i; } @@ -1631,7 +1668,7 @@ be_visitor_ccm_pre_proc::create_equivalent (be_home *node, retval->set_imported (node->imported ()); retval->gen_fwd_helper_name (); retval->original_interface (node); - + UTL_ScopedName *unmangled_name = static_cast<UTL_ScopedName *> (node->name ()->copy ()); UTL_ScopedName *mangled_name = @@ -1734,7 +1771,7 @@ be_visitor_ccm_pre_proc::compute_inheritance (be_home *node) int be_visitor_ccm_pre_proc::generate_ami4ccm_uses (void) -{ +{ /// The interfaces in the list below are from this IDL file, /// which then must be processed with the -GC option, so we /// know we'll get here - a good place to generate the *A.idl @@ -1771,9 +1808,9 @@ be_visitor_ccm_pre_proc::generate_ami4ccm_uses (void) idl_global->err ()->lookup_error (sn); continue; } - + be_uses *u = be_uses::narrow_from_decl (d); - + if (u == 0) { ACE_ERROR_RETURN ((LM_ERROR, @@ -1783,19 +1820,19 @@ be_visitor_ccm_pre_proc::generate_ami4ccm_uses (void) ACE_TEXT ("failed\n")), -1); } - + be_interface *iface = be_interface::narrow_from_decl (u->uses_type ()); /// The real AMI_xxx exists only in the *A.idl file, si /// we create a dummy as the uses type for the implied /// receptacle created below. - + ACE_CString iname ("AMI_"); iname += iface->local_name (); Identifier itmp_id (iname.c_str ()); UTL_ScopedName itmp_sn (&itmp_id, 0); - + s = iface->defined_in (); idl_global->scopes ().push (s); be_interface *ami_iface = 0; @@ -1808,24 +1845,24 @@ be_visitor_ccm_pre_proc::generate_ami4ccm_uses (void) true, false), -1); - + /// Make it imported so it doesn't trigger - /// any unwanted code generation. + /// any unwanted code generation. ami_iface->set_imported (true); s->add_to_scope (ami_iface); idl_global->scopes ().pop (); - + /// Now create the receptacle, passing in /// the local interface created above as the /// uses type. We don't generate anything /// in the main IDL file from the interface's /// contents, so it's ok that it's empty. - + ACE_CString uname ("sendc_"); uname += u->local_name ()->get_string (); Identifier utmp_id (uname.c_str ()); UTL_ScopedName utmp_sn (&utmp_id, 0); - + s = u->defined_in (); idl_global->scopes ().push (s); be_uses *ami_uses = 0; @@ -1834,7 +1871,7 @@ be_visitor_ccm_pre_proc::generate_ami4ccm_uses (void) ami_iface, false), -1); - + s->add_to_scope (ami_uses); idl_global->scopes ().pop (); } diff --git a/TAO/TAO_IDL/be/be_visitor_component/servant_svh.cpp b/TAO/TAO_IDL/be/be_visitor_component/servant_svh.cpp index d32039b96b5..9d0f585b87b 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/servant_svh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/servant_svh.cpp @@ -132,16 +132,16 @@ be_visitor_servant_svh::visit_attribute (be_attribute *node) int be_visitor_servant_svh::visit_provides (be_provides *node) { + if (node->provides_type ()->is_local () || be_global->gen_lwccm ()) + { + return 0; + } + ACE_CString prefix (this->port_prefix_); prefix +=node->local_name ()->get_string (); const char *port_name = prefix.c_str (); const char *obj_name = node->provides_type ()->full_name (); - if (node->provides_type ()->is_local ()) - { - return 0; - } - os_ << be_uidt_nl << be_nl << "public:" << be_idt_nl << "virtual ::" << obj_name << "_ptr" << be_nl @@ -163,17 +163,17 @@ be_visitor_servant_svh::visit_provides (be_provides *node) int be_visitor_servant_svh::visit_uses (be_uses *node) { + if (node->uses_type ()->is_local ()) + { + return 0; + } + ACE_CString prefix (this->port_prefix_); prefix +=node->local_name ()->get_string (); const char *port_name = prefix.c_str (); const char *obj_name = node->uses_type ()->full_name (); bool const is_multiple = node->is_multiple (); - if (node->uses_type ()->is_local ()) - { - return 0; - } - os_ << be_uidt_nl << be_nl << "public:" << be_idt_nl << "virtual "; @@ -433,10 +433,13 @@ be_visitor_servant_svh::gen_non_type_specific (void) << be_nl << "disconnect_consumer (const char * source_name);"; - os_ << be_nl << be_nl - << "virtual ::Components::EmitterDescriptions *" - << be_nl - << "get_all_emitters (void);"; + if (!be_global->gen_lwccm ()) + { + os_ << be_nl << be_nl + << "virtual ::Components::EmitterDescriptions *" + << be_nl + << "get_all_emitters (void);"; + } } } @@ -450,7 +453,7 @@ be_visitor_servant_svh::gen_non_type_specific (void) /// No need for this method if the component has neither /// facets nor event sinks. - if (this->node_->has_provides () || this->node_->has_consumes ()) + if (!be_global->gen_lwccm () && (this->node_->has_provides () || this->node_->has_consumes ())) { os_ << be_uidt_nl << be_nl << "private:" << be_idt_nl diff --git a/TAO/TAO_IDL/be/be_visitor_component/servant_svs.cpp b/TAO/TAO_IDL/be/be_visitor_component/servant_svs.cpp index f084c30503c..d57906d03bc 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/servant_svs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/servant_svs.cpp @@ -101,7 +101,7 @@ be_visitor_servant_svs::visit_component (be_component *node) /// If a component has neither facets nor event sinks, the /// populate_port_tables() method isn't generated. - if (this->node_->has_provides () || this->node_->has_consumes ()) + if (!be_global->gen_lwccm () && (this->node_->has_provides () || this->node_->has_consumes ())) { os_ << "try" << be_idt_nl << "{" << be_idt_nl @@ -111,7 +111,7 @@ be_visitor_servant_svs::visit_component (be_component *node) << "{" << be_nl << "}" << be_uidt << be_uidt_nl; } - + os_ << "}"; os_ << be_nl << be_nl @@ -207,7 +207,7 @@ be_visitor_servant_svs::visit_component (be_component *node) -1); } - if (this->node_->has_provides () || this->node_->has_consumes ()) + if (!be_global->gen_lwccm () && (this->node_->has_provides () || this->node_->has_consumes ())) { os_ << be_nl << be_nl << "/// Private method to trigger population of the port" @@ -278,6 +278,11 @@ be_visitor_servant_svs::visit_attribute (be_attribute *node) int be_visitor_servant_svs::visit_provides (be_provides *node) { + if (node->provides_type ()->is_local () || be_global->gen_lwccm ()) + { + return 0; + } + ACE_CString prefix (this->port_prefix_); prefix += node->local_name ()->get_string (); const char *port_name = prefix.c_str (); @@ -288,11 +293,6 @@ be_visitor_servant_svs::visit_provides (be_provides *node) ACE_CString sname_str (scope->full_name ()); const char *sname = sname_str.c_str (); - if (node->provides_type ()->is_local ()) - { - return 0; - } - // Avoid '_cxx_' prefix. const char *lname = obj->original_local_name ()->get_string (); @@ -382,6 +382,11 @@ be_visitor_servant_svs::visit_provides (be_provides *node) int be_visitor_servant_svs::visit_uses (be_uses *node) { + if (node->uses_type ()->is_local ()) + { + return 0; + } + ACE_CString prefix (this->port_prefix_); prefix += node->local_name ()->get_string (); const char *port_name = prefix.c_str (); @@ -389,11 +394,6 @@ be_visitor_servant_svs::visit_uses (be_uses *node) const char *obj_name = node->uses_type ()->full_name (); bool const is_multiple = node->is_multiple (); - if (node->uses_type ()->is_local ()) - { - return 0; - } - os_ << be_nl << be_nl << (is_multiple ? "::Components::Cookie *" : "void") << be_nl @@ -1102,37 +1102,40 @@ be_visitor_servant_svs::gen_emits_top (void) << "throw ::Components::InvalidName ();" << be_uidt_nl << "}"; - os_ << be_nl << be_nl - << "::Components::EmitterDescriptions *" << be_nl - << node_->local_name () - << "_Servant::get_all_emitters (void)" << be_nl - << "{" << be_idt_nl - << "::Components::EmitterDescriptions *retval = 0;" - << be_nl - << "ACE_NEW_RETURN (retval," << be_nl - << " ::Components::EmitterDescriptions," - << be_nl - << " 0);" << be_nl << be_nl - << "::Components::EmitterDescriptions_var " - << "safe_retval = retval;" << be_nl - << "safe_retval->length (" << n_emits_ - << "UL);"; + if (!be_global->gen_lwccm ()) + { + os_ << be_nl << be_nl + << "::Components::EmitterDescriptions *" << be_nl + << node_->local_name () + << "_Servant::get_all_emitters (void)" << be_nl + << "{" << be_idt_nl + << "::Components::EmitterDescriptions *retval = 0;" + << be_nl + << "ACE_NEW_RETURN (retval," << be_nl + << " ::Components::EmitterDescriptions," + << be_nl + << " 0);" << be_nl << be_nl + << "::Components::EmitterDescriptions_var " + << "safe_retval = retval;" << be_nl + << "safe_retval->length (" << n_emits_ + << "UL);"; - be_visitor_emitter_desc ed_visitor (this->ctx_); + be_visitor_emitter_desc ed_visitor (this->ctx_); - if (ed_visitor.visit_component_scope (node_) == -1) - { - ACE_ERROR ((LM_ERROR, - "be_visitor_component_svs::" - "gen_emits_top - " - "emitter description visitor failed\n")); + if (ed_visitor.visit_component_scope (node_) == -1) + { + ACE_ERROR ((LM_ERROR, + "be_visitor_component_svs::" + "gen_emits_top - " + "emitter description visitor failed\n")); - return; - } + return; + } - os_ << be_nl << be_nl - << "return safe_retval._retn ();" << be_uidt_nl - << "}"; + os_ << be_nl << be_nl + << "return safe_retval._retn ();" << be_uidt_nl + << "}"; + } } // ========================================================== diff --git a/TAO/TAO_IDL/be/be_visitor_home/home_svh.cpp b/TAO/TAO_IDL/be/be_visitor_home/home_svh.cpp index c625d5f4945..2e96c7f5729 100644 --- a/TAO/TAO_IDL/be/be_visitor_home/home_svh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_home/home_svh.cpp @@ -171,20 +171,26 @@ be_visitor_home_svh::gen_servant_class (void) << "create (" << be_idt_nl << "::" << pk->name () << " * key);" << be_uidt; - os_ << be_nl << be_nl - << "virtual ::" << comp_->name () << "_ptr" << be_nl - << "find_by_primary_key (" << be_idt_nl - << "::" << pk->name () << " * key);" << be_uidt; + if (!be_global->gen_lwccm ()) + { + os_ << be_nl << be_nl + << "virtual ::" << comp_->name () << "_ptr" << be_nl + << "find_by_primary_key (" << be_idt_nl + << "::" << pk->name () << " * key);" << be_uidt; + } os_ << be_nl << be_nl << "virtual void" << be_nl << "remove (" << be_idt_nl << "::" << pk->name () << " * key);" << be_uidt; - os_ << be_nl << be_nl - << "virtual ::" << pk->name () << " *" << be_nl - << "get_primary_key (" << be_idt_nl - << "::" << comp_->name () << "_ptr comp);" << be_uidt; + if (!be_global->gen_lwccm ()) + { + os_ << be_nl << be_nl + << "virtual ::" << pk->name () << " *" << be_nl + << "get_primary_key (" << be_idt_nl + << "::" << comp_->name () << "_ptr comp);" << be_uidt; + } } be_home *h = node_; diff --git a/TAO/TAO_IDL/be/be_visitor_home/home_svs.cpp b/TAO/TAO_IDL/be/be_visitor_home/home_svs.cpp index 3d36384758a..2754341ccf4 100644 --- a/TAO/TAO_IDL/be/be_visitor_home/home_svs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_home/home_svs.cpp @@ -242,16 +242,19 @@ be_visitor_home_svs::gen_servant_class (void) << be_uidt_nl << "}"; - os_ << be_nl << be_nl - << "::" << comp_->name () << "_ptr" << be_nl - << lname << "_Servant::find_by_primary_key (" << be_idt_nl - << "::" << pk->name () << " * /* key */)" << be_uidt_nl - << "{" << be_idt_nl - << "throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8," - << be_nl - << " CORBA::COMPLETED_NO);" - << be_uidt_nl - << "}"; + if (!be_global->gen_lwccm ()) + { + os_ << be_nl << be_nl + << "::" << comp_->name () << "_ptr" << be_nl + << lname << "_Servant::find_by_primary_key (" << be_idt_nl + << "::" << pk->name () << " * /* key */)" << be_uidt_nl + << "{" << be_idt_nl + << "throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8," + << be_nl + << " CORBA::COMPLETED_NO);" + << be_uidt_nl + << "}"; + } os_ << be_nl << be_nl << "void" << be_nl @@ -264,16 +267,19 @@ be_visitor_home_svs::gen_servant_class (void) << be_uidt_nl << "}"; - os_ << be_nl << be_nl - << "::" << pk->name () << " *" << be_nl - << lname << "_Servant::get_primary_key (" << be_idt_nl - << "::" << comp_->name () << "_ptr /* comp */)" << be_uidt_nl - << "{" << be_idt_nl - << "throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8," - << be_nl - << " CORBA::COMPLETED_NO);" - << be_uidt_nl - << "}"; + if (!be_global->gen_lwccm ()) + { + os_ << be_nl << be_nl + << "::" << pk->name () << " *" << be_nl + << lname << "_Servant::get_primary_key (" << be_idt_nl + << "::" << comp_->name () << "_ptr /* comp */)" << be_uidt_nl + << "{" << be_idt_nl + << "throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8," + << be_nl + << " CORBA::COMPLETED_NO);" + << be_uidt_nl + << "}"; + } } be_home *h = node_; diff --git a/TAO/TAO_IDL/be_include/be_global.h b/TAO/TAO_IDL/be_include/be_global.h index 4f6d2a2ae33..1813464e4e9 100644 --- a/TAO/TAO_IDL/be_include/be_global.h +++ b/TAO/TAO_IDL/be_include/be_global.h @@ -46,7 +46,7 @@ public: TAO_PERFECT_HASH, TAO_BINARY_SEARCH }; - + /// To help with DDD portability in DDS4CCM /// connectors. enum DDS_IMPL @@ -612,6 +612,12 @@ public: /// Check if we want to generate for Minimum CORBA bool gen_minimum_corba (void) const; + /// Set whether we want to generate for LwCCM + void gen_lwccm (bool); + + /// Check if we want to generate for LwCCM + bool gen_lwccm (void) const; + /// Set optimized typecodes. void opt_tc (bool); @@ -686,7 +692,7 @@ public: /// Return the enumerated value for the lookup strategy. Default is /// perfect hashing. LOOKUP_STRATEGY lookup_strategy (void) const; - + /// Set the DDS implementation. void dds_impl (char const * const val); @@ -792,7 +798,7 @@ public: bool gen_lem_force_all (void) const; void gen_lem_force_all (bool val); - + unsigned long tab_size (void) const; void tab_size (unsigned long val); @@ -993,6 +999,9 @@ private: /// are we generating for Minimum CORBA bool gen_minimum_corba_; + /// are we generating for LwCCM + bool gen_lwccm_; + /// do we generate optimized typecodes? bool opt_tc_; @@ -1130,7 +1139,7 @@ private: /// Toggles generation of exec IDL for facets with imported /// interface types (not in main IDL file). bool gen_lem_force_all_; - + /// 2 spaces by default, can be set from the command line. unsigned int tab_size_; }; diff --git a/TAO/docs/compiler.html b/TAO/docs/compiler.html index 0ac816371f2..7e5e07fbba9 100644 --- a/TAO/docs/compiler.html +++ b/TAO/docs/compiler.html @@ -805,6 +805,13 @@ also receives other options that are specific to it.<p> <td> </td> </tr> + <tr><a name="Gcl"> + <td><tt>-Gcl </tt></td> + + <td>Generated code for LwCCM. This reduces the size of the generated code</td> + <td> </td> + </tr> + <tr><a name="Gsp"> <td><tt>-Gsp </tt></td> |