diff options
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp')
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp | 182 |
1 files changed, 4 insertions, 178 deletions
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 826b7082b6e..666e3e0b896 100644 --- a/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp +++ b/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp @@ -58,8 +58,6 @@ be_exception *EXCEPS[N_EXCEPS]; be_visitor_ccm_pre_proc::be_visitor_ccm_pre_proc (be_visitor_context *ctx) : be_visitor_scope (ctx), module_id_ ("Components"), - connection_ (0), - connections_ (0), cookie_ (0), already_connected_ (0), invalid_connection_ (0), @@ -358,15 +356,6 @@ be_visitor_ccm_pre_proc::gen_uses (be_component *node) } else { - if (this->create_uses_multiple_stuff (node, pd) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_ccm_pre_proc::" - "gen_uses - " - "create_uses_multiple_stuff failed\n"), - -1); - } - if (this->gen_connect_multiple (node, pd) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -1466,152 +1455,6 @@ be_visitor_ccm_pre_proc::lookup_one_exception (be_component *node, } int -be_visitor_ccm_pre_proc::create_uses_multiple_stuff ( - be_component *node, - AST_Component::port_description *pd - ) -{ - if (this->create_uses_multiple_struct (node, pd) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_ccm_pre_proc::" - "create_uses_multiple_stuff - " - "create_uses_multiple_struct failed\n"), - -1); - } - - if (this->create_uses_multiple_sequence (node, pd) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_ccm_pre_proc::" - "create_uses_multiple_stuff - " - "create_uses_multiple_sequence failed\n"), - -1); - } - - return 0; -} - -int -be_visitor_ccm_pre_proc::create_uses_multiple_struct ( - be_component *node, - AST_Component::port_description *pd - ) -{ - UTL_ScopedName *full_name = - this->create_scoped_name (0, - pd->id->get_string (), - "Connection", - node); - ACE_NEW_RETURN (this->connection_, - be_structure (0, - 0, - 0), - -1); - this->connection_->set_defined_in (node); - this->connection_->set_imported (node->imported ()); - this->connection_->set_name (full_name); - - Identifier o_id ("objref"); - UTL_ScopedName o_sn (&o_id, - 0); - AST_Field *m_objref = 0; - ACE_NEW_RETURN (m_objref, - be_field (pd->impl, - &o_sn), - -1); - o_id.destroy (); - - if (this->connection_->be_add_field (m_objref) == 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_ccm_pre_proc::" - "create_uses_multiple_struct - " - "be_add_field failed\n"), - -1); - } - - Identifier v_id ("ck"); - UTL_ScopedName v_sn (&v_id, - 0); - AST_Field *m_ck = 0; - ACE_NEW_RETURN (m_ck, - be_field (this->cookie_, - &v_sn), - -1); - - if (this->connection_->be_add_field (m_ck) == 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_ccm_pre_proc::" - "create_uses_multiple_struct - " - "be_add_field failed\n"), - -1); - } - - if (node->be_add_structure (this->connection_) == 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_ccm_pre_proc::" - "create_uses_multiple_struct - " - "be_add_structure failed\n"), - -1); - } - - return 0; -} - -int -be_visitor_ccm_pre_proc::create_uses_multiple_sequence ( - be_component *node, - AST_Component::port_description *pd - ) -{ - ACE_UINT64 bound = 0; - ACE_NEW_RETURN ( - this->connections_, - be_sequence ( - idl_global->gen ()->create_expr ( - bound, - AST_Expression::EV_ulong - ), - this->connection_, - 0, - 0, - 0 - ), - -1 - ); - - UTL_ScopedName *sn = - this->create_scoped_name (0, - pd->id->get_string (), - "Connections", - node); - AST_Typedef *td = 0; - ACE_NEW_RETURN (td, - be_typedef (this->connections_, - 0, - 0, - 0), - -1); - td->set_defined_in (node); - td->set_imported (node->imported ()); - td->set_name (sn); - - if (node->be_add_typedef (td) == 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_ccm_pre_proc::" - "create_uses_multiple_sequence - " - "be_add_typedef failed\n"), - -1); - } - - return 0; -} - -int be_visitor_ccm_pre_proc::create_event_consumer (be_eventtype *node) { AST_Interface *event_consumer = 0; @@ -1624,11 +1467,6 @@ be_visitor_ccm_pre_proc::create_event_consumer (be_eventtype *node) "Consumer", ScopeAsDecl (node->defined_in ())); - // We're at global scope here so we need to fool the scope stack - // for a minute so the correct repo id can be calculated at - // interface construction time. - idl_global->scopes ().push (node->defined_in ()); - if (node->n_inherits () == 0 || node->inherits ()[0]->node_type () == AST_Decl::NT_valuetype) { @@ -1639,13 +1477,13 @@ be_visitor_ccm_pre_proc::create_event_consumer (be_eventtype *node) &parent_local_name); UTL_NameList parent_list (&parent_full_name, 0); - FE_InterfaceHeader header (consumer_name, + FE_InterfaceHeader header (0, &parent_list, I_FALSE, I_FALSE, I_TRUE); ACE_NEW_RETURN (event_consumer, - be_interface (header.name (), + be_interface (0, header.inherits (), header.n_inherits (), header.inherits_flat (), @@ -1676,13 +1514,13 @@ be_visitor_ccm_pre_proc::create_event_consumer (be_eventtype *node) parent_full_name->nconc (parent_local_name); UTL_NameList parent_list (parent_full_name, 0); - FE_InterfaceHeader header (consumer_name, + FE_InterfaceHeader header (0, &parent_list, I_FALSE, I_FALSE, I_TRUE); ACE_NEW_RETURN (event_consumer, - be_interface (header.name (), + be_interface (0, header.inherits (), header.n_inherits (), header.inherits_flat (), @@ -1693,21 +1531,9 @@ be_visitor_ccm_pre_proc::create_event_consumer (be_eventtype *node) parent_full_name->destroy (); } - // Back to reality. - idl_global->scopes ().pop (); - event_consumer->set_defined_in (s); event_consumer->set_imported (node->imported ()); event_consumer->set_name (consumer_name); - - // Set repo id to 0, so it will be recomputed on the next access, - // and set the prefix to the eventtype's prefix. All this is - // necessary in case the eventtype's prefix was modified after - // its declaration. We assume 'implied IDL' means that the - // derived event consumer interface should have the same prefix. - event_consumer->repoID (0); - event_consumer->prefix (const_cast<char*> (node->prefix ())); - be_type::narrow_from_decl (event_consumer)->gen_fwd_helper_name (); m->be_add_interface (event_consumer); return this->gen_push_op (node, |