diff options
author | msmit <msmit@remedy.nl> | 2011-12-06 09:17:20 +0000 |
---|---|---|
committer | msmit <msmit@remedy.nl> | 2011-12-06 09:17:20 +0000 |
commit | 78d67d22cad98713c096c307fe2fae4834133df4 (patch) | |
tree | 88878a1ad01cd908aee75db955791d01ba4f1a46 | |
parent | aaa1b977084ab32a430da45c2fa949316b89503c (diff) | |
download | ATCD-78d67d22cad98713c096c307fe2fae4834133df4.tar.gz |
Tue Dec 6 09:15:52 UTC 2011 Marcel Smit <msmit@remedy.nl>
* TAO_IDL/be/be_codegen.cpp:
* TAO_IDL/be/be_global.cpp:
* TAO_IDL/be/be_produce.cpp:
* TAO_IDL/be/be_visitor_component/component.cpp:
* TAO_IDL/be/be_visitor_module/module.cpp:
* TAO_IDL/be/be_visitor_root/root_ex_svs.cpp:
* TAO_IDL/be_include/be_global.h:
No need to create a new type of svnt file.
* TAO_IDL/be_include/be_codegen.h:
Using pragma ciao lem to determine which files
to include.
-rw-r--r-- | TAO/ChangeLog.BRANCH | 15 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_codegen.cpp | 138 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_global.cpp | 39 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_produce.cpp | 6 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_component/component.cpp | 2 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_module/module.cpp | 2 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_root/root_ex_svs.cpp | 26 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_codegen.h | 9 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_global.h | 13 |
9 files changed, 68 insertions, 182 deletions
diff --git a/TAO/ChangeLog.BRANCH b/TAO/ChangeLog.BRANCH index 563cc38c334..bccff930820 100644 --- a/TAO/ChangeLog.BRANCH +++ b/TAO/ChangeLog.BRANCH @@ -1,3 +1,18 @@ +Tue Dec 6 09:15:52 UTC 2011 Marcel Smit <msmit@remedy.nl> + + * TAO_IDL/be/be_codegen.cpp: + * TAO_IDL/be/be_global.cpp: + * TAO_IDL/be/be_produce.cpp: + * TAO_IDL/be/be_visitor_component/component.cpp: + * TAO_IDL/be/be_visitor_module/module.cpp: + * TAO_IDL/be/be_visitor_root/root_ex_svs.cpp: + * TAO_IDL/be_include/be_global.h: + No need to create a new type of svnt file. + + * TAO_IDL/be_include/be_codegen.h: + Using pragma ciao lem to determine which files + to include. + Mon Dec 5 19:33:12 UTC 2011 Marcel Smit <msmit@remedy.nl> * TAO_IDL/be/be_produce.cpp: diff --git a/TAO/TAO_IDL/be/be_codegen.cpp b/TAO/TAO_IDL/be/be_codegen.cpp index a56bf380792..62cfd64d2df 100644 --- a/TAO/TAO_IDL/be/be_codegen.cpp +++ b/TAO/TAO_IDL/be/be_codegen.cpp @@ -53,7 +53,6 @@ TAO_CodeGen::TAO_CodeGen (void) ciao_exec_header_ (0), ciao_exec_source_ (0), ciao_exec_idl_ (0), - ciao_exec_svnt_ (0), ciao_conn_header_ (0), ciao_conn_source_ (0), ciao_ami_conn_idl_ (0), @@ -517,14 +516,14 @@ TAO_CodeGen::start_server_header (const char *fname) server_hdr); } - if (be_global->gen_ciao_exec_idl()) - { - *this->server_header_ - << be_nl - << "#include \"" - << be_global->be_get_ciao_exec_svnt_fname (true) - << "\""; - } +// if (be_global->gen_ciao_exec_idl()) +// { +// *this->server_header_ +// << be_nl +// << "#include \"" +// << be_global->be_get_ciao_exec_svnt_fname (true) +// << "\""; +// } /// These are generated regardless, so we put it before the /// check below. @@ -1076,7 +1075,37 @@ TAO_CodeGen::start_ciao_svnt_header (const char *fname) // protection, but do optimize based on #pragma once. os << "\n#if !defined (ACE_LACKS_PRAGMA_ONCE)\n" << "# pragma once\n" - << "#endif /* ACE_LACKS_PRAGMA_ONCE */\n"; + << "#endif /* ACE_LACKS_PRAGMA_ONCE */\n" + << be_nl; + + + char **path_tmp = 0; + + for (ACE_Unbounded_Queue_Iterator<char *>riter ( + idl_global->ciao_lem_file_names ()); + riter.done () == 0; + riter.advance ()) + { + riter.next (path_tmp); + + ACE_CString filename (*path_tmp); + // sanity + if (filename.substr (filename.length() - 5) == "E.idl") + { + os << "#include \"" + << filename.substr(0, filename.length() - 5) << "_svnt.h\"" + << be_nl; + } + } + + // Generate the include statement for the template server header. + if (be_global->gen_ciao_svnt ()) + { + os << "#include \"" + << be_global->be_get_ciao_tmpl_svnt_hdr_fname (true) + << "\"" << be_nl; + } + this->gen_svnt_hdr_includes (this->ciao_svnt_header_); @@ -1188,7 +1217,6 @@ TAO_CodeGen::start_ciao_svnt_template_header (const char *fname) << be_global->skel_export_include () << "\"\n"; } - // For base components/connectors. // Some compilers don't optimize the #ifndef header include // protection, but do optimize based on #pragma once. @@ -1411,78 +1439,6 @@ TAO_CodeGen::ciao_exec_idl (void) return this->ciao_exec_idl_; } - -int -TAO_CodeGen::start_ciao_exec_svnt (const char *fname) -{ - // Clean up between multiple files. - delete this->ciao_exec_svnt_; - - ACE_NEW_RETURN (this->ciao_exec_svnt_, - TAO_OutStream, - -1); - int status = - this->ciao_exec_svnt_->open (fname, - TAO_OutStream::CIAO_EXEC_SVNT); - - if (status == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("TAO_CodeGen::start_ciao_exec_svnt - ") - ACE_TEXT ("Error opening file\n")), - -1); - } - - TAO_OutStream &os = *this->ciao_exec_svnt_; - - os << be_nl - << "// TAO_IDL - Generated from" << be_nl - << "// " << __FILE__ << ":" << __LINE__ - << be_nl_2; - - // Generate the #ident string, if any. - this->gen_ident_string (this->ciao_exec_svnt_); - - // Generate the #ifndef clause. - this->gen_ifndef_string (fname, - this->ciao_exec_svnt_, - "CIAO_SESSION_", - "_H_"); - - if (be_global->pre_include () != 0) - { - os << "#include /**/ \"" - << be_global->pre_include () - << "\"\n"; - } - - // Some compilers don't optimize the #ifndef header include - // protection, but do optimize based on #pragma once. - os << "\n#if !defined (ACE_LACKS_PRAGMA_ONCE)\n" - << "# pragma once\n" - << "#endif /* ACE_LACKS_PRAGMA_ONCE */\n"; - - if (be_global->gen_ciao_svnt ()) - { - *this->ciao_exec_svnt_ - << be_nl - << "#include \"" - << be_global->be_get_ciao_tmpl_svnt_hdr_fname (true) - << "\""; - } - - this->gen_svnt_hdr_includes (this->ciao_exec_svnt_); - - return 0; -} - -TAO_OutStream * -TAO_CodeGen::ciao_exec_svnt (void) -{ - return this->ciao_exec_svnt_; -} - - int TAO_CodeGen::start_ciao_conn_header (const char *fname) { @@ -2086,22 +2042,6 @@ TAO_CodeGen::end_ciao_exec_idl (void) } int -TAO_CodeGen::end_ciao_exec_svnt (void) -{ - if (be_global->post_include () != 0) - { - *this->ciao_exec_svnt_ << "\n\n#include /**/ \"" - << be_global->post_include () - << "\""; - } - - *this->ciao_exec_svnt_ << "\n\n#endif /* ifndef */\n"; - - return 0; -} - - -int TAO_CodeGen::end_ciao_conn_header (void) { if (be_global->post_include () != 0) diff --git a/TAO/TAO_IDL/be/be_global.cpp b/TAO/TAO_IDL/be/be_global.cpp index 552923a250f..c2c5669e84f 100644 --- a/TAO/TAO_IDL/be/be_global.cpp +++ b/TAO/TAO_IDL/be/be_global.cpp @@ -82,7 +82,6 @@ BE_GlobalData::BE_GlobalData (void) ciao_exec_src_ending_ (ACE::strnew ("_exec.cpp")), ciao_exec_stub_hdr_ending_ (ACE::strnew ("EC.h")), ciao_exec_idl_ending_ (ACE::strnew ("E.idl")), - ciao_exec_svnt_ending_ (ACE::strnew ("E_svnt.h")), ciao_conn_hdr_ending_ (ACE::strnew ("_conn.h")), ciao_conn_src_ending_ (ACE::strnew ("_conn.cpp")), dds_typesupport_hdr_ending_ (ACE::strnew ("Support.h")), @@ -521,18 +520,6 @@ BE_GlobalData::be_get_ciao_exec_idl ( } const char * -BE_GlobalData::be_get_ciao_exec_svnt ( - UTL_String *idl_file_name, - bool base_name_only) -{ - return - be_change_idl_file_extension ( - idl_file_name, - be_global->ciao_exec_svnt_ending (), - base_name_only); -} - -const char * BE_GlobalData::be_get_ciao_conn_header (UTL_String *idl_file_name, bool base_name_only) { @@ -775,16 +762,6 @@ BE_GlobalData::be_get_ciao_exec_idl_fname ( } const char * -BE_GlobalData::be_get_ciao_exec_svnt_fname ( - bool base_name_only) -{ - return - be_get_ciao_exec_svnt ( - idl_global->stripped_filename (), - base_name_only); -} - -const char * BE_GlobalData::be_get_ciao_conn_hdr_fname ( bool base_name_only) { @@ -1481,19 +1458,6 @@ BE_GlobalData::ciao_exec_idl_ending (void) const } void -BE_GlobalData::ciao_exec_svnt_ending (const char* s) -{ - ACE::strdelete (this->ciao_exec_svnt_ending_); - this->ciao_exec_svnt_ending_ = ACE::strnew (s); -} - -const char* -BE_GlobalData::ciao_exec_svnt_ending (void) const -{ - return this->ciao_exec_svnt_ending_; -} - -void BE_GlobalData::ciao_conn_header_ending (const char* s) { ACE::strdelete (this->ciao_conn_hdr_ending_); @@ -2117,9 +2081,6 @@ BE_GlobalData::destroy (void) ACE::strdelete (this->ciao_exec_idl_ending_); this->ciao_exec_idl_ending_ = 0; - ACE::strdelete (this->ciao_exec_svnt_ending_); - this->ciao_exec_svnt_ending_ = 0; - ACE::strdelete (this->ciao_conn_hdr_ending_); this->ciao_conn_hdr_ending_ = 0; diff --git a/TAO/TAO_IDL/be/be_produce.cpp b/TAO/TAO_IDL/be/be_produce.cpp index 78dda177558..576a9f88a3d 100644 --- a/TAO/TAO_IDL/be/be_produce.cpp +++ b/TAO/TAO_IDL/be/be_produce.cpp @@ -213,7 +213,7 @@ BE_produce (void) BE_visit_root (root_is_visitor, "implementation skeleton"); } - if (be_global->gen_ciao_svnt ()) + if (be_global->gen_ciao_svnt () || be_global->gen_ciao_exec_idl ()) { ctx.state (TAO_CodeGen::TAO_ROOT_SVH); be_visitor_root_svh root_svh_visitor (&ctx); @@ -240,10 +240,6 @@ BE_produce (void) ctx.state (TAO_CodeGen::TAO_ROOT_EX_IDL); be_visitor_root_ex_idl root_ex_idl_visitor (&ctx); BE_visit_root (root_ex_idl_visitor, "CIAO executor IDL"); - - ctx.state (TAO_CodeGen::TAO_ROOT_EX_SVNT); - be_visitor_root_ex_svs root_ex_svs_visitor (&ctx); - BE_visit_root (root_ex_svs_visitor, "CIAO executor servant"); } if (be_global->gen_ciao_exec_impl ()) diff --git a/TAO/TAO_IDL/be/be_visitor_component/component.cpp b/TAO/TAO_IDL/be/be_visitor_component/component.cpp index 483a0ad5628..3e1d2b5ddf2 100644 --- a/TAO/TAO_IDL/be/be_visitor_component/component.cpp +++ b/TAO/TAO_IDL/be/be_visitor_component/component.cpp @@ -124,7 +124,6 @@ be_visitor_component::visit_operation (be_operation *node) case TAO_CodeGen::TAO_ROOT_CNH: case TAO_CodeGen::TAO_ROOT_CNS: case TAO_CodeGen::TAO_ROOT_EX_IDL: - case TAO_CodeGen::TAO_ROOT_EX_SVNT: return 0; // nothing to be done default: { @@ -287,7 +286,6 @@ be_visitor_component::visit_typedef (be_typedef *node) case TAO_CodeGen::TAO_ROOT_CNH: case TAO_CodeGen::TAO_ROOT_CNS: case TAO_CodeGen::TAO_ROOT_EX_IDL: - case TAO_CodeGen::TAO_ROOT_EX_SVNT: return 0; // nothing to be done default: { diff --git a/TAO/TAO_IDL/be/be_visitor_module/module.cpp b/TAO/TAO_IDL/be/be_visitor_module/module.cpp index fe81dda2bb8..8fc9893e5ed 100644 --- a/TAO/TAO_IDL/be/be_visitor_module/module.cpp +++ b/TAO/TAO_IDL/be/be_visitor_module/module.cpp @@ -349,7 +349,6 @@ be_visitor_module::visit_interface (be_interface *node) case TAO_CodeGen::TAO_ROOT_CNS: case TAO_CodeGen::TAO_ROOT_SVTH: case TAO_CodeGen::TAO_ROOT_SVTS: - case TAO_CodeGen::TAO_ROOT_EX_SVNT: { // Nothing to be done for these cases. return 0; @@ -667,7 +666,6 @@ be_visitor_module::visit_component (be_component *node) case TAO_CodeGen::TAO_ROOT_IS: case TAO_CodeGen::TAO_ROOT_CNH: case TAO_CodeGen::TAO_ROOT_CNS: - case TAO_CodeGen::TAO_ROOT_EX_SVNT: break; case TAO_CodeGen::TAO_ROOT_SVTH: { diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_ex_svs.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_ex_svs.cpp index 7d97429df35..833f431d2e7 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root_ex_svs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root_ex_svs.cpp @@ -45,7 +45,7 @@ be_visitor_root_ex_svs::visit_root (be_root *node) -1); } - (void) tao_cg->end_ciao_exec_svnt (); +// (void) tao_cg->end_ciao_exec_svnt (); return 0; } @@ -54,21 +54,21 @@ int be_visitor_root_ex_svs::init (void) { // First open the client-side header file for writing. - int const status = - tao_cg->start_ciao_exec_svnt ( - be_global->be_get_ciao_exec_svnt_fname ()); +// int const status = +// tao_cg->start_ciao_exec_svnt ( +// be_global->be_get_ciao_exec_svnt_fname ()); - if (status == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("be_visitor_root_ex_svs::init - ") - ACE_TEXT ("Error opening CIAO executor ") - ACE_TEXT ("IDL file\n")), - -1); - } +// if (status == -1) +// { +// ACE_ERROR_RETURN ((LM_ERROR, +// ACE_TEXT ("be_visitor_root_ex_svs::init - ") +// ACE_TEXT ("Error opening CIAO executor ") +// ACE_TEXT ("IDL file\n")), +// -1); +// } // Initialize the stream. - this->ctx_->stream (tao_cg->ciao_exec_svnt ()); +// this->ctx_->stream (tao_cg->ciao_exec_svnt ()); return 0; } diff --git a/TAO/TAO_IDL/be_include/be_codegen.h b/TAO/TAO_IDL/be_include/be_codegen.h index f7fd1de825f..4f2f742583c 100644 --- a/TAO/TAO_IDL/be_include/be_codegen.h +++ b/TAO/TAO_IDL/be_include/be_codegen.h @@ -133,7 +133,6 @@ public: TAO_ROOT_CNH, TAO_ROOT_CNS, TAO_ROOT_EX_IDL, - TAO_ROOT_EX_SVNT, TAO_ROOT_ANY_OP_CH, TAO_ROOT_ANY_OP_CS, TAO_ROOT_CDR_OP_CH, @@ -247,7 +246,6 @@ public: int start_ciao_exec_header (const char *fname); int start_ciao_exec_source (const char *fname); int start_ciao_exec_idl (const char *fname); - int start_ciao_exec_svnt (const char *fname); int start_ciao_conn_header (const char *fname); int start_ciao_conn_source (const char *fname); int start_ciao_ami_conn_idl (const char *fname); @@ -293,7 +291,6 @@ public: int end_ciao_exec_header (void); int end_ciao_exec_source (void); int end_ciao_exec_idl (void); - int end_ciao_exec_svnt (void); int end_ciao_conn_header (void); int end_ciao_conn_source (void); int end_ciao_ami_conn_idl (void); @@ -355,9 +352,6 @@ public: /// Get the CIAO executor IDL source stream. TAO_OutStream *ciao_exec_idl (void); - /// Get the CIAO executor svnt source stream. - TAO_OutStream *ciao_exec_svnt (void); - /// Get the CIAO connector impl header stream. TAO_OutStream *ciao_conn_header (void); @@ -503,9 +497,6 @@ private: /// Component executor impl source file. TAO_OutStream *ciao_exec_idl_; - /// Component executor svnt header file. - TAO_OutStream *ciao_exec_svnt_; - /// Component connector impl header file. TAO_OutStream *ciao_conn_header_; diff --git a/TAO/TAO_IDL/be_include/be_global.h b/TAO/TAO_IDL/be_include/be_global.h index 94a570aa85a..ed063f8dd3a 100644 --- a/TAO/TAO_IDL/be_include/be_global.h +++ b/TAO/TAO_IDL/be_include/be_global.h @@ -129,9 +129,6 @@ public: static const char *be_get_ciao_exec_idl_fname ( bool base_name_only = false); - static const char *be_get_ciao_exec_svnt_fname ( - bool base_name_only = false); - static const char *be_get_ciao_conn_hdr_fname ( bool base_name_only = false); @@ -230,10 +227,6 @@ public: UTL_String *idl_file_name, bool base_name_only = false); - static const char *be_get_ciao_exec_svnt ( - UTL_String *idl_file_name, - bool base_name_only = false); - static const char *be_get_ciao_conn_header ( UTL_String *idl_file_name, bool base_name_only = false); @@ -537,9 +530,6 @@ public: void ciao_exec_idl_ending (const char* s); const char* ciao_exec_idl_ending (void) const; - void ciao_exec_svnt_ending (const char* s); - const char* ciao_exec_svnt_ending (void) const; - void ciao_conn_header_ending (const char* s); const char* ciao_conn_header_ending (void) const; @@ -1028,9 +1018,6 @@ private: /// CIAO executor IDL file name ending. Default is "E.idl". char* ciao_exec_idl_ending_; - /// CIAO executor svnt file name ending. Default is "E_svnt.idl". - char* ciao_exec_svnt_ending_; - /// CIAO connector impl header file name ending. Default is "_conn.h". char* ciao_conn_hdr_ending_; |