diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-02-19 01:04:51 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-02-19 01:04:51 +0000 |
commit | d0c5a3d81b44fbfeda73a8fb4e3e19fd0343539f (patch) | |
tree | aafa16e07deb1fcb7875742cfe5dcbaf543a0fae | |
parent | c8f42bb2f382b6f77cc7d6a65dc9414d19c46d97 (diff) | |
download | ATCD-d0c5a3d81b44fbfeda73a8fb4e3e19fd0343539f.tar.gz |
Option to suppress generation of tie classes and files.
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp | 4 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_interface/interface_si.cpp | 28 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_root/root.cpp | 6 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_root/root_sh.cpp | 21 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_root/root_si.cpp | 18 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_root/root_ss.cpp | 18 | ||||
-rw-r--r-- | TAO/TAO_IDL/driver/drv_args.cpp | 8 | ||||
-rw-r--r-- | TAO/TAO_IDL/include/idl_global.h | 10 | ||||
-rw-r--r-- | TAO/TAO_IDL/util/utl_global.cpp | 15 |
9 files changed, 90 insertions, 38 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp index c2b5d914ac1..70d1a36739e 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp @@ -242,7 +242,8 @@ be_visitor_interface_sh::visit_interface (be_interface *node) } // No need to generate TIE class for locality constraint interface. - if (!idl_global->gen_locality_constraint ()) + if (!idl_global->gen_locality_constraint () + && idl_global->gen_tie_classes ()) { // generate the TIE class. ctx = *this->ctx_; @@ -257,6 +258,7 @@ be_visitor_interface_sh::visit_interface (be_interface *node) "codegen for TIE class failed\n"), -1); } + delete visitor; } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_si.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_si.cpp index 91c74396f9d..bc5e6ca4e3a 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_si.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_si.cpp @@ -76,19 +76,23 @@ be_visitor_interface_si::visit_interface (be_interface *node) "codegen for base class skeletons failed\n"), -1); } - // generate the TIE class - be_visitor_context ctx (*this->ctx_); - ctx.state (TAO_CodeGen::TAO_INTERFACE_TIE_SI); - ctx.stream (tao_cg->server_template_inline ()); - be_visitor *visitor = tao_cg->make_visitor (&ctx); - if (!visitor || (node->accept (visitor) == -1)) + if (idl_global->gen_tie_classes ()) { - delete visitor; - ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_interface_sh::" - "visit_interface - " - "codegen for TIE class failed\n"), - -1); + // generate the TIE class + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_INTERFACE_TIE_SI); + ctx.stream (tao_cg->server_template_inline ()); + be_visitor *visitor = tao_cg->make_visitor (&ctx); + + if (!visitor || (node->accept (visitor) == -1)) + { + delete visitor; + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_interface_sh::" + "visit_interface - " + "codegen for TIE class failed\n"), + -1); + } } } diff --git a/TAO/TAO_IDL/be/be_visitor_root/root.cpp b/TAO/TAO_IDL/be/be_visitor_root/root.cpp index 8e6079d7a29..ed5b9180242 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root.cpp @@ -137,7 +137,8 @@ int be_visitor_root::visit_root (be_root *node) break; case TAO_CodeGen::TAO_ROOT_SH: (void) tao_cg->end_server_header (); - (void) tao_cg->end_server_template_header (); + if (idl_global->gen_tie_classes ()) + (void) tao_cg->end_server_template_header (); return 0; case TAO_CodeGen::TAO_ROOT_CI: @@ -147,7 +148,8 @@ int be_visitor_root::visit_root (be_root *node) case TAO_CodeGen::TAO_ROOT_SI: return 0; // nothing to be done case TAO_CodeGen::TAO_ROOT_SS: - (void) tao_cg->end_server_template_skeletons (); + if (idl_global->gen_tie_classes ()) + (void) tao_cg->end_server_template_skeletons (); return 0; // nothing to be done default: { diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_sh.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_sh.cpp index ed4af10067f..57aaadbfe5f 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root_sh.cpp @@ -55,16 +55,21 @@ be_visitor_root_sh::init (void) -1); } - if (tao_cg->start_server_template_header (idl_global->be_get_server_template_hdr_fname ()) - == -1) + if (idl_global->gen_tie_classes ()) { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_root_sh::init - " - "Error:Unable to openin server template header file : %s\n", - idl_global->be_get_server_template_hdr_fname ()), - -1); + if (tao_cg->start_server_template_header ( + idl_global->be_get_server_template_hdr_fname () + ) + == -1) + { + ACE_ERROR_RETURN (( + LM_ERROR, + "(%N:%l) be_visitor_root_sh::init - " + "Error:Unable to openin server template header file : %s\n", + idl_global->be_get_server_template_hdr_fname () + ), -1); + } } - // set the stream and the next state this->ctx_->stream (tao_cg->server_header ()); return 0; diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_si.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_si.cpp index 5a4ec77261c..d4e73c9cc67 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root_si.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root_si.cpp @@ -52,14 +52,18 @@ be_visitor_root_si::init (void) "server inline open failed\n"), -1); } - if (tao_cg->start_server_template_inline - (idl_global->be_get_server_template_inline_fname ()) - == -1) + if (idl_global->gen_tie_classes ()) { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_root_si::init - " - "Error opening server template inline file\n"), - -1); + if (tao_cg->start_server_template_inline ( + idl_global->be_get_server_template_inline_fname () + ) + == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_root_si::init - " + "Error opening server template inline file\n"), + -1); + } } // init stream diff --git a/TAO/TAO_IDL/be/be_visitor_root/root_ss.cpp b/TAO/TAO_IDL/be/be_visitor_root/root_ss.cpp index c5557f3fa80..94949c60549 100644 --- a/TAO/TAO_IDL/be/be_visitor_root/root_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_root/root_ss.cpp @@ -53,14 +53,18 @@ be_visitor_root_ss::init (void) "Error opening server skeletons file\n"), -1); } - if (tao_cg->start_server_template_skeletons - (idl_global->be_get_server_template_skeleton_fname ()) - == -1) + if (idl_global->gen_tie_classes ()) { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_root_ss::init - " - "Error opening server template skeleton file\n"), - -1); + if (tao_cg->start_server_template_skeletons ( + idl_global->be_get_server_template_skeleton_fname () + ) + == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_root_ss::init - " + "Error opening server template skeleton file\n"), + -1); + } } // set stream diff --git a/TAO/TAO_IDL/driver/drv_args.cpp b/TAO/TAO_IDL/driver/drv_args.cpp index 9488909648c..13ff70260ac 100644 --- a/TAO/TAO_IDL/driver/drv_args.cpp +++ b/TAO/TAO_IDL/driver/drv_args.cpp @@ -154,6 +154,9 @@ DRV_usage (void) cerr << GTDEVEL (" -sT\t\t\tServer's template skeleton file name ending. Default is S_T.cpp\n"); cerr << GTDEVEL (" -Sa\t\t\tsuppress Any support (support enabled by default)\n"); cerr << GTDEVEL (" -St\t\t\tsuppress TypeCode support (support enabled by default)\n"); + cerr << GTDEVEL (" -Sc\t\t\tsuppress tie class (and file) generation (enabled by default)\n"); + cerr << GTDEVEL (" -Sp\t\t\tsuppress generating Thru POA collocated stubs (enabled by default)\n"); + cerr << GTDEVEL (" -Sd\t\t\tsuppress generating Direct collocated stubs (disable by default)\n"); #ifdef IDL_HAS_VALUETYPE cerr << GTDEVEL (" -Sv\t\t\tdisable OBV (Valuetype) support (disabled by default)\n"); #endif /* IDL_HAS_VALUETYPE */ @@ -557,6 +560,11 @@ DRV_parse_args (long ac, char **av) // suppress generating Direct collocated stubs idl_global->gen_direct_collocation (0); } + else if (av[i][2] == 'c') + { + // suppress generating tie classes and files + idl_global->gen_tie_classes (0); + } else if (av[i][2] == 'v') { // disable OBV (Valuetype) support diff --git a/TAO/TAO_IDL/include/idl_global.h b/TAO/TAO_IDL/include/idl_global.h index 51603917a98..e19d77366d4 100644 --- a/TAO/TAO_IDL/include/idl_global.h +++ b/TAO/TAO_IDL/include/idl_global.h @@ -606,6 +606,12 @@ public: virtual idl_bool ami_call_back (void); // Return the flag. + virtual void gen_tie_classes (idl_bool value); + // Toggle the generation of tie classes and files. + + virtual idl_bool gen_tie_classes (void); + // Return the flag. + private: // Data UTL_ScopeStack *pd_scopes; // Store scopes stack @@ -763,6 +769,10 @@ private: // Flag to indicate whether the AMI Call back feature of the // Messaging specification should be enabled for the generated files // or not. + + idl_bool gen_tie_classes_; + // Flag to indicate whether we generate the tie classes and + // files or not. }; #endif //_IDL_IDL_GLOBAL_HH diff --git a/TAO/TAO_IDL/util/utl_global.cpp b/TAO/TAO_IDL/util/utl_global.cpp index 823d3f90d4d..77f0d701945 100644 --- a/TAO/TAO_IDL/util/utl_global.cpp +++ b/TAO/TAO_IDL/util/utl_global.cpp @@ -151,7 +151,8 @@ IDL_GlobalData::IDL_GlobalData (void) gen_locality_constraint_ (I_FALSE), opt_tc_ (I_FALSE), case_diff_error_ (I_TRUE), - ami_call_back_ (I_FALSE) + ami_call_back_ (I_FALSE), + gen_tie_classes_ (I_TRUE) { // Path for the perfect hash generator(gperf) program. @@ -1484,3 +1485,15 @@ IDL_GlobalData::ami_call_back (void) { return this->ami_call_back_; } + +void +IDL_GlobalData::gen_tie_classes (idl_bool val) +{ + this->gen_tie_classes_ = val; +} + +idl_bool +IDL_GlobalData::gen_tie_classes (void) +{ + return this->gen_tie_classes_; +} |