diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-02-15 22:36:07 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-02-15 22:36:07 +0000 |
commit | f3ee25d3cd65f91c93334a3e8eefb7af860a7e95 (patch) | |
tree | 32a35a6003f813f2599710a91cda516758a7b567 /TAO/TAO_IDL/be | |
parent | 8ddc22d5fb65ea934683571915a7dc61f760f42d (diff) | |
download | ATCD-f3ee25d3cd65f91c93334a3e8eefb7af860a7e95.tar.gz |
ChangeLogTag: Mon Feb 15 22:35:26 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
Diffstat (limited to 'TAO/TAO_IDL/be')
28 files changed, 389 insertions, 123 deletions
diff --git a/TAO/TAO_IDL/be/be_codegen.cpp b/TAO/TAO_IDL/be/be_codegen.cpp index c28db33f311..b0c8c460fcd 100644 --- a/TAO/TAO_IDL/be/be_codegen.cpp +++ b/TAO/TAO_IDL/be/be_codegen.cpp @@ -3234,7 +3234,7 @@ TAO_CodeGen::gen_exec_hdr_includes (void) void TAO_CodeGen::gen_exec_src_includes (void) { - // Generate the include statement for the exec header. + // Generate the include statement for the exec source. this->gen_standard_include ( this->ciao_exec_source_, be_global->be_get_ciao_exec_hdr_fname (true)); @@ -3361,6 +3361,10 @@ TAO_CodeGen::gen_conn_hdr_includes (void) void TAO_CodeGen::gen_conn_src_includes (void) { + // Generate the include statement for the connector exec source. + this->gen_standard_include ( + this->ciao_conn_source_, + be_global->be_get_ciao_conn_hdr_fname (true)); } void @@ -3382,6 +3386,8 @@ TAO_CodeGen::destroy (void) delete this->ciao_svnt_source_; delete this->ciao_exec_header_; delete this->ciao_exec_source_; + delete this->ciao_conn_header_; + delete this->ciao_conn_source_; delete this->ciao_exec_idl_; delete this->gperf_input_stream_; delete [] this->gperf_input_filename_; diff --git a/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp b/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp index 34e733552d0..f22ed7b5e6f 100644 --- a/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp +++ b/TAO/TAO_IDL/be/be_visitor_arg_traits.cpp @@ -20,7 +20,7 @@ #include "be_interface_fwd.h" #include "be_valuetype_fwd.h" #include "be_component_fwd.h" -#include "be_component.h" +#include "be_connector.h" #include "be_home.h" #include "be_eventtype.h" #include "be_eventtype_fwd.h" @@ -1154,6 +1154,12 @@ be_visitor_arg_traits::visit_component_fwd (be_component_fwd *node) } int +be_visitor_arg_traits::visit_connector (be_connector *node) +{ + return this->visit_component (node); +} + +int be_visitor_arg_traits::visit_home (be_home *node) { return this->visit_interface (node); 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 a1483d44e5c..4ec7df0e816 100644 --- a/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp +++ b/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp @@ -22,7 +22,7 @@ #include "be_template_module_inst.h" #include "be_field.h" #include "be_typedef.h" -#include "be_component.h" +#include "be_connector.h" #include "be_provides.h" #include "be_uses.h" #include "be_publishes.h" @@ -160,6 +160,12 @@ be_visitor_ccm_pre_proc::visit_component (be_component *node) } int +be_visitor_ccm_pre_proc::visit_connector (be_connector *node) +{ + return this->visit_component (node); +} + +int be_visitor_ccm_pre_proc::visit_provides (be_provides *node) { if (node->provides_type ()->is_local ()) diff --git a/TAO/TAO_IDL/be/be_visitor_component.cpp b/TAO/TAO_IDL/be/be_visitor_component.cpp index 360ebaab5fc..c93784fb454 100644 --- a/TAO/TAO_IDL/be/be_visitor_component.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component.cpp @@ -23,7 +23,7 @@ #include "ast_argument.h" #include "ast_exception.h" -#include "be_component.h" +#include "be_connector.h" #include "be_provides.h" #include "be_uses.h" #include "be_publishes.h" @@ -61,8 +61,6 @@ #include "be_visitor_component/component_sh.cpp" #include "be_visitor_component/component_si.cpp" #include "be_visitor_component/component_ss.cpp" -#include "be_visitor_component/component_ih.cpp" -#include "be_visitor_component/component_is.cpp" #include "be_visitor_component/component_svh.cpp" #include "be_visitor_component/facet_svh.cpp" #include "be_visitor_component/context_svh.cpp" diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_ch.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_ch.cpp index 08eaaab3421..689c5403f50 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/component_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/component_ch.cpp @@ -12,7 +12,6 @@ */ //============================================================================= - // ****************************************************** // Component visitor for client header // ****************************************************** @@ -261,3 +260,10 @@ be_visitor_component_ch::visit_component (be_component *node) node->cli_hdr_gen (true); return 0; } + +int +be_visitor_component_ch::visit_connector (be_connector *node) +{ + return this->visit_component (node); +} + diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_ci.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_ci.cpp index 9e90781e9e9..5d48b7d2747 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/component_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/component_ci.cpp @@ -12,7 +12,6 @@ */ //============================================================================= - // ****************************************************** // Component visitor for client inline // ****************************************************** @@ -57,3 +56,10 @@ be_visitor_component_ci::visit_component (be_component *node) node->cli_inline_gen (true); return 0; } + +int +be_visitor_component_ci::visit_connector (be_connector *node) +{ + return this->visit_component (node); +} + diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_cs.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_cs.cpp index 951023133c2..ef17e36e34c 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/component_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/component_cs.cpp @@ -12,7 +12,6 @@ */ //============================================================================= - // ****************************************************** // Component visitor for client stub // ****************************************************** @@ -336,3 +335,10 @@ be_visitor_component_cs::visit_component (be_component *node) return 0; } + +int +be_visitor_component_cs::visit_connector (be_connector *node) +{ + return this->visit_component (node); +} + diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_ex_idl.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_ex_idl.cpp index 44bf451f62f..61b5dc4f35e 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/component_ex_idl.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/component_ex_idl.cpp @@ -12,7 +12,6 @@ */ //============================================================================= - be_visitor_component_ex_idl::be_visitor_component_ex_idl ( be_visitor_context *ctx) : be_visitor_decl (ctx), @@ -104,3 +103,9 @@ be_visitor_component_ex_idl::visit_component ( return 0; } +int +be_visitor_component_ex_idl::visit_connector (be_connector *node) +{ + return this->visit_component (node); +} + diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_ih.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_ih.cpp deleted file mode 100644 index 09ee75d56bd..00000000000 --- a/TAO/TAO_IDL/be/be_visitor_component/component_ih.cpp +++ /dev/null @@ -1,35 +0,0 @@ - -//============================================================================= -/** - * @file component_ih.cpp - * - * $Id$ - * - * Visitor generating code for Interfaces in the implementation header - * - * - * @author Jeff Parsons - */ -//============================================================================= - - -// ************************************************************ -// Interface visitor for implementation header. -// ************************************************************ - -be_visitor_component_ih::be_visitor_component_ih (be_visitor_context *ctx) - : be_visitor_component (ctx) -{ -} - -be_visitor_component_ih::~be_visitor_component_ih (void) -{ -} - -int -be_visitor_component_ih::visit_component (be_component *node) -{ - be_visitor_context ctx (*this->ctx_); - be_visitor_interface_ih visitor (&ctx); - return visitor.visit_interface (node); -} diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_is.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_is.cpp deleted file mode 100644 index 34d30676055..00000000000 --- a/TAO/TAO_IDL/be/be_visitor_component/component_is.cpp +++ /dev/null @@ -1,36 +0,0 @@ - -//============================================================================= -/** - * @file component_is.cpp - * - * $Id$ - * - * Visitor generating code for Components - * in the implementation skeletons file. - * - * - * @author Jeff Parsons - */ -//============================================================================= - - -// ************************************************************ -// Component visitor for implementation skeletons. -// ************************************************************ - -be_visitor_component_is::be_visitor_component_is (be_visitor_context *ctx) - : be_visitor_component (ctx) -{ -} - -be_visitor_component_is::~be_visitor_component_is (void) -{ -} - -int -be_visitor_component_is::visit_component (be_component *node) -{ - be_visitor_context ctx (*this->ctx_); - be_visitor_interface_is visitor (&ctx); - return visitor.visit_interface (node); -} diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_sh.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_sh.cpp index 9a3d55fcbdb..18dedb9d02e 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/component_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/component_sh.cpp @@ -12,7 +12,6 @@ */ //============================================================================= - // ****************************************************** // Component visitor for server header // ****************************************************** @@ -295,6 +294,12 @@ be_visitor_component_sh::visit_component (be_component *node) } int +be_visitor_component_sh::visit_connector (be_connector *node) +{ + return this->visit_component (node); +} + +int be_visitor_component_sh::generate_amh_classes (be_component *node) { if (be_global->gen_amh_classes ()) diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_si.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_si.cpp index 91ea6d3e3cb..f483e95ad4a 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/component_si.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/component_si.cpp @@ -12,7 +12,6 @@ */ //============================================================================= - // ****************************************************** // Component visitor for server inline // ****************************************************** @@ -33,3 +32,10 @@ be_visitor_component_si::visit_component (be_component *node) be_visitor_interface_si visitor (&ctx); return visitor.visit_interface (node); } + +int +be_visitor_component_si::visit_connector (be_connector *node) +{ + return this->visit_component (node); +} + diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_ss.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_ss.cpp index 045eb40d25a..630ce78c0f7 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/component_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/component_ss.cpp @@ -12,7 +12,6 @@ */ //============================================================================= - // ****************************************************** // Component visitor for server skeleton // ****************************************************** @@ -33,3 +32,10 @@ be_visitor_component_ss::visit_component (be_component *node) be_visitor_interface_ss visitor (&ctx); return visitor.visit_interface (node); } + +int +be_visitor_component_ss::visit_connector (be_connector *node) +{ + return this->visit_component (node); +} + diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_svh.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_svh.cpp index 29df7a6e89b..508f9aacfa4 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/component_svh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/component_svh.cpp @@ -12,7 +12,6 @@ */ //============================================================================= - // ****************************************************** // Component visitor for server header // ****************************************************** @@ -90,6 +89,12 @@ be_visitor_component_svh::visit_component (be_component *node) return 0; } +int +be_visitor_component_svh::visit_connector (be_connector *node) +{ + return this->visit_component (node); +} + void be_visitor_component_svh::gen_entrypoint (be_component *node) { diff --git a/TAO/TAO_IDL/be/be_visitor_component/component_svs.cpp b/TAO/TAO_IDL/be/be_visitor_component/component_svs.cpp index 7bea13eb0a2..7e7e4af1742 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/component_svs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/component_svs.cpp @@ -12,7 +12,6 @@ */ //============================================================================= - // ****************************************************** // Component visitor for servant source // ****************************************************** @@ -87,6 +86,12 @@ be_visitor_component_svs::visit_component (be_component *node) return 0; } +int +be_visitor_component_svs::visit_connector (be_connector *node) +{ + return this->visit_component (node); +} + void be_visitor_component_svs::gen_entrypoint (AST_Component *node) { diff --git a/TAO/TAO_IDL/be/be_visitor_component/context_ex_idl.cpp b/TAO/TAO_IDL/be/be_visitor_component/context_ex_idl.cpp index d43e1a5a4ea..909703f641c 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/context_ex_idl.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/context_ex_idl.cpp @@ -13,7 +13,6 @@ */ //============================================================================= - be_visitor_context_ex_idl::be_visitor_context_ex_idl ( be_visitor_context *ctx) : be_visitor_component_scope (ctx) @@ -26,8 +25,7 @@ be_visitor_context_ex_idl::~be_visitor_context_ex_idl ( } int -be_visitor_context_ex_idl::visit_component ( - be_component *node) +be_visitor_context_ex_idl::visit_component (be_component *node) { node_ = node; @@ -80,8 +78,13 @@ be_visitor_context_ex_idl::visit_component ( } int -be_visitor_context_ex_idl::visit_uses ( - be_uses *node) +be_visitor_context_ex_idl::visit_connector (be_connector *node) +{ + return this->visit_component (node); +} + +int +be_visitor_context_ex_idl::visit_uses (be_uses *node) { be_type *impl = node->uses_type (); @@ -135,8 +138,7 @@ be_visitor_context_ex_idl::visit_uses ( } int -be_visitor_context_ex_idl::visit_publishes ( - be_publishes *node) +be_visitor_context_ex_idl::visit_publishes (be_publishes *node) { be_eventtype *impl = node->publishes_type (); @@ -150,8 +152,7 @@ be_visitor_context_ex_idl::visit_publishes ( } int -be_visitor_context_ex_idl::visit_emits ( - be_emits *node) +be_visitor_context_ex_idl::visit_emits (be_emits *node) { be_eventtype *impl = node->emits_type (); diff --git a/TAO/TAO_IDL/be/be_visitor_component/context_svh.cpp b/TAO/TAO_IDL/be/be_visitor_component/context_svh.cpp index 559fe265543..1db7211e6af 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/context_svh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/context_svh.cpp @@ -13,7 +13,6 @@ */ //============================================================================= - be_visitor_context_svh::be_visitor_context_svh (be_visitor_context *ctx) : be_visitor_component_scope (ctx) { @@ -105,6 +104,12 @@ be_visitor_context_svh::visit_component (be_component *node) } int +be_visitor_context_svh::visit_connector (be_connector *node) +{ + return this->visit_component (node); +} + +int be_visitor_context_svh::visit_uses (be_uses *node) { ACE_CString prefix (this->port_prefix_); diff --git a/TAO/TAO_IDL/be/be_visitor_component/context_svs.cpp b/TAO/TAO_IDL/be/be_visitor_component/context_svs.cpp index 6dda161e1bb..bb710f2305e 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/context_svs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/context_svs.cpp @@ -13,7 +13,6 @@ */ //============================================================================= - be_visitor_context_svs::be_visitor_context_svs (be_visitor_context *ctx) : be_visitor_component_scope (ctx) { @@ -82,6 +81,12 @@ be_visitor_context_svs::visit_component (be_component *node) } int +be_visitor_context_svs::visit_connector (be_connector *node) +{ + return this->visit_component (node); +} + +int be_visitor_context_svs::visit_uses (be_uses *node) { ACE_CString prefix (this->port_prefix_); diff --git a/TAO/TAO_IDL/be/be_visitor_component/executor_ex_idl.cpp b/TAO/TAO_IDL/be/be_visitor_component/executor_ex_idl.cpp index bf3444c36db..631fbff5dd6 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/executor_ex_idl.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/executor_ex_idl.cpp @@ -13,7 +13,6 @@ */ //============================================================================= - be_visitor_executor_ex_idl::be_visitor_executor_ex_idl ( be_visitor_context *ctx) : be_visitor_component_scope (ctx) @@ -77,8 +76,13 @@ be_visitor_executor_ex_idl::visit_component ( } int -be_visitor_executor_ex_idl::visit_attribute ( - be_attribute *node) +be_visitor_executor_ex_idl::visit_connector (be_connector *node) +{ + return this->visit_component (node); +} + +int +be_visitor_executor_ex_idl::visit_attribute (be_attribute *node) { bool rd_only = node->readonly (); diff --git a/TAO/TAO_IDL/be/be_visitor_component/facet_svs.cpp b/TAO/TAO_IDL/be/be_visitor_component/facet_svs.cpp index 387b741ca81..cc7b2d59dc2 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/facet_svs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/facet_svs.cpp @@ -13,7 +13,6 @@ */ //============================================================================= - be_visitor_facet_svs::be_visitor_facet_svs (be_visitor_context *ctx) : be_visitor_component_scope (ctx) { 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 3edd249dd98..72672551abc 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/servant_svh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/servant_svh.cpp @@ -13,7 +13,6 @@ */ //============================================================================= - be_visitor_servant_svh::be_visitor_servant_svh (be_visitor_context *ctx) : be_visitor_component_scope (ctx) { @@ -111,6 +110,12 @@ be_visitor_servant_svh::visit_component (be_component *node) } int +be_visitor_servant_svh::visit_connector (be_connector *node) +{ + return this->visit_component (node); +} + +int be_visitor_servant_svh::visit_attribute (be_attribute *node) { be_visitor_attribute v (this->ctx_); 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 d0176e67324..d2b7c6d83c5 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/servant_svs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/servant_svs.cpp @@ -13,7 +13,6 @@ */ //============================================================================= - be_visitor_servant_svs::be_visitor_servant_svs (be_visitor_context *ctx) : be_visitor_component_scope (ctx), op_scope_ (0), @@ -203,6 +202,12 @@ be_visitor_servant_svs::visit_component (be_component *node) } int +be_visitor_servant_svs::visit_connector (be_connector *node) +{ + return this->visit_component (node); +} + +int be_visitor_servant_svs::visit_operation (be_operation *node) { AST_Decl::NodeType nt = diff --git a/TAO/TAO_IDL/be/be_visitor_connector.cpp b/TAO/TAO_IDL/be/be_visitor_connector.cpp index 16001d898cb..fb139f785ed 100644 --- a/TAO/TAO_IDL/be/be_visitor_connector.cpp +++ b/TAO/TAO_IDL/be/be_visitor_connector.cpp @@ -12,11 +12,15 @@ */ //============================================================================= +#include "ast_template_module_inst.h" + +#include "nr_extern.h" #include "be_connector.h" #include "be_visitor_connector.h" #include "be_visitor_context.h" +#include "be_visitor_connector/connector_dds_ex_base.cpp" #include "be_visitor_connector/connector_dds_exh.cpp" #include "be_visitor_connector/connector_dds_exs.cpp" diff --git a/TAO/TAO_IDL/be/be_visitor_connector/connector_dds_ex_base.cpp b/TAO/TAO_IDL/be/be_visitor_connector/connector_dds_ex_base.cpp new file mode 100644 index 00000000000..43be3749f18 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_connector/connector_dds_ex_base.cpp @@ -0,0 +1,74 @@ + +//============================================================================= +/** + * @file connector_dds_ex_base.cpp + * + * $Id$ + * + * Base class for visitors generating code for DDS Connectors in + * the exec impl. + * + * + * @author Jeff Parsons + */ +//============================================================================= + + +be_visitor_connector_dds_ex_base::be_visitor_connector_dds_ex_base ( + be_visitor_context *ctx) + : be_visitor_component_scope (ctx), + t_inst_ (0), + t_args_ (0) +{ +} + +be_visitor_connector_dds_ex_base::~be_visitor_connector_dds_ex_base (void) +{ +} + +void +be_visitor_connector_dds_ex_base::process_template_args ( + AST_Connector *base) +{ + AST_Decl *d = + node_->defined_in ()->lookup_by_name ( + ScopeAsDecl (base->defined_in ())->name (), + true); + + // The template module instantiation and the corresponding + // implied IDL module have the same name, but the instantiation + // comes first in the scope list, so that is what the scope + // iteration will find first. + this->t_inst_ = + AST_Template_Module_Inst::narrow_from_decl (d); + + if (this->t_inst_ == 0) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("be_visitor_connector_dds_ex_base::") + ACE_TEXT ("process_template_args - ") + ACE_TEXT ("template instance not found\n "))); + + return; + } + + this->t_args_ = this->t_inst_->template_args (); + + // We depend on the DDS datatype being the first template + // argument for now, this may change. + AST_Decl **datatype = 0; + int status = this->t_args_->get (datatype, 0UL); + + if (status != 0) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("be_visitor_connector_dds_ex_base::") + ACE_TEXT ("process_template_args - ") + ACE_TEXT ("template arg not found\n "))); + + return; + } + + this->dds_traits_name_ = (*datatype)->flat_name (); + this->dds_traits_name_ += "_DDS_Traits"; +}
\ No newline at end of file diff --git a/TAO/TAO_IDL/be/be_visitor_connector/connector_dds_exh.cpp b/TAO/TAO_IDL/be/be_visitor_connector/connector_dds_exh.cpp index 10e112e36f2..3b455bdcad3 100644 --- a/TAO/TAO_IDL/be/be_visitor_connector/connector_dds_exh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_connector/connector_dds_exh.cpp @@ -15,7 +15,7 @@ be_visitor_connector_dds_exh::be_visitor_connector_dds_exh ( be_visitor_context *ctx) - : be_visitor_component_scope (ctx) + : be_visitor_connector_dds_ex_base (ctx) { // This is initialized in the base class to svnt_export_macro() // or skel_export_macro(), since there are many more visitor @@ -31,6 +31,21 @@ be_visitor_connector_dds_exh::~be_visitor_connector_dds_exh (void) int be_visitor_connector_dds_exh::visit_connector (be_connector *node) { + if (node->imported ()) + { + return 0; + } + + AST_Connector *base = node->base_connector (); + + // Hack for the time being to skip codegen for DDS_State + // and DDS_Event, both of which come along with the template + // module instantiation. + if (base == 0) + { + return 0; + } + node_ = node; /// CIDL-generated namespace used 'CIDL_' + composition name. @@ -40,7 +55,43 @@ be_visitor_connector_dds_exh::visit_connector (be_connector *node) << "_Impl" << be_nl << "{" << be_idt; - // TODO - template class declaration. + this->gen_dds_traits (base); + this->gen_connector_traits (); + + os_ << be_nl << be_nl + << "class " << this->export_macro_.c_str () + << this->node_->local_name () << "_exec_i" << be_idt_nl + << ": public "; + + // Placeholder for forthcoming real-world logic. + bool dds_event_connector = true; + + if (dds_event_connector) + { + os_ << "DDS_Event_Connector_T"; + } + + os_ << " <" << be_idt << be_idt_nl + << this->dds_traits_name_.c_str () << "," << be_nl + << "DDS" << this->node_->local_name () + << "_Traits>" << be_uidt << be_uidt << be_uidt_nl + << "{" << be_nl + << "public:" << be_idt_nl + << this->node_->local_name () << "_exec_i (void);" << be_nl + << "virtual ~" << this->node_->local_name () + << "_exec_i (void);"; + + if (this->visit_scope (node) != 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("be_visitor_connector_dds_exh::") + ACE_TEXT ("visit_connector - ") + ACE_TEXT ("visit_scope() failed\n ")), + -1); + } + + os_ << be_uidt_nl + << "};"; this->gen_exec_entrypoint_decl (); @@ -50,3 +101,85 @@ be_visitor_connector_dds_exh::visit_connector (be_connector *node) return 0; } +void +be_visitor_connector_dds_exh::gen_dds_traits ( + AST_Connector *base) +{ + this->process_template_args (base); + + // We depend on the DDS datatype being the first template + // argument for now, this may change. + AST_Decl **datatype = 0; + int status = this->t_args_->get (datatype, 0UL); + + if (status != 0) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("be_visitor_connector_dds_exh::") + ACE_TEXT ("gen_dds_traits - ") + ACE_TEXT ("template arg not found\n "))); + + return; + } + + UTL_ScopedName *dt_name = (*datatype)->name (); + + // More generic logic TBI. + bool rti_dds_connector = true; + + if (rti_dds_connector) + { + os_ << be_nl + << "typedef CIAO::DDS4CCM::RTI::Type_Traits <" + << be_idt_nl + << "::" << dt_name << "," << be_nl + << "::" << dt_name << "Seq," << be_nl + << "::" << dt_name << "TypeSupport," << be_nl + << "::" << dt_name << "DataWriter," << be_nl + << "::" << dt_name << "DataReader> " + << this->dds_traits_name_.c_str () << ";" << be_uidt; + } +} + +void +be_visitor_connector_dds_exh::gen_connector_traits (void) +{ + AST_Decl **item = 0; + int status = this->t_args_->get (item, 1UL); + + if (status != 0) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("be_visitor_connector_dds_exh::") + ACE_TEXT ("gen_connector_traits - ") + ACE_TEXT ("template arg not found\n "))); + + return; + } + + os_ << be_nl << be_nl + << "typedef ::CIAO::DDS4CCM::Connector_Traits <" + << be_idt_nl + << "::CIAO_" << this->node_->flat_name () << "_Impl::" + << this->node_->local_name () << "_Exec," << be_nl + << "::" << (*item)->name () << "," << be_nl + << "::" << this->t_inst_->name () + << "::CCM_Writer," << be_nl + << "::" << this->t_inst_->name () + << "::CCM_Updater," << be_nl + << "::" << this->t_inst_->name () + << "::CCM_Getter," << be_nl + << "::" << this->t_inst_->name () + << "::CCM_Reader," << be_nl + << "::" << ScopeAsDecl (this->t_inst_->defined_in ())->name () + << "::CCM_" << this->node_->local_name () + << "_Context," << be_nl + << "::" << this->t_inst_->name () + << "::Listener," << be_nl + << "::" << this->t_inst_->name () + << "::StateListener," << be_nl + << "::CCM_DDS::ConnectorStatusListener> DDS" + << this->node_->local_name () << "_Traits;"; +} + + diff --git a/TAO/TAO_IDL/be/be_visitor_connector/connector_dds_exs.cpp b/TAO/TAO_IDL/be/be_visitor_connector/connector_dds_exs.cpp index 89b7e058237..2c5c8d53c2d 100644 --- a/TAO/TAO_IDL/be/be_visitor_connector/connector_dds_exs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_connector/connector_dds_exs.cpp @@ -15,13 +15,8 @@ be_visitor_connector_dds_exs::be_visitor_connector_dds_exs ( be_visitor_context *ctx) - : be_visitor_component_scope (ctx) + : be_visitor_connector_dds_ex_base (ctx) { - // This is initialized in the base class to svnt_export_macro() - // or skel_export_macro(), since there are many more visitor - // classes generating servant code. So we can just override - // all that here. - export_macro_ = be_global->exec_export_macro (); } be_visitor_connector_dds_exs::~be_visitor_connector_dds_exs (void) @@ -31,8 +26,26 @@ be_visitor_connector_dds_exs::~be_visitor_connector_dds_exs (void) int be_visitor_connector_dds_exs::visit_connector (be_connector *node) { + if (node->imported ()) + { + return 0; + } + + AST_Connector *base = node->base_connector (); + + // Hack for the time being to skip codegen for DDS_State + // and DDS_Event, both of which come along with the template + // module instantiation. + if (base == 0) + { + return 0; + } + node_ = node; + // Stores several values in base class members for later use. + this->process_template_args (base); + /// CIDL-generated namespace used 'CIDL_' + composition name. /// Now we use 'CIAO_' + component's flat name. os_ << be_nl << be_nl @@ -40,8 +53,33 @@ be_visitor_connector_dds_exs::visit_connector (be_connector *node) << "_Impl" << be_nl << "{" << be_idt; - // TODO - template class constructor and destructor. + os_ << be_nl + << this->node_->local_name () << "_exec_i::" + << this->node_->local_name () << "_exec_i (void)" + << be_idt_nl + << ": "; + + // Placeholder for forthcoming real-world logic. + bool dds_event_connector = true; + + if (dds_event_connector) + { + os_ << "DDS_Event_Connector_T"; + } + + os_ << " <" << be_idt << be_idt_nl + << this->dds_traits_name_.c_str () << "," << be_nl + << this->node_->local_name () << "_Traits> ()" + << be_uidt << be_uidt << be_uidt_nl + << "{" << be_nl + << "}"; + os_ << be_nl << be_nl + << this->node_->local_name () << "_exec_i::~" + << this->node_->local_name () << "_exec_i (void)" << be_nl + << "{" << be_nl + << "}"; + this->gen_exec_entrypoint_defn (); os_ << be_uidt_nl diff --git a/TAO/TAO_IDL/be/be_visitor_module/module.cpp b/TAO/TAO_IDL/be/be_visitor_module/module.cpp index 0006970a970..70077480c96 100644 --- a/TAO/TAO_IDL/be/be_visitor_module/module.cpp +++ b/TAO/TAO_IDL/be/be_visitor_module/module.cpp @@ -822,18 +822,10 @@ be_visitor_module::visit_component (be_component *node) status = node->accept (&visitor); break; } + // Nothing for these with components, they have the executor. case TAO_CodeGen::TAO_ROOT_IH: - { - be_visitor_component_ih visitor (&ctx); - status = node->accept (&visitor); - break; - } case TAO_CodeGen::TAO_ROOT_IS: - { - be_visitor_component_is visitor (&ctx); - status = node->accept (&visitor); - break; - } + break; case TAO_CodeGen::TAO_ROOT_SVH: { be_visitor_component_svh visitor (&ctx); diff --git a/TAO/TAO_IDL/be/be_visitor_traits.cpp b/TAO/TAO_IDL/be/be_visitor_traits.cpp index 0f01cd8bbe8..dde1a3d5048 100644 --- a/TAO/TAO_IDL/be/be_visitor_traits.cpp +++ b/TAO/TAO_IDL/be/be_visitor_traits.cpp @@ -24,7 +24,7 @@ #include "be_valuetype_fwd.h" #include "be_eventtype.h" #include "be_eventtype_fwd.h" -#include "be_component.h" +#include "be_connector.h" #include "be_component_fwd.h" #include "be_field.h" #include "be_union_branch.h" @@ -285,6 +285,12 @@ be_visitor_traits::visit_component (be_component *node) } int +be_visitor_traits::visit_connector (be_connector *node) +{ + return this->visit_component (node); +} + +int be_visitor_traits::visit_component_fwd (be_component_fwd *node) { return this->visit_interface_fwd (node); |