diff options
author | mayur <mayur@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-12-26 13:25:09 +0000 |
---|---|---|
committer | mayur <mayur@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-12-26 13:25:09 +0000 |
commit | 70c4d6ee0b6152a329369377e8cd0c4308f80cb9 (patch) | |
tree | f16e3744afa327beb635adc2b9acabd04c5af1f3 /TAO/TAO_IDL/be | |
parent | d7e3a3e18311018a9b22c3054d5d33428baabfa6 (diff) | |
download | ATCD-70c4d6ee0b6152a329369377e8cd0c4308f80cb9.tar.gz |
Wed Dec 26 05:16:45 2001 Mayur Deshpande <mayur@ics.uci.edu
Diffstat (limited to 'TAO/TAO_IDL/be')
-rw-r--r-- | TAO/TAO_IDL/be/be_operation_strategy.cpp | 256 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp | 2210 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_factory.cpp | 1366 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp | 32 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp | 61 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_interface/interface.cpp | 1976 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp | 370 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp | 234 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_operation/operation.cpp | 254 |
9 files changed, 3381 insertions, 3378 deletions
diff --git a/TAO/TAO_IDL/be/be_operation_strategy.cpp b/TAO/TAO_IDL/be/be_operation_strategy.cpp index addf9060b73..d230eceb93e 100644 --- a/TAO/TAO_IDL/be/be_operation_strategy.cpp +++ b/TAO/TAO_IDL/be/be_operation_strategy.cpp @@ -24,10 +24,10 @@ ACE_RCSID(be, be_operation_strategy, "$Id$") -be_operation_strategy::be_operation_strategy (be_operation *node, -Strategy_Kind strategy_type) -: node_ (node), -strategy_type_ (strategy_type) + be_operation_strategy::be_operation_strategy (be_operation *node, + Strategy_Kind strategy_type) + : node_ (node), + strategy_type_ (strategy_type) { } @@ -38,38 +38,38 @@ be_operation_strategy::~be_operation_strategy (void) int be_operation_strategy::strategy_type (void) { -return strategy_type_; + return strategy_type_; } int be_operation_strategy::has_extra_code_generation ( -TAO_CodeGen::CG_STATE /* current_state */ -) + TAO_CodeGen::CG_STATE /* current_state */ + ) { -return 0; + return 0; } be_operation * be_operation_strategy::marshaling (void) { -return 0; + return 0; } be_operation * be_operation_strategy::arguments (void) { -return 0; + return 0; } // **************************************************************** // AMI sendc_ operation strategy be_operation_default_strategy::be_operation_default_strategy ( -be_operation *node -) -: be_operation_strategy (node, -DEFAULT) + be_operation *node + ) + : be_operation_strategy (node, + DEFAULT) { } @@ -80,11 +80,11 @@ be_operation_default_strategy::~be_operation_default_strategy (void) TAO_CodeGen::CG_STATE be_operation_default_strategy::next_state ( -TAO_CodeGen::CG_STATE current_state, -int /* is_extra_state */ -) + TAO_CodeGen::CG_STATE current_state, + int /* is_extra_state */ + ) { -return current_state; + return current_state; } @@ -93,14 +93,14 @@ return current_state; // AMI sendc_ operation strategy be_operation_ami_sendc_strategy::be_operation_ami_sendc_strategy ( -be_operation *node, -be_operation *marshaling, -be_operation *arguments -) -: be_operation_strategy (node, -AMI_SENDC), -marshaling_ (marshaling), -arguments_ (arguments) + be_operation *node, + be_operation *marshaling, + be_operation *arguments + ) + : be_operation_strategy (node, + AMI_SENDC), + marshaling_ (marshaling), + arguments_ (arguments) { } @@ -111,56 +111,56 @@ be_operation_ami_sendc_strategy::~be_operation_ami_sendc_strategy (void) TAO_CodeGen::CG_STATE be_operation_ami_sendc_strategy::next_state ( -TAO_CodeGen::CG_STATE current_state, -int is_extra_state -) -{ -if (is_extra_state) -{ -switch (current_state) -{ -case TAO_CodeGen::TAO_OPERATION_CH: -return TAO_CodeGen::TAO_AMI_SENDC_OPERATION_CH; -case TAO_CodeGen::TAO_OPERATION_CS: -return TAO_CodeGen::TAO_AMI_SENDC_OPERATION_CS; -default: -return current_state; -} -} -else -{ -return current_state; -} + TAO_CodeGen::CG_STATE current_state, + int is_extra_state + ) +{ + if (is_extra_state) + { + switch (current_state) + { + case TAO_CodeGen::TAO_OPERATION_CH: + return TAO_CodeGen::TAO_AMI_SENDC_OPERATION_CH; + case TAO_CodeGen::TAO_OPERATION_CS: + return TAO_CodeGen::TAO_AMI_SENDC_OPERATION_CS; + default: + return current_state; + } + } + else + { + return current_state; + } } int be_operation_ami_sendc_strategy::has_extra_code_generation ( -TAO_CodeGen::CG_STATE current_state -) -{ -if (current_state == TAO_CodeGen::TAO_OPERATION_CH -|| current_state == TAO_CodeGen::TAO_OPERATION_CS) + TAO_CodeGen::CG_STATE current_state + ) { -return 1; -} -else -{ -return 0; -} + if (current_state == TAO_CodeGen::TAO_OPERATION_CH + || current_state == TAO_CodeGen::TAO_OPERATION_CS) + { + return 1; + } + else + { + return 0; + } } be_operation* be_operation_ami_sendc_strategy::marshaling (void) { -return marshaling_; + return marshaling_; } be_operation* be_operation_ami_sendc_strategy::arguments (void) { -return arguments_; + return arguments_; } // **************************************************************** @@ -168,8 +168,8 @@ return arguments_; be_operation_ami_exception_holder_raise_strategy ::be_operation_ami_exception_holder_raise_strategy (be_operation *node) -: be_operation_strategy (node, -AMI_EXCEPTION_HOLDER_RAISE) + : be_operation_strategy (node, + AMI_EXCEPTION_HOLDER_RAISE) { } @@ -181,24 +181,24 @@ be_operation_ami_exception_holder_raise_strategy TAO_CodeGen::CG_STATE be_operation_ami_exception_holder_raise_strategy::next_state ( -TAO_CodeGen::CG_STATE current_state, -int is_extra_state -) -{ -if (!is_extra_state) -{ -switch (current_state) -{ -case TAO_CodeGen::TAO_OPERATION_CS: -return TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_RAISE_OPERATION_CS; -default: -return current_state; -} -} -else -{ -return current_state; -} + TAO_CodeGen::CG_STATE current_state, + int is_extra_state + ) +{ + if (!is_extra_state) + { + switch (current_state) + { + case TAO_CodeGen::TAO_OPERATION_CS: + return TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_RAISE_OPERATION_CS; + default: + return current_state; + } + } + else + { + return current_state; + } } @@ -207,8 +207,8 @@ return current_state; be_operation_ami_handler_reply_stub_strategy ::be_operation_ami_handler_reply_stub_strategy (be_operation *node) -: be_operation_strategy (node, -AMI_EXCEPTION_HOLDER_RAISE) + : be_operation_strategy (node, + AMI_EXCEPTION_HOLDER_RAISE) { } @@ -220,45 +220,45 @@ be_operation_ami_handler_reply_stub_strategy TAO_CodeGen::CG_STATE be_operation_ami_handler_reply_stub_strategy::next_state ( -TAO_CodeGen::CG_STATE current_state, -int is_extra_state -) -{ -if (is_extra_state) -{ -switch (current_state) + TAO_CodeGen::CG_STATE current_state, + int is_extra_state + ) { -case TAO_CodeGen::TAO_OPERATION_CH: -return TAO_CodeGen::TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CH; + if (is_extra_state) + { + switch (current_state) + { + case TAO_CodeGen::TAO_OPERATION_CH: + return TAO_CodeGen::TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CH; -case TAO_CodeGen::TAO_OPERATION_CS: -return TAO_CodeGen::TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CS; + case TAO_CodeGen::TAO_OPERATION_CS: + return TAO_CodeGen::TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CS; -default: -return current_state; -} -} -else -{ -return current_state; -} + default: + return current_state; + } + } + else + { + return current_state; + } } int be_operation_ami_handler_reply_stub_strategy::has_extra_code_generation ( -TAO_CodeGen::CG_STATE current_state -) + TAO_CodeGen::CG_STATE current_state + ) { -if (current_state == TAO_CodeGen::TAO_OPERATION_CH -|| current_state == TAO_CodeGen::TAO_OPERATION_CS) -{ -return 1; -} -else -{ -return 0; -} + if (current_state == TAO_CodeGen::TAO_OPERATION_CH + || current_state == TAO_CodeGen::TAO_OPERATION_CS) + { + return 1; + } + else + { + return 0; + } } @@ -266,7 +266,7 @@ return 0; // AMH Strategy be_operation_amh_strategy::be_operation_amh_strategy (be_operation *node) -: be_operation_strategy (node, AMI_EXCEPTION_HOLDER_RAISE) + : be_operation_strategy (node, AMI_EXCEPTION_HOLDER_RAISE) { } @@ -277,31 +277,31 @@ be_operation_amh_strategy::~be_operation_amh_strategy (void) TAO_CodeGen::CG_STATE be_operation_amh_strategy::next_state ( -TAO_CodeGen::CG_STATE current_state, -int /*is_extra_state*/ -) + TAO_CodeGen::CG_STATE current_state, + int /*is_extra_state*/ + ) { -switch (current_state) -{ -case TAO_CodeGen::TAO_OPERATION_SS: -return TAO_CodeGen::TAO_OPERATION_AMH_SS; -case TAO_CodeGen::TAO_INTERFACE_SS: -return TAO_CodeGen::TAO_INTERFACE_AMH_SS; -default: -return current_state; -} + switch (current_state) + { + case TAO_CodeGen::TAO_OPERATION_SS: + return TAO_CodeGen::TAO_OPERATION_AMH_SS; + case TAO_CodeGen::TAO_INTERFACE_SS: + return TAO_CodeGen::TAO_INTERFACE_AMH_SS; + default: + return current_state; + } } be_operation* be_operation_amh_strategy::arguments (void) { -return arguments_; + return arguments_; } int be_operation_amh_strategy::has_extra_code_generation ( -TAO_CodeGen::CG_STATE -) + TAO_CodeGen::CG_STATE + ) { -return 0; + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp b/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp index b17042973c0..2fa7340918d 100644 --- a/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp +++ b/TAO/TAO_IDL/be/be_visitor_amh_pre_proc.cpp @@ -1,12 +1,12 @@ //============================================================================= /** -* @file be_visitor_amh_pre_proc.cpp -* -* $Id$ -* -* This visitor creates for AMH implied IDL constructs the appropriate AST -* (Abstract Syntax Tree) node, sets the corresponding interface or operation -* strategy on it and enteres the nodes into the AST. + * @file be_visitor_amh_pre_proc.cpp + * + * $Id$ + * + * This visitor creates for AMH implied IDL constructs the appropriate AST + * (Abstract Syntax Tree) node, sets the corresponding interface or operation + * strategy on it and enteres the nodes into the AST. * * @author Darrell Brunsch <brunsch@cs.wustl.edu> */ @@ -15,7 +15,7 @@ #include "be_visitor_amh_pre_proc.h" be_visitor_amh_pre_proc::be_visitor_amh_pre_proc (be_visitor_context *ctx) -: be_visitor_scope (ctx) + : be_visitor_scope (ctx) { } @@ -30,13 +30,13 @@ be_visitor_amh_pre_proc::~be_visitor_amh_pre_proc (void) int be_visitor_amh_pre_proc::visit_root (be_root *node) { -if (this->visit_scope (node) == -1) -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_amh_pre_proc::" -"visit_root - visit scope failed\n"), --1); - -return 0; + if (this->visit_scope (node) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_amh_pre_proc::" + "visit_root - visit scope failed\n"), + -1); + + return 0; } @@ -44,13 +44,13 @@ return 0; int be_visitor_amh_pre_proc::visit_module (be_module *node) { -if (!node->imported () && this->visit_scope (node) == -1) -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_amh_pre_proc::" -"visit_module - visit scope failed\n"), --1); - -return 0; + if (!node->imported () && this->visit_scope (node) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_amh_pre_proc::" + "visit_module - visit scope failed\n"), + -1); + + return 0; } @@ -58,134 +58,134 @@ return 0; int be_visitor_amh_pre_proc::visit_interface (be_interface *node) { -if (!node->imported () && !node->is_local ()) -{ -AST_Module *module = AST_Module::narrow_from_scope (node->defined_in ()); -if (!module) -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_amh_pre_proc::" -"visit_interface - module is null\n"), --1); - -be_interface *amh_class = this->create_amh_class (node); - -if (amh_class) -{ -amh_class->set_defined_in (node->defined_in ()); - -// Insert the new amh class after the node -module->be_add_interface (amh_class, node); - -// Remember from whom we were cloned -amh_class->original_interface (node); -} -else -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_amh_pre_proc::" -"visit_interface - " -"creating the amh_class failed\n"), --1); -} - -// Since this is server side only, don't generate the client stuff. -// We do this by pretending that all this stuff has already been -// generated. -amh_class->cli_hdr_gen (1); -amh_class->cli_stub_gen (1); -amh_class->cli_hdr_any_op_gen (1); -amh_class->cli_stub_any_op_gen (1); -amh_class->cli_hdr_cdr_op_gen (1); -amh_class->cli_stub_cdr_op_gen (1); -amh_class->cli_inline_cdr_op_gen (1); -amh_class->cli_inline_gen (1); - -// Set the proper strategy -be_interface_strategy *old_strategy = -amh_class->set_strategy (new be_interface_amh_strategy (amh_class)); - -if (old_strategy) -delete old_strategy; - -be_valuetype *excep_holder = this->create_exception_holder (node); -if (excep_holder) -{ -excep_holder->set_defined_in (node->defined_in ()); -// Insert the exception holder after the original node, -// this way we ensure that it is *before* the -// ami handler, which is the way we want to have it. -module->be_add_interface (excep_holder, node); -module->set_has_nested_valuetype (); -// Remember from whom we were cloned -excep_holder->original_interface (node); -/* -// Set the strategy -be_interface_strategy *old_strategy = -excep_holder->set_strategy (new be_interface_ami_exception_holder_strategy (excep_holder)); -if (old_strategy) -delete old_strategy; -*/ -} -else -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_amh_pre_proc::" -"visit_interface - " -"creating the exception holder failed\n"), --1); -} - -be_interface *response_handler = this->create_response_handler (node, excep_holder); -if (response_handler) -{ -response_handler->set_defined_in (node->defined_in ()); - -// Insert the ami handler after the node, the -// exception holder will be placed between these two later. -module->be_add_interface (response_handler, node); - -// Remember from whom we were cloned -response_handler->original_interface (node); - -// Since this is server side only, don't generate the client stuff. -// We do this by pretending that all this stuff has already been -// generated. -response_handler->cli_hdr_gen (1); -response_handler->cli_stub_gen (1); -response_handler->cli_hdr_any_op_gen (1); -response_handler->cli_stub_any_op_gen (1); -response_handler->cli_hdr_cdr_op_gen (1); -response_handler->cli_stub_cdr_op_gen (1); -response_handler->cli_inline_cdr_op_gen (1); -response_handler->cli_inline_gen (1); -} -else -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_amh_pre_proc::" -"visit_interface - " -"creating the response handler failed\n"), --1); -} - -/* -// Set the proper strategy -be_interface_strategy *old_strategy = -node->set_strategy (new be_interface_ami_strategy (node, -response_handler)); - -if (old_strategy) -delete old_strategy; - -*/ -if (this->visit_scope (node) == -1) -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_amh_pre_proc::" -"visit_interface - visit scope failed\n"), --1); -} - -return 0; + if (!node->imported () && !node->is_local ()) + { + AST_Module *module = AST_Module::narrow_from_scope (node->defined_in ()); + if (!module) + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_amh_pre_proc::" + "visit_interface - module is null\n"), + -1); + + be_interface *amh_class = this->create_amh_class (node); + + if (amh_class) + { + amh_class->set_defined_in (node->defined_in ()); + + // Insert the new amh class after the node + module->be_add_interface (amh_class, node); + + // Remember from whom we were cloned + amh_class->original_interface (node); + } + else + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_amh_pre_proc::" + "visit_interface - " + "creating the amh_class failed\n"), + -1); + } + + // Since this is server side only, don't generate the client stuff. + // We do this by pretending that all this stuff has already been + // generated. + amh_class->cli_hdr_gen (1); + amh_class->cli_stub_gen (1); + amh_class->cli_hdr_any_op_gen (1); + amh_class->cli_stub_any_op_gen (1); + amh_class->cli_hdr_cdr_op_gen (1); + amh_class->cli_stub_cdr_op_gen (1); + amh_class->cli_inline_cdr_op_gen (1); + amh_class->cli_inline_gen (1); + + // Set the proper strategy + be_interface_strategy *old_strategy = + amh_class->set_strategy (new be_interface_amh_strategy (amh_class)); + + if (old_strategy) + delete old_strategy; + + be_valuetype *excep_holder = this->create_exception_holder (node); + if (excep_holder) + { + excep_holder->set_defined_in (node->defined_in ()); + // Insert the exception holder after the original node, + // this way we ensure that it is *before* the + // ami handler, which is the way we want to have it. + module->be_add_interface (excep_holder, node); + module->set_has_nested_valuetype (); + // Remember from whom we were cloned + excep_holder->original_interface (node); + /* + // Set the strategy + be_interface_strategy *old_strategy = + excep_holder->set_strategy (new be_interface_ami_exception_holder_strategy (excep_holder)); + if (old_strategy) + delete old_strategy; + */ + } + else + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_amh_pre_proc::" + "visit_interface - " + "creating the exception holder failed\n"), + -1); + } + + be_interface *response_handler = this->create_response_handler (node, excep_holder); + if (response_handler) + { + response_handler->set_defined_in (node->defined_in ()); + + // Insert the ami handler after the node, the + // exception holder will be placed between these two later. + module->be_add_interface (response_handler, node); + + // Remember from whom we were cloned + response_handler->original_interface (node); + + // Since this is server side only, don't generate the client stuff. + // We do this by pretending that all this stuff has already been + // generated. + response_handler->cli_hdr_gen (1); + response_handler->cli_stub_gen (1); + response_handler->cli_hdr_any_op_gen (1); + response_handler->cli_stub_any_op_gen (1); + response_handler->cli_hdr_cdr_op_gen (1); + response_handler->cli_stub_cdr_op_gen (1); + response_handler->cli_inline_cdr_op_gen (1); + response_handler->cli_inline_gen (1); + } + else + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_amh_pre_proc::" + "visit_interface - " + "creating the response handler failed\n"), + -1); + } + + /* + // Set the proper strategy + be_interface_strategy *old_strategy = + node->set_strategy (new be_interface_ami_strategy (node, + response_handler)); + + if (old_strategy) + delete old_strategy; + + */ + if (this->visit_scope (node) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_amh_pre_proc::" + "visit_interface - visit scope failed\n"), + -1); + } + + return 0; } @@ -193,45 +193,45 @@ return 0; int be_visitor_amh_pre_proc::visit_operation (be_operation *node) { -// We do nothing for oneways! -if (node->flags () == AST_Operation::OP_oneway) -return 0; - -// Set the proper strategy -be_operation_strategy *old_strategy = -node->set_strategy (new be_operation_amh_strategy (node)); - -if (old_strategy) -delete old_strategy; - -/* be_operation *sendc_marshaling = -this->create_sendc_operation (node, -0); // for arguments = FALSE - -be_operation *sendc_arguments = -this->create_sendc_operation (node, -1); // for arguments = TRUE - -if (sendc_marshaling && sendc_arguments) -{ -sendc_marshaling->set_defined_in (node->defined_in ()); - -sendc_arguments->set_defined_in (node->defined_in ()); - -// We do not copy the exceptions because the exceptions -// are delivered by the excep methods. - -// Set the proper strategy, and store the specialized -// marshaling and arguments operations in it. -be_operation_strategy *old_strategy = -node->set_strategy (new be_operation_ami_sendc_strategy (node, -sendc_marshaling, -sendc_arguments)); -if (old_strategy) -delete old_strategy; -} -*/ -return 0; + // We do nothing for oneways! + if (node->flags () == AST_Operation::OP_oneway) + return 0; + + // Set the proper strategy + be_operation_strategy *old_strategy = + node->set_strategy (new be_operation_amh_strategy (node)); + + if (old_strategy) + delete old_strategy; + + /* be_operation *sendc_marshaling = + this->create_sendc_operation (node, + 0); // for arguments = FALSE + + be_operation *sendc_arguments = + this->create_sendc_operation (node, + 1); // for arguments = TRUE + + if (sendc_marshaling && sendc_arguments) + { + sendc_marshaling->set_defined_in (node->defined_in ()); + + sendc_arguments->set_defined_in (node->defined_in ()); + + // We do not copy the exceptions because the exceptions + // are delivered by the excep methods. + + // Set the proper strategy, and store the specialized + // marshaling and arguments operations in it. + be_operation_strategy *old_strategy = + node->set_strategy (new be_operation_ami_sendc_strategy (node, + sendc_marshaling, + sendc_arguments)); + if (old_strategy) + delete old_strategy; + } + */ + return 0; } @@ -239,34 +239,34 @@ return 0; int be_visitor_amh_pre_proc::visit_attribute (be_attribute *node) { -// Temporarily generate the set operation. -be_operation *set_operation = -this->generate_set_operation (node); - -this->visit_operation (set_operation); - -// Retrieve the strategy set by the visit operation -be_operation_strategy *set_operation_strategy = -set_operation->set_strategy (new be_operation_default_strategy (set_operation)); - -// Assign it to the attribute as set_operation strategy -if (set_operation_strategy) -delete node->set_set_strategy (set_operation_strategy); - -// Temporerily generate the get operation. -be_operation *get_operation = -this->generate_get_operation (node); - -this->visit_operation (get_operation); - -be_operation_strategy *get_operation_strategy = -get_operation->set_strategy (new be_operation_default_strategy (get_operation)); - -if (get_operation_strategy) -delete node->set_get_strategy (get_operation_strategy); - - -return 0; + // Temporarily generate the set operation. + be_operation *set_operation = + this->generate_set_operation (node); + + this->visit_operation (set_operation); + + // Retrieve the strategy set by the visit operation + be_operation_strategy *set_operation_strategy = + set_operation->set_strategy (new be_operation_default_strategy (set_operation)); + + // Assign it to the attribute as set_operation strategy + if (set_operation_strategy) + delete node->set_set_strategy (set_operation_strategy); + + // Temporerily generate the get operation. + be_operation *get_operation = + this->generate_get_operation (node); + + this->visit_operation (get_operation); + + be_operation_strategy *get_operation_strategy = + get_operation->set_strategy (new be_operation_default_strategy (get_operation)); + + if (get_operation_strategy) + delete node->set_get_strategy (get_operation_strategy); + + + return 0; } @@ -274,606 +274,606 @@ return 0; be_valuetype * be_visitor_amh_pre_proc::create_exception_holder (be_interface *node) { - -// Create a virtual module named "Messaging" and an valuetype "ExceptionHolder" -// from which we inherit. -UTL_ScopedName *inherit_name = -new UTL_ScopedName (new Identifier ("Messaging"), -0); - -inherit_name->nconc (new UTL_ScopedName (new Identifier ("ExceptionHolder"), -0)); - -be_valuetype *inherit_vt = new be_valuetype (inherit_name, -0, -0, -0); -inherit_vt->set_name (inherit_name); - -be_module *msg = new be_module (new UTL_ScopedName (new Identifier ("Messaging"), -0), -0); - -// Notice the valuetype "ExceptionHolder" that it is defined in the -// "Messaging" module -inherit_vt->set_defined_in (msg); - -// Create the excpetion holder name -ACE_CString excep_holder_local_name; -this->generate_name (excep_holder_local_name, -"AMH_", -node->name ()->last_component ()->get_string(), -""); - -UTL_ScopedName *excep_holder_name = ACE_static_cast (UTL_ScopedName *, node->name ()->copy ()); -excep_holder_name->last_component ()->replace_string (excep_holder_local_name.rep ()); - -AST_Interface_ptr *p_intf = new AST_Interface_ptr[1]; -p_intf[0] = ACE_static_cast (AST_Interface *, inherit_vt); - -be_valuetype *excep_holder = new be_valuetype (excep_holder_name, // name -p_intf, // list of inherited -1, // number of inherited -0, // pragmas -0); // set abstract -excep_holder->set_name (excep_holder_name); - -// Now our customized valuetype is created, we have to -// add now the operations and attributes to the scope. - -if (node->nmembers () > 0) -{ -// initialize an iterator to iterate thru our scope -UTL_ScopeActiveIterator *si; -ACE_NEW_RETURN (si, -UTL_ScopeActiveIterator (node, -UTL_Scope::IK_decls), -0); -// continue until each element is visited -while (!si->is_done ()) -{ -AST_Decl *d = si->item (); -if (!d) -{ -delete si; -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_amh_pre_proc::visit_interface - " -"bad node in this scope\n"), -0); - -} -be_decl *op = be_decl::narrow_from_decl (d); - -if (d->node_type () == AST_Decl::NT_attr) -{ -AST_Attribute *attribute = AST_Attribute::narrow_from_decl (d); - -if (!attribute) -return 0; - -this->create_raise_operation (op, -excep_holder, -GET_OPERATION); - -if (!attribute->readonly ()) -{ -this->create_raise_operation (op, -excep_holder, -SET_OPERATION); -} - -} -else -{ -this->create_raise_operation (op, -excep_holder, -NORMAL); -} -si->next (); -} // end of while loop -delete si; -} // end of if - -return excep_holder; + + // Create a virtual module named "Messaging" and an valuetype "ExceptionHolder" + // from which we inherit. + UTL_ScopedName *inherit_name = + new UTL_ScopedName (new Identifier ("Messaging"), + 0); + + inherit_name->nconc (new UTL_ScopedName (new Identifier ("ExceptionHolder"), + 0)); + + be_valuetype *inherit_vt = new be_valuetype (inherit_name, + 0, + 0, + 0); + inherit_vt->set_name (inherit_name); + + be_module *msg = new be_module (new UTL_ScopedName (new Identifier ("Messaging"), + 0), + 0); + + // Notice the valuetype "ExceptionHolder" that it is defined in the + // "Messaging" module + inherit_vt->set_defined_in (msg); + + // Create the excpetion holder name + ACE_CString excep_holder_local_name; + this->generate_name (excep_holder_local_name, + "AMH_", + node->name ()->last_component ()->get_string(), + ""); + + UTL_ScopedName *excep_holder_name = ACE_static_cast (UTL_ScopedName *, node->name ()->copy ()); + excep_holder_name->last_component ()->replace_string (excep_holder_local_name.rep ()); + + AST_Interface_ptr *p_intf = new AST_Interface_ptr[1]; + p_intf[0] = ACE_static_cast (AST_Interface *, inherit_vt); + + be_valuetype *excep_holder = new be_valuetype (excep_holder_name, // name + p_intf, // list of inherited + 1, // number of inherited + 0, // pragmas + 0); // set abstract + excep_holder->set_name (excep_holder_name); + + // Now our customized valuetype is created, we have to + // add now the operations and attributes to the scope. + + if (node->nmembers () > 0) + { + // initialize an iterator to iterate thru our scope + UTL_ScopeActiveIterator *si; + ACE_NEW_RETURN (si, + UTL_ScopeActiveIterator (node, + UTL_Scope::IK_decls), + 0); + // continue until each element is visited + while (!si->is_done ()) + { + AST_Decl *d = si->item (); + if (!d) + { + delete si; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_amh_pre_proc::visit_interface - " + "bad node in this scope\n"), + 0); + + } + be_decl *op = be_decl::narrow_from_decl (d); + + if (d->node_type () == AST_Decl::NT_attr) + { + AST_Attribute *attribute = AST_Attribute::narrow_from_decl (d); + + if (!attribute) + return 0; + + this->create_raise_operation (op, + excep_holder, + GET_OPERATION); + + if (!attribute->readonly ()) + { + this->create_raise_operation (op, + excep_holder, + SET_OPERATION); + } + + } + else + { + this->create_raise_operation (op, + excep_holder, + NORMAL); + } + si->next (); + } // end of while loop + delete si; + } // end of if + + return excep_holder; } be_interface * be_visitor_amh_pre_proc::create_amh_class (be_interface *node) { -// Create the response handler name -ACE_CString amh_class_local_name; -this->generate_name (amh_class_local_name, -"AMH_", -node->name ()->last_component ()->get_string(), -""); - -UTL_ScopedName *amh_class_name = ACE_static_cast (UTL_ScopedName *, node->name ()->copy ()); -amh_class_name->last_component ()->replace_string (amh_class_local_name.rep ()); - -// AST_Interface_ptr *p_intf = new AST_Interface_ptr[1]; - -be_interface *amh_class = -new be_interface (amh_class_name, // name -0, // list of inherited -0, // number of inherited -0, // list of ancestors -0, // number of ancestors -0, // pragmas -0, // non-local -0); // non-abstract -amh_class->set_name (amh_class_name); - -// Now our customized valuetype is created, we have to -// add now the operations and attributes to the scope. - -if (node->nmembers () > 0) -{ -// initialize an iterator to iterate thru our scope -UTL_ScopeActiveIterator *si; -ACE_NEW_RETURN (si, -UTL_ScopeActiveIterator (node, -UTL_Scope::IK_decls), -0); -this->elem_number_ = 0; -// continue until each element is visited -while (!si->is_done ()) -{ -AST_Decl *d = si->item (); -if (!d) -{ -delete si; -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_amh_pre_proc::visit_interface - " -"bad node in this scope\n"), -0); - -} - -if (d->node_type () == AST_Decl::NT_attr) -{ -be_attribute *attribute = be_attribute::narrow_from_decl (d); - -if (!attribute) -return 0; - -/* be_operation *get_operation = this->generate_get_operation (attribute); - -this->create_response_handler_operation (get_operation, -response_handler); - -this->create_excep_operation (get_operation, -response_handler, -excep_holder); - -if (!attribute->readonly ()) -{ -be_operation *set_operation = this->generate_set_operation (attribute); -this->create_response_handler_operation (set_operation, -response_handler); - -this->create_excep_operation (set_operation, -response_handler, -excep_holder); -} -*/ -} -else -{ -be_operation* operation = be_operation::narrow_from_decl (d); - -if (operation) -{ -this->create_amh_operation (operation, amh_class); -} -/* -if (operation) -{ -this->create_response_handler_operation (operation, -response_handler); - -this->create_excep_operation (be_operation::narrow_from_decl (d), -response_handler, -excep_holder); -} -*/ -} -si->next (); -} // end of while loop -delete si; -} // end of if - -return amh_class; + // Create the response handler name + ACE_CString amh_class_local_name; + this->generate_name (amh_class_local_name, + "AMH_", + node->name ()->last_component ()->get_string(), + ""); + + UTL_ScopedName *amh_class_name = ACE_static_cast (UTL_ScopedName *, node->name ()->copy ()); + amh_class_name->last_component ()->replace_string (amh_class_local_name.rep ()); + + // AST_Interface_ptr *p_intf = new AST_Interface_ptr[1]; + + be_interface *amh_class = + new be_interface (amh_class_name, // name + 0, // list of inherited + 0, // number of inherited + 0, // list of ancestors + 0, // number of ancestors + 0, // pragmas + 0, // non-local + 0); // non-abstract + amh_class->set_name (amh_class_name); + + // Now our customized valuetype is created, we have to + // add now the operations and attributes to the scope. + + if (node->nmembers () > 0) + { + // initialize an iterator to iterate thru our scope + UTL_ScopeActiveIterator *si; + ACE_NEW_RETURN (si, + UTL_ScopeActiveIterator (node, + UTL_Scope::IK_decls), + 0); + this->elem_number_ = 0; + // continue until each element is visited + while (!si->is_done ()) + { + AST_Decl *d = si->item (); + if (!d) + { + delete si; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_amh_pre_proc::visit_interface - " + "bad node in this scope\n"), + 0); + + } + + if (d->node_type () == AST_Decl::NT_attr) + { + be_attribute *attribute = be_attribute::narrow_from_decl (d); + + if (!attribute) + return 0; + + /* be_operation *get_operation = this->generate_get_operation (attribute); + + this->create_response_handler_operation (get_operation, + response_handler); + + this->create_excep_operation (get_operation, + response_handler, + excep_holder); + + if (!attribute->readonly ()) + { + be_operation *set_operation = this->generate_set_operation (attribute); + this->create_response_handler_operation (set_operation, + response_handler); + + this->create_excep_operation (set_operation, + response_handler, + excep_holder); + } + */ + } + else + { + be_operation* operation = be_operation::narrow_from_decl (d); + + if (operation) + { + this->create_amh_operation (operation, amh_class); + } + /* + if (operation) + { + this->create_response_handler_operation (operation, + response_handler); + + this->create_excep_operation (be_operation::narrow_from_decl (d), + response_handler, + excep_holder); + } + */ + } + si->next (); + } // end of while loop + delete si; + } // end of if + + return amh_class; } /* -be_interface * -be_visitor_amh_pre_proc::create_rh_skel_class (be_interface *node) -{ -// Create the rh_class name -ACE_CString rh_class_local_name; -this->generate_name (rh_class_local_name, -"TAO_AMH_", -node->name ()->last_component ()->get_string(), -"ResponseHandler"); - -UTL_ScopedName *rh_class_name = ACE_static_cast (UTL_ScopedName *, node->name ()->copy ()); -rh_class_name->last_component ()->replace_string (rh_class_local_name.rep ()); - -// AST_Interface_ptr *p_intf = new AST_Interface_ptr[1]; - -be_interface *rh_class = -new be_interface (rh_class_name, // name -0, // list of inherited -0, // number of inherited -0, // list of ancestors -0, // number of ancestors -0, // pragmas -0, // non-local -0); // non-abstract -rh_class->set_name (rh_class_name); - -return rh_class; -} + be_interface * + be_visitor_amh_pre_proc::create_rh_skel_class (be_interface *node) + { + // Create the rh_class name + ACE_CString rh_class_local_name; + this->generate_name (rh_class_local_name, + "TAO_AMH_", + node->name ()->last_component ()->get_string(), + "ResponseHandler"); + + UTL_ScopedName *rh_class_name = ACE_static_cast (UTL_ScopedName *, node->name ()->copy ()); + rh_class_name->last_component ()->replace_string (rh_class_local_name.rep ()); + + // AST_Interface_ptr *p_intf = new AST_Interface_ptr[1]; + + be_interface *rh_class = + new be_interface (rh_class_name, // name + 0, // list of inherited + 0, // number of inherited + 0, // list of ancestors + 0, // number of ancestors + 0, // pragmas + 0, // non-local + 0); // non-abstract + rh_class->set_name (rh_class_name); + + return rh_class; + } */ int be_visitor_amh_pre_proc::create_amh_operation (be_operation *node, -be_interface *amh_class) -{ -if (!node) -return -1; - -// We do nothing for oneways! -if (node->flags () == AST_Operation::OP_oneway) -return 0; - -// Create the return type, which is "void" -be_predefined_type *rt = new be_predefined_type (AST_PredefinedType::PT_void, -new UTL_ScopedName -(new Identifier ("void"), //1, 0, I_FALSE), -0), -0); - -ACE_CString original_op_name (node -->name () -->last_component () -->get_string ()); - -UTL_ScopedName *op_name = ACE_static_cast (UTL_ScopedName *, amh_class->name ()-> copy ()); -op_name->nconc (new UTL_ScopedName ( -new Identifier ( -original_op_name.rep ()), -0)); - -// Create the operation -be_operation *operation = new be_operation (rt, //node->return_type (), -AST_Operation::OP_noflags, -op_name, -0, -0, -0); -operation->set_name (op_name); - - -ACE_CString new_op_name = ACE_CString ("reply_") + original_op_name; - -UTL_ScopedName *rtop_name = ACE_static_cast (UTL_ScopedName *, node->name ()-> copy ()); -op_name->last_component ()->replace_string (new_op_name.rep ()); - -// Create the operation -be_operation * rtoperation = new be_operation (rt, //node->return_type (), -AST_Operation::OP_noflags, -rtop_name, -0, -0, -0); - -rtoperation->set_name (op_name); - -/* Add the response_handler as the first argument -be_argument *rh_arg = new be_argument (Direction.dir_IN, -thid->response_handler, original_arg->field_type (), -original_arg->name (), -0); -operation->add_argument_to_scope (rh_arg); -*/ - -// Iterate over the arguments and put all the in and inout -// into the new method. -if (node->nmembers () > 0) -{ -// initialize an iterator to iterate thru our scope -UTL_ScopeActiveIterator *si; -ACE_NEW_RETURN (si, -UTL_ScopeActiveIterator (node, -UTL_Scope::IK_decls), -0); - -// continue until each element is visited -while (!si->is_done ()) -{ -AST_Decl *d = si->item (); -if (!d) -{ -delete si; -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_amh_pre_proc::create_response_handler_operation - " -"bad node in this scope\n"), --1); - -} - -AST_Argument *original_arg = AST_Argument::narrow_from_decl (d); - -if (original_arg->direction () == AST_Argument::dir_INOUT || -original_arg->direction () == AST_Argument::dir_IN) -{ -// Create the argument -be_argument *arg = new be_argument (original_arg->direction (), -original_arg->field_type (), -original_arg->name (), -0); - -operation->add_argument_to_scope (arg); -} -if (original_arg->direction () == AST_Argument::dir_INOUT || -original_arg->direction () == AST_Argument::dir_OUT) -{ -// Create the argument -be_argument *arg = new be_argument (original_arg->direction (), -original_arg->field_type (), -original_arg->name (), -0); - -rtoperation->add_argument_to_scope (arg); -} -si->next (); -} -delete si; -} - -// Set the proper strategy -//be_operation_strategy *old_strategy = -// operation->set_strategy (new be_operation_amh_strategy (operation)); -//if (old_strategy) -// delete old_strategy; - -operation->set_defined_in (amh_class); - -// After having generated the operation we insert it into the -// AMH class interface. -amh_class->be_add_operation (operation); - -rtoperation->set_defined_in (amh_class); - -amh_class->be_add_operation (rtoperation); - -return 0; + be_interface *amh_class) +{ + if (!node) + return -1; + + // We do nothing for oneways! + if (node->flags () == AST_Operation::OP_oneway) + return 0; + + // Create the return type, which is "void" + be_predefined_type *rt = new be_predefined_type (AST_PredefinedType::PT_void, + new UTL_ScopedName + (new Identifier ("void"), //1, 0, I_FALSE), + 0), + 0); + + ACE_CString original_op_name (node + ->name () + ->last_component () + ->get_string ()); + + UTL_ScopedName *op_name = ACE_static_cast (UTL_ScopedName *, amh_class->name ()-> copy ()); + op_name->nconc (new UTL_ScopedName ( + new Identifier ( + original_op_name.rep ()), + 0)); + + // Create the operation + be_operation *operation = new be_operation (rt, //node->return_type (), + AST_Operation::OP_noflags, + op_name, + 0, + 0, + 0); + operation->set_name (op_name); + + + ACE_CString new_op_name = ACE_CString ("reply_") + original_op_name; + + UTL_ScopedName *rtop_name = ACE_static_cast (UTL_ScopedName *, node->name ()-> copy ()); + op_name->last_component ()->replace_string (new_op_name.rep ()); + + // Create the operation + be_operation * rtoperation = new be_operation (rt, //node->return_type (), + AST_Operation::OP_noflags, + rtop_name, + 0, + 0, + 0); + + rtoperation->set_name (op_name); + + /* Add the response_handler as the first argument + be_argument *rh_arg = new be_argument (Direction.dir_IN, + thid->response_handler, original_arg->field_type (), + original_arg->name (), + 0); + operation->add_argument_to_scope (rh_arg); + */ + + // Iterate over the arguments and put all the in and inout + // into the new method. + if (node->nmembers () > 0) + { + // initialize an iterator to iterate thru our scope + UTL_ScopeActiveIterator *si; + ACE_NEW_RETURN (si, + UTL_ScopeActiveIterator (node, + UTL_Scope::IK_decls), + 0); + + // continue until each element is visited + while (!si->is_done ()) + { + AST_Decl *d = si->item (); + if (!d) + { + delete si; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_amh_pre_proc::create_response_handler_operation - " + "bad node in this scope\n"), + -1); + + } + + AST_Argument *original_arg = AST_Argument::narrow_from_decl (d); + + if (original_arg->direction () == AST_Argument::dir_INOUT || + original_arg->direction () == AST_Argument::dir_IN) + { + // Create the argument + be_argument *arg = new be_argument (original_arg->direction (), + original_arg->field_type (), + original_arg->name (), + 0); + + operation->add_argument_to_scope (arg); + } + if (original_arg->direction () == AST_Argument::dir_INOUT || + original_arg->direction () == AST_Argument::dir_OUT) + { + // Create the argument + be_argument *arg = new be_argument (original_arg->direction (), + original_arg->field_type (), + original_arg->name (), + 0); + + rtoperation->add_argument_to_scope (arg); + } + si->next (); + } + delete si; + } + + // Set the proper strategy + //be_operation_strategy *old_strategy = + // operation->set_strategy (new be_operation_amh_strategy (operation)); + //if (old_strategy) + // delete old_strategy; + + operation->set_defined_in (amh_class); + + // After having generated the operation we insert it into the + // AMH class interface. + amh_class->be_add_operation (operation); + + rtoperation->set_defined_in (amh_class); + + amh_class->be_add_operation (rtoperation); + + return 0; } be_interface * be_visitor_amh_pre_proc::create_response_handler (be_interface *node, -be_valuetype * /*excep_holder*/) -{ -// Generate 'Stock::AMH_QuoterResponseHandler' -ACE_CString class_name (node->client_enclosing_scope ()); -class_name += "AMH_"; -class_name += node->local_name (); -class_name += "ResponseHandler"; -UTL_ScopedName *inherit_name = -new UTL_ScopedName (new Identifier (class_name.rep ()), -0); -be_interface *inherit_intf = new be_interface (inherit_name, -0, // inherited interfaces -0, // number of inherited interfaces -0, // ancestors -0, // number of ancestors -0, // pragmas -1, // not local -0); // not abstract -inherit_intf->set_name (inherit_name); - -// Generate 'TAO_AMH_ResponseHandler': This is fixed and same for any RH. -ACE_CString tao_rh_name ("TAO_AMH_ResponseHandler"); -UTL_ScopedName *tao_inherit_name = -new UTL_ScopedName (new Identifier (tao_rh_name.rep ()), -0); -be_interface *tao_inherit_intf = new be_interface (tao_inherit_name, -0, // inherited interfaces -0, // number of inherited interfaces -0, // ancestors -0, // number of ancestors -0, // pragmas -1, // not local -0); // not abstract -tao_inherit_intf->set_name (tao_inherit_name); - - - -// Create the response handler name -ACE_CString response_handler_local_name; -this->generate_name (response_handler_local_name, -"TAO_AMH_", -node->name ()->last_component ()->get_string(), -"ResponseHandler"); - -UTL_ScopedName *response_handler_name = ACE_static_cast (UTL_ScopedName *, node->name ()->copy ()); -response_handler_name->last_component ()->replace_string (response_handler_local_name.rep ()); - -AST_Interface_ptr *p_intf = new AST_Interface_ptr[2]; -p_intf[0] = ACE_static_cast (AST_Interface *, inherit_intf); -p_intf[1] = ACE_static_cast (AST_Interface *, tao_inherit_intf); - -be_interface *response_handler = -new be_interface (response_handler_name, // name -p_intf, // list of inherited -2, // number of inherited -p_intf, // list of ancestors -2, // number of ancestors -0, // pragmas -0, // non-local -0); // non-abstract -response_handler->set_name (response_handler_name); - -// Now our customized valuetype is created, we have to -// add now the operations and attributes to the scope. - -if (node->nmembers () > 0) -{ -// initialize an iterator to iterate thru our scope -UTL_ScopeActiveIterator *si; -ACE_NEW_RETURN (si, -UTL_ScopeActiveIterator (node, -UTL_Scope::IK_decls), -0); -this->elem_number_ = 0; -// continue until each element is visited -while (!si->is_done ()) -{ -AST_Decl *d = si->item (); -if (!d) -{ -delete si; -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_amh_pre_proc::visit_interface - " -"bad node in this scope\n"), -0); - -} - -if (d->node_type () == AST_Decl::NT_attr) -{ -be_attribute *attribute = be_attribute::narrow_from_decl (d); - -if (!attribute) -return 0; -/* -be_operation *get_operation = this->generate_get_operation (attribute); -this->create_response_handler_operation (get_operation, -response_handler); - -this->create_excep_operation (get_operation, -response_handler, -excep_holder); - -if (!attribute->readonly ()) -{ -be_operation *set_operation = this->generate_set_operation (attribute); -this->create_response_handler_operation (set_operation, -response_handler); - -this->create_excep_operation (set_operation, -response_handler, -excep_holder); -} -*/ -} -else -{ - -be_operation* operation = be_operation::narrow_from_decl (d); -if (operation) -{ -this->create_response_handler_operation (operation, -response_handler); - -/* this->create_excep_operation (be_operation::narrow_from_decl (d), -response_handler, -excep_holder); -*/ -} - -} -si->next (); -} // end of while loop -delete si; -} // end of if - -return response_handler; + be_valuetype * /*excep_holder*/) +{ + // Generate 'Stock::AMH_QuoterResponseHandler' + ACE_CString class_name (node->client_enclosing_scope ()); + class_name += "AMH_"; + class_name += node->local_name (); + class_name += "ResponseHandler"; + UTL_ScopedName *inherit_name = + new UTL_ScopedName (new Identifier (class_name.rep ()), + 0); + be_interface *inherit_intf = new be_interface (inherit_name, + 0, // inherited interfaces + 0, // number of inherited interfaces + 0, // ancestors + 0, // number of ancestors + 0, // pragmas + 1, // not local + 0); // not abstract + inherit_intf->set_name (inherit_name); + + // Generate 'TAO_AMH_ResponseHandler': This is fixed and same for any RH. + ACE_CString tao_rh_name ("TAO_AMH_ResponseHandler"); + UTL_ScopedName *tao_inherit_name = + new UTL_ScopedName (new Identifier (tao_rh_name.rep ()), + 0); + be_interface *tao_inherit_intf = new be_interface (tao_inherit_name, + 0, // inherited interfaces + 0, // number of inherited interfaces + 0, // ancestors + 0, // number of ancestors + 0, // pragmas + 1, // not local + 0); // not abstract + tao_inherit_intf->set_name (tao_inherit_name); + + + + // Create the response handler name + ACE_CString response_handler_local_name; + this->generate_name (response_handler_local_name, + "TAO_AMH_", + node->name ()->last_component ()->get_string(), + "ResponseHandler"); + + UTL_ScopedName *response_handler_name = ACE_static_cast (UTL_ScopedName *, node->name ()->copy ()); + response_handler_name->last_component ()->replace_string (response_handler_local_name.rep ()); + + AST_Interface_ptr *p_intf = new AST_Interface_ptr[2]; + p_intf[0] = ACE_static_cast (AST_Interface *, inherit_intf); + p_intf[1] = ACE_static_cast (AST_Interface *, tao_inherit_intf); + + be_interface *response_handler = + new be_interface (response_handler_name, // name + p_intf, // list of inherited + 2, // number of inherited + p_intf, // list of ancestors + 2, // number of ancestors + 0, // pragmas + 0, // non-local + 0); // non-abstract + response_handler->set_name (response_handler_name); + + // Now our customized valuetype is created, we have to + // add now the operations and attributes to the scope. + + if (node->nmembers () > 0) + { + // initialize an iterator to iterate thru our scope + UTL_ScopeActiveIterator *si; + ACE_NEW_RETURN (si, + UTL_ScopeActiveIterator (node, + UTL_Scope::IK_decls), + 0); + this->elem_number_ = 0; + // continue until each element is visited + while (!si->is_done ()) + { + AST_Decl *d = si->item (); + if (!d) + { + delete si; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_amh_pre_proc::visit_interface - " + "bad node in this scope\n"), + 0); + + } + + if (d->node_type () == AST_Decl::NT_attr) + { + be_attribute *attribute = be_attribute::narrow_from_decl (d); + + if (!attribute) + return 0; + /* + be_operation *get_operation = this->generate_get_operation (attribute); + this->create_response_handler_operation (get_operation, + response_handler); + + this->create_excep_operation (get_operation, + response_handler, + excep_holder); + + if (!attribute->readonly ()) + { + be_operation *set_operation = this->generate_set_operation (attribute); + this->create_response_handler_operation (set_operation, + response_handler); + + this->create_excep_operation (set_operation, + response_handler, + excep_holder); + } + */ + } + else + { + + be_operation* operation = be_operation::narrow_from_decl (d); + if (operation) + { + this->create_response_handler_operation (operation, + response_handler); + + /* this->create_excep_operation (be_operation::narrow_from_decl (d), + response_handler, + excep_holder); + */ + } + + } + si->next (); + } // end of while loop + delete si; + } // end of if + + return response_handler; } int be_visitor_amh_pre_proc::create_raise_operation (be_decl *node, -be_valuetype *excep_holder, -Operation_Kind operation_kind) -{ -be_operation *orig_op = 0; -if (operation_kind == NORMAL) -{ -orig_op = be_operation::narrow_from_decl (node); -if (orig_op) -{ -if (orig_op->flags () == AST_Operation::OP_oneway) -// We do nothing for oneways! -return 0; -} -} - -// Create the return type, which is "void" -be_predefined_type *rt = new be_predefined_type (AST_PredefinedType::PT_void, -new UTL_ScopedName -(new Identifier ("void"), -0), -0); - -// Name the operation properly -UTL_ScopedName *op_name = ACE_static_cast (UTL_ScopedName *, -excep_holder->name ()-> copy ()); - -ACE_CString new_local_name ("raise_"); -if (operation_kind == SET_OPERATION) -new_local_name += "set_"; -else if (operation_kind == GET_OPERATION) -new_local_name += "get_"; -new_local_name += node -->name () -->last_component () -->get_string (); - -op_name->nconc (new UTL_ScopedName ( -new Identifier ( -new_local_name.rep ()), -0)); - -be_operation *operation = new be_operation (rt, -AST_Operation::OP_noflags, -op_name, -0, -0, -0); -operation->set_name (op_name); -operation->set_defined_in (excep_holder); - -if (operation_kind == NORMAL) -{ -if (orig_op) -{ -// Copy the exceptions. -if (orig_op->exceptions ()) -{ -UTL_ExceptList *exceptions = orig_op->exceptions (); -operation->be_add_exceptions (exceptions); -} -} -} - -// Set the proper strategy -be_operation_strategy *old_strategy = -operation->set_strategy (new be_operation_ami_exception_holder_raise_strategy (operation)); -if (old_strategy) -delete old_strategy; - -// After having generated the operation we insert it into the -// exceptionholder valuetype. -excep_holder->be_add_operation (operation); - -return 0; + be_valuetype *excep_holder, + Operation_Kind operation_kind) +{ + be_operation *orig_op = 0; + if (operation_kind == NORMAL) + { + orig_op = be_operation::narrow_from_decl (node); + if (orig_op) + { + if (orig_op->flags () == AST_Operation::OP_oneway) + // We do nothing for oneways! + return 0; + } + } + + // Create the return type, which is "void" + be_predefined_type *rt = new be_predefined_type (AST_PredefinedType::PT_void, + new UTL_ScopedName + (new Identifier ("void"), + 0), + 0); + + // Name the operation properly + UTL_ScopedName *op_name = ACE_static_cast (UTL_ScopedName *, + excep_holder->name ()-> copy ()); + + ACE_CString new_local_name ("raise_"); + if (operation_kind == SET_OPERATION) + new_local_name += "set_"; + else if (operation_kind == GET_OPERATION) + new_local_name += "get_"; + new_local_name += node + ->name () + ->last_component () + ->get_string (); + + op_name->nconc (new UTL_ScopedName ( + new Identifier ( + new_local_name.rep ()), + 0)); + + be_operation *operation = new be_operation (rt, + AST_Operation::OP_noflags, + op_name, + 0, + 0, + 0); + operation->set_name (op_name); + operation->set_defined_in (excep_holder); + + if (operation_kind == NORMAL) + { + if (orig_op) + { + // Copy the exceptions. + if (orig_op->exceptions ()) + { + UTL_ExceptList *exceptions = orig_op->exceptions (); + operation->be_add_exceptions (exceptions); + } + } + } + + // Set the proper strategy + be_operation_strategy *old_strategy = + operation->set_strategy (new be_operation_ami_exception_holder_raise_strategy (operation)); + if (old_strategy) + delete old_strategy; + + // After having generated the operation we insert it into the + // exceptionholder valuetype. + excep_holder->be_add_operation (operation); + + return 0; } /* @@ -1008,186 +1008,186 @@ return op; int be_visitor_amh_pre_proc::create_response_handler_operation (be_operation *node, -be_interface *response_handler) -{ -if (!node) -return -1; - -if (node->flags () == AST_Operation::OP_oneway) -// We do nothing for oneways! -return 0; - -// Create the return type, which is "void" -be_predefined_type *rt = new be_predefined_type (AST_PredefinedType::PT_void, -new UTL_ScopedName -(new Identifier ("void") //, 1, 0, I_FALSE) -, 0), -0); - -ACE_CString original_op_name (node -->name () -->last_component () -->get_string ()); - -UTL_ScopedName *op_name = ACE_static_cast (UTL_ScopedName *, response_handler->name ()-> copy ()); -op_name->nconc (new UTL_ScopedName ( -new Identifier ( -original_op_name.rep ()) //, 1, 0, I_FALSE), -, 0)); - -// Create the operation -be_operation *operation = new be_operation (rt, -AST_Operation::OP_noflags, -op_name, -0, -0, -0); -operation->set_name (op_name); - -// If return type is non-void add it as first argument - -if (!node->void_return_type ()) -{ - -// Create the argument -be_argument *arg = new be_argument (AST_Argument::dir_IN, -node->return_type (), -new UTL_ScopedName -(new Identifier ("return_value") //, 1, 0, I_FALSE) -, 0), -0); - -// Add the response handler to the argument list -operation->add_argument_to_scope (arg); -} - -// Iterate over the arguments and put all the out and inout arguments -// into the new method. -if (node->nmembers () > 0) -{ -// initialize an iterator to iterate thru our scope -UTL_ScopeActiveIterator *si; -ACE_NEW_RETURN (si, -UTL_ScopeActiveIterator (node, -UTL_Scope::IK_decls), -0); - -// continue until each element is visited -while (!si->is_done ()) -{ -AST_Decl *d = si->item (); -if (!d) -{ -delete si; -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_amh_pre_proc::create_response_handler_operation - " -"bad node in this scope\n"), --1); - -} -//be_decl *arg = be_decl::narrow_from_decl (d); -AST_Argument *original_arg = AST_Argument::narrow_from_decl (d); - -if (original_arg->direction () == AST_Argument::dir_INOUT || -original_arg->direction () == AST_Argument::dir_OUT) -{ -// Create the argument -be_argument *arg = new be_argument (AST_Argument::dir_IN, -original_arg->field_type (), -original_arg->name (), -0); - -operation->add_argument_to_scope (arg); -} -si->next (); -} // end of while loop -delete si; -} // end of if - -/* -// Set the proper strategy -be_operation_strategy *old_strategy = -operation->set_strategy (new be_operation_ami_handler_response_stub_strategy (operation)); -if (old_strategy) -delete old_strategy; + be_interface *response_handler) +{ + if (!node) + return -1; + + if (node->flags () == AST_Operation::OP_oneway) + // We do nothing for oneways! + return 0; + + // Create the return type, which is "void" + be_predefined_type *rt = new be_predefined_type (AST_PredefinedType::PT_void, + new UTL_ScopedName + (new Identifier ("void") //, 1, 0, I_FALSE) + , 0), + 0); + + ACE_CString original_op_name (node + ->name () + ->last_component () + ->get_string ()); + + UTL_ScopedName *op_name = ACE_static_cast (UTL_ScopedName *, response_handler->name ()-> copy ()); + op_name->nconc (new UTL_ScopedName ( + new Identifier ( + original_op_name.rep ()) //, 1, 0, I_FALSE), + , 0)); + + // Create the operation + be_operation *operation = new be_operation (rt, + AST_Operation::OP_noflags, + op_name, + 0, + 0, + 0); + operation->set_name (op_name); + + // If return type is non-void add it as first argument + + if (!node->void_return_type ()) + { + + // Create the argument + be_argument *arg = new be_argument (AST_Argument::dir_IN, + node->return_type (), + new UTL_ScopedName + (new Identifier ("return_value") //, 1, 0, I_FALSE) + , 0), + 0); + + // Add the response handler to the argument list + operation->add_argument_to_scope (arg); + } + + // Iterate over the arguments and put all the out and inout arguments + // into the new method. + if (node->nmembers () > 0) + { + // initialize an iterator to iterate thru our scope + UTL_ScopeActiveIterator *si; + ACE_NEW_RETURN (si, + UTL_ScopeActiveIterator (node, + UTL_Scope::IK_decls), + 0); + + // continue until each element is visited + while (!si->is_done ()) + { + AST_Decl *d = si->item (); + if (!d) + { + delete si; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_amh_pre_proc::create_response_handler_operation - " + "bad node in this scope\n"), + -1); + + } + //be_decl *arg = be_decl::narrow_from_decl (d); + AST_Argument *original_arg = AST_Argument::narrow_from_decl (d); + + if (original_arg->direction () == AST_Argument::dir_INOUT || + original_arg->direction () == AST_Argument::dir_OUT) + { + // Create the argument + be_argument *arg = new be_argument (AST_Argument::dir_IN, + original_arg->field_type (), + original_arg->name (), + 0); + + operation->add_argument_to_scope (arg); + } + si->next (); + } // end of while loop + delete si; + } // end of if + + /* + // Set the proper strategy + be_operation_strategy *old_strategy = + operation->set_strategy (new be_operation_ami_handler_response_stub_strategy (operation)); + if (old_strategy) + delete old_strategy; */ -operation->set_defined_in (response_handler); + operation->set_defined_in (response_handler); -// We do not copy the exceptions because the exceptions -// are delivered by the excep methods. + // We do not copy the exceptions because the exceptions + // are delivered by the excep methods. -// After having generated the operation we insert it into the -// response handler interface. -response_handler->be_add_operation (operation); + // After having generated the operation we insert it into the + // response handler interface. + response_handler->be_add_operation (operation); -return 0; + return 0; } /* -int -be_visitor_amh_pre_proc::create_excep_operation (be_operation *node, -be_interface *response_handler, -be_valuetype *excep_holder) -{ -if (!node) -return -1; - -if (node->flags () == AST_Operation::OP_oneway) -// We do nothing for oneways! -return 0; - -// Create the return type, which is "void" -be_predefined_type *rt = new be_predefined_type (AST_PredefinedType::PT_void, -new UTL_ScopedName -(new Identifier ("void", 1, 0, I_FALSE), -0), -0); - -// Create the argument -be_argument *arg = new be_argument (AST_Argument::dir_IN, -excep_holder, // is also a valuetype -new UTL_ScopedName ( -new Identifier ( -"excep_holder", 1, 0, I_FALSE), -0), -0); - -// Create the new name -// Append _execp to the name of the operation -ACE_CString original_op_name (node -->name () -->last_component () -->get_string ()); -ACE_CString new_op_name = original_op_name + ACE_CString ("_excep"); - -UTL_ScopedName *op_name = ACE_static_cast (UTL_ScopedName *, response_handler->name ()-> copy ()); -op_name->nconc (new UTL_ScopedName -(new Identifier -(new_op_name.rep (), 1, 0, I_FALSE), -0)); - -// create the operation -be_operation *operation = new be_operation (rt, -AST_Operation::OP_noflags, -op_name, -0, -0, -0); -operation->set_name (op_name); -operation->add_argument_to_scope (arg); - -operation->set_defined_in (response_handler); - -// We do not copy the exceptions because the exceptions -// are delivered by the excep methods. - -// After having generated the operation we insert it into the -// response handler interface. -response_handler->be_add_operation (operation); - -return 0; -} + int + be_visitor_amh_pre_proc::create_excep_operation (be_operation *node, + be_interface *response_handler, + be_valuetype *excep_holder) + { + if (!node) + return -1; + + if (node->flags () == AST_Operation::OP_oneway) + // We do nothing for oneways! + return 0; + + // Create the return type, which is "void" + be_predefined_type *rt = new be_predefined_type (AST_PredefinedType::PT_void, + new UTL_ScopedName + (new Identifier ("void", 1, 0, I_FALSE), + 0), + 0); + + // Create the argument + be_argument *arg = new be_argument (AST_Argument::dir_IN, + excep_holder, // is also a valuetype + new UTL_ScopedName ( + new Identifier ( + "excep_holder", 1, 0, I_FALSE), + 0), + 0); + + // Create the new name + // Append _execp to the name of the operation + ACE_CString original_op_name (node + ->name () + ->last_component () + ->get_string ()); + ACE_CString new_op_name = original_op_name + ACE_CString ("_excep"); + + UTL_ScopedName *op_name = ACE_static_cast (UTL_ScopedName *, response_handler->name ()-> copy ()); + op_name->nconc (new UTL_ScopedName + (new Identifier + (new_op_name.rep (), 1, 0, I_FALSE), + 0)); + + // create the operation + be_operation *operation = new be_operation (rt, + AST_Operation::OP_noflags, + op_name, + 0, + 0, + 0); + operation->set_name (op_name); + operation->add_argument_to_scope (arg); + + operation->set_defined_in (response_handler); + + // We do not copy the exceptions because the exceptions + // are delivered by the excep methods. + + // After having generated the operation we insert it into the + // response handler interface. + response_handler->be_add_operation (operation); + + return 0; + } */ // visit the scope and its elements @@ -1195,101 +1195,101 @@ int be_visitor_amh_pre_proc::visit_scope (be_scope *node) { -// proceed if the number of members in our scope is greater than 0 -if (node->nmembers () > 0) -{ -int number_of_elements = 0; - -{ -// initialize an iterator to iterate thru our scope -UTL_ScopeActiveIterator *si; -ACE_NEW_RETURN (si, -UTL_ScopeActiveIterator (node, -UTL_Scope::IK_decls), --1); - -while (!si->is_done ()) -{ -number_of_elements++; -si->next (); -} -delete si; -} - -AST_Decl **elements = new AST_Decl *[number_of_elements]; - -{ -int position = 0; -// initialize an iterator to iterate thru our scope -UTL_ScopeActiveIterator *si; -ACE_NEW_RETURN (si, -UTL_ScopeActiveIterator (node, -UTL_Scope::IK_decls), --1); - -while (!si->is_done ()) -{ -elements[position++] = si->item (); -si->next (); -} -delete si; -} - - -int elem_number = 0; - -// continue until each element is visited -while (elem_number < number_of_elements) -{ -AST_Decl *d = elements[elem_number]; -if (!d) -{ -delete [] elements; -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_scope::visit_scope - " -"bad node in this scope\n"), -1); - -} - -be_decl *bd = be_decl::narrow_from_decl (d); - -// set the scope node as "node" in which the code is being -// generated so that elements in the node's scope can use it -// for code generation -this->ctx_->scope (node->decl ()); - -// set the node to be visited -this->ctx_->node (bd); -elem_number++; - - -// Send the visitor. -if (bd == 0 || bd->accept (this) == -1) -{ -delete [] elements; -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_scope::visit_scope - " -"codegen for scope failed\n"), -1); - -} -} // end of while loop -delete [] elements; -} // end of if -return 0; + // proceed if the number of members in our scope is greater than 0 + if (node->nmembers () > 0) + { + int number_of_elements = 0; + + { + // initialize an iterator to iterate thru our scope + UTL_ScopeActiveIterator *si; + ACE_NEW_RETURN (si, + UTL_ScopeActiveIterator (node, + UTL_Scope::IK_decls), + -1); + + while (!si->is_done ()) + { + number_of_elements++; + si->next (); + } + delete si; + } + + AST_Decl **elements = new AST_Decl *[number_of_elements]; + + { + int position = 0; + // initialize an iterator to iterate thru our scope + UTL_ScopeActiveIterator *si; + ACE_NEW_RETURN (si, + UTL_ScopeActiveIterator (node, + UTL_Scope::IK_decls), + -1); + + while (!si->is_done ()) + { + elements[position++] = si->item (); + si->next (); + } + delete si; + } + + + int elem_number = 0; + + // continue until each element is visited + while (elem_number < number_of_elements) + { + AST_Decl *d = elements[elem_number]; + if (!d) + { + delete [] elements; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_scope::visit_scope - " + "bad node in this scope\n"), -1); + + } + + be_decl *bd = be_decl::narrow_from_decl (d); + + // set the scope node as "node" in which the code is being + // generated so that elements in the node's scope can use it + // for code generation + this->ctx_->scope (node->decl ()); + + // set the node to be visited + this->ctx_->node (bd); + elem_number++; + + + // Send the visitor. + if (bd == 0 || bd->accept (this) == -1) + { + delete [] elements; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_scope::visit_scope - " + "codegen for scope failed\n"), -1); + + } + } // end of while loop + delete [] elements; + } // end of if + return 0; } // Helper methods int be_visitor_amh_pre_proc::generate_name (ACE_CString &destination, -const char *prefix, -const char *middle_name, -const char *suffix) + const char *prefix, + const char *middle_name, + const char *suffix) { -destination = prefix; -destination += middle_name; -destination += suffix; -return 0; + destination = prefix; + destination += middle_name; + destination += suffix; + return 0; } @@ -1297,66 +1297,66 @@ return 0; be_operation * be_visitor_amh_pre_proc::generate_get_operation (be_attribute *node) { -ACE_CString original_op_name (node -->name () -->last_component () -->get_string ()); -ACE_CString new_op_name = ACE_CString ("get_") + original_op_name; + ACE_CString original_op_name (node + ->name () + ->last_component () + ->get_string ()); + ACE_CString new_op_name = ACE_CString ("get_") + original_op_name; -UTL_ScopedName *get_name = ACE_static_cast (UTL_ScopedName *, -node->name ()-> copy ()); -get_name->last_component ()->replace_string (new_op_name.rep ()); + UTL_ScopedName *get_name = ACE_static_cast (UTL_ScopedName *, + node->name ()-> copy ()); + get_name->last_component ()->replace_string (new_op_name.rep ()); -be_operation *operation = -new be_operation (node->field_type (), -AST_Operation::OP_noflags, -get_name, -0, -0, -0); -operation->set_name (get_name); -operation->set_defined_in (node->defined_in ()); + be_operation *operation = + new be_operation (node->field_type (), + AST_Operation::OP_noflags, + get_name, + 0, + 0, + 0); + operation->set_name (get_name); + operation->set_defined_in (node->defined_in ()); -return operation; + return operation; } be_operation * be_visitor_amh_pre_proc::generate_set_operation (be_attribute *node) { -ACE_CString original_op_name (node -->name () -->last_component () -->get_string ()); -ACE_CString new_op_name = ACE_CString ("set_") + original_op_name; - -UTL_ScopedName *set_name = ACE_static_cast (UTL_ScopedName *, -node->name ()-> copy ()); -set_name->last_component ()->replace_string (new_op_name.rep ()); - -// the return type is "void" -be_predefined_type *rt = new be_predefined_type (AST_PredefinedType::PT_void, -new UTL_ScopedName -(new Identifier -("void"), 0), -0); - -// argument type is the same as the attribute type -be_argument *arg = new be_argument (AST_Argument::dir_IN, -node->field_type (), -set_name, -0); -arg->set_name (node->name ()); - -// create the operation -be_operation *operation = new be_operation (rt, -AST_Operation::OP_noflags, -set_name, -0, -0, -0); -operation->set_name (set_name); -operation->set_defined_in (node->defined_in ()); -operation->add_argument_to_scope (arg); - -return operation; + ACE_CString original_op_name (node + ->name () + ->last_component () + ->get_string ()); + ACE_CString new_op_name = ACE_CString ("set_") + original_op_name; + + UTL_ScopedName *set_name = ACE_static_cast (UTL_ScopedName *, + node->name ()-> copy ()); + set_name->last_component ()->replace_string (new_op_name.rep ()); + + // the return type is "void" + be_predefined_type *rt = new be_predefined_type (AST_PredefinedType::PT_void, + new UTL_ScopedName + (new Identifier + ("void"), 0), + 0); + + // argument type is the same as the attribute type + be_argument *arg = new be_argument (AST_Argument::dir_IN, + node->field_type (), + set_name, + 0); + arg->set_name (node->name ()); + + // create the operation + be_operation *operation = new be_operation (rt, + AST_Operation::OP_noflags, + set_name, + 0, + 0, + 0); + operation->set_name (set_name); + operation->set_defined_in (node->defined_in ()); + operation->add_argument_to_scope (arg); + + return operation; } diff --git a/TAO/TAO_IDL/be/be_visitor_factory.cpp b/TAO/TAO_IDL/be/be_visitor_factory.cpp index bcfd061c5c5..b2b91d27be4 100644 --- a/TAO/TAO_IDL/be/be_visitor_factory.cpp +++ b/TAO/TAO_IDL/be/be_visitor_factory.cpp @@ -50,8 +50,8 @@ ACE_RCSID(be, be_visitor_factory, "$Id$") -// The BASE abstract visitor factory -TAO_Visitor_Factory::TAO_Visitor_Factory (void) + // The BASE abstract visitor factory + TAO_Visitor_Factory::TAO_Visitor_Factory (void) { } @@ -79,463 +79,463 @@ TAO_Common_Visitor_Factory::~TAO_Common_Visitor_Factory (void) be_visitor * TAO_Common_Visitor_Factory::make_visitor (be_visitor_context *ctx) { -TAO_CodeGen::CG_STATE st = ctx->state (); -// create a new context so that ownership issues are not confused. This newly -// created context is a copy of what was sent by the caller. The newly -// created visitor will own this new copy. -be_visitor_context *new_ctx = new be_visitor_context (*ctx); -switch (st) -{ -case TAO_CodeGen::TAO_ROOT_CH: -return new be_visitor_root_ch (new_ctx); -case TAO_CodeGen::TAO_ROOT_CI: -return new be_visitor_root_ci (new_ctx); -case TAO_CodeGen::TAO_ROOT_CS: -return new be_visitor_root_cs (new_ctx); -case TAO_CodeGen::TAO_ROOT_SH: -return new be_visitor_root_sh (new_ctx); -case TAO_CodeGen::TAO_ROOT_SI: -return new be_visitor_root_si (new_ctx); -case TAO_CodeGen::TAO_ROOT_SS: -return new be_visitor_root_ss (new_ctx); -case TAO_CodeGen::TAO_ROOT_IH: -return new be_visitor_root_ih (new_ctx); -case TAO_CodeGen::TAO_ROOT_IS: -return new be_visitor_root_is (new_ctx); -case TAO_CodeGen::TAO_ROOT_ANY_OP_CH: -case TAO_CodeGen::TAO_ROOT_ANY_OP_CS: -// this is the starting point for generation of all Any operators. If we -// have the any support enabled, then go ahead -if (be_global->any_support ()) -return new be_visitor_root_any_op (new_ctx); -else -// return a NO_OP visitor -return new be_visitor_decl (new_ctx); - -case TAO_CodeGen::TAO_ROOT_CDR_OP_CH: -case TAO_CodeGen::TAO_ROOT_CDR_OP_CI: -case TAO_CodeGen::TAO_ROOT_CDR_OP_CS: -return new be_visitor_root_cdr_op (new_ctx); - -case TAO_CodeGen::TAO_MODULE_CH: -return new be_visitor_module_ch (new_ctx); - -case TAO_CodeGen::TAO_MODULE_SH: -return new be_visitor_module_sh (new_ctx); - -case TAO_CodeGen::TAO_MODULE_IH: -return new be_visitor_module_ih (new_ctx); + TAO_CodeGen::CG_STATE st = ctx->state (); + // create a new context so that ownership issues are not confused. This newly + // created context is a copy of what was sent by the caller. The newly + // created visitor will own this new copy. + be_visitor_context *new_ctx = new be_visitor_context (*ctx); + switch (st) + { + case TAO_CodeGen::TAO_ROOT_CH: + return new be_visitor_root_ch (new_ctx); + case TAO_CodeGen::TAO_ROOT_CI: + return new be_visitor_root_ci (new_ctx); + case TAO_CodeGen::TAO_ROOT_CS: + return new be_visitor_root_cs (new_ctx); + case TAO_CodeGen::TAO_ROOT_SH: + return new be_visitor_root_sh (new_ctx); + case TAO_CodeGen::TAO_ROOT_SI: + return new be_visitor_root_si (new_ctx); + case TAO_CodeGen::TAO_ROOT_SS: + return new be_visitor_root_ss (new_ctx); + case TAO_CodeGen::TAO_ROOT_IH: + return new be_visitor_root_ih (new_ctx); + case TAO_CodeGen::TAO_ROOT_IS: + return new be_visitor_root_is (new_ctx); + case TAO_CodeGen::TAO_ROOT_ANY_OP_CH: + case TAO_CodeGen::TAO_ROOT_ANY_OP_CS: + // this is the starting point for generation of all Any operators. If we + // have the any support enabled, then go ahead + if (be_global->any_support ()) + return new be_visitor_root_any_op (new_ctx); + else + // return a NO_OP visitor + return new be_visitor_decl (new_ctx); + + case TAO_CodeGen::TAO_ROOT_CDR_OP_CH: + case TAO_CodeGen::TAO_ROOT_CDR_OP_CI: + case TAO_CodeGen::TAO_ROOT_CDR_OP_CS: + return new be_visitor_root_cdr_op (new_ctx); + + case TAO_CodeGen::TAO_MODULE_CH: + return new be_visitor_module_ch (new_ctx); + + case TAO_CodeGen::TAO_MODULE_SH: + return new be_visitor_module_sh (new_ctx); + + case TAO_CodeGen::TAO_MODULE_IH: + return new be_visitor_module_ih (new_ctx); + + case TAO_CodeGen::TAO_MODULE_CI: + case TAO_CodeGen::TAO_MODULE_CS: + case TAO_CodeGen::TAO_MODULE_SI: + case TAO_CodeGen::TAO_MODULE_SS: + case TAO_CodeGen::TAO_MODULE_IS: + return new be_visitor_module (new_ctx); + + case TAO_CodeGen::TAO_MODULE_ANY_OP_CH: + case TAO_CodeGen::TAO_MODULE_ANY_OP_CS: + return new be_visitor_module_any_op (new_ctx); + + case TAO_CodeGen::TAO_MODULE_CDR_OP_CH: + case TAO_CodeGen::TAO_MODULE_CDR_OP_CI: + case TAO_CodeGen::TAO_MODULE_CDR_OP_CS: + return new be_visitor_module_cdr_op (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_CH: + return new be_visitor_interface_ch (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_CI: + return new be_visitor_interface_ci (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_CS: + return new be_visitor_interface_cs (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_SH: + return new be_visitor_interface_sh (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_IH: + return new be_visitor_interface_ih (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_SI: + return new be_visitor_interface_si (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_SS: + return new be_visitor_interface_ss (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_IS: + return new be_visitor_interface_is (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH: + return new be_visitor_interface_proxy_brokers_ch (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH: + return new be_visitor_interface_base_proxy_broker_ch (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH: + return new be_visitor_interface_remote_proxy_broker_ch (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS: + return new be_visitor_interface_remote_proxy_broker_cs (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH: + return new be_visitor_interface_strategized_proxy_broker_sh (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS: + return new be_visitor_interface_strategized_proxy_broker_ss (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH: + return new be_visitor_interface_proxy_impls_ch (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH: + return new be_visitor_interface_base_proxy_impl_ch (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH: + return new be_visitor_interface_remote_proxy_impl_ch (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS: + return new be_visitor_interface_remote_proxy_impl_cs (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH: + return new be_visitor_interface_thru_poa_proxy_impl_sh (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS: + return new be_visitor_interface_thru_poa_proxy_impl_ss (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH: + return new be_visitor_interface_direct_proxy_impl_sh (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS: + return new be_visitor_interface_direct_proxy_impl_ss (new_ctx); + + // Old Collocation Stuff. + + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH: + return new be_visitor_interface_thru_poa_collocated_sh (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS: + return new be_visitor_interface_thru_poa_collocated_ss (new_ctx); -case TAO_CodeGen::TAO_MODULE_CI: -case TAO_CodeGen::TAO_MODULE_CS: -case TAO_CodeGen::TAO_MODULE_SI: -case TAO_CodeGen::TAO_MODULE_SS: -case TAO_CodeGen::TAO_MODULE_IS: -return new be_visitor_module (new_ctx); - -case TAO_CodeGen::TAO_MODULE_ANY_OP_CH: -case TAO_CodeGen::TAO_MODULE_ANY_OP_CS: -return new be_visitor_module_any_op (new_ctx); - -case TAO_CodeGen::TAO_MODULE_CDR_OP_CH: -case TAO_CodeGen::TAO_MODULE_CDR_OP_CI: -case TAO_CodeGen::TAO_MODULE_CDR_OP_CS: -return new be_visitor_module_cdr_op (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_CH: -return new be_visitor_interface_ch (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_CI: -return new be_visitor_interface_ci (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_CS: -return new be_visitor_interface_cs (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_SH: -return new be_visitor_interface_sh (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_IH: -return new be_visitor_interface_ih (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_SI: -return new be_visitor_interface_si (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_SS: -return new be_visitor_interface_ss (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_IS: -return new be_visitor_interface_is (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH: -return new be_visitor_interface_proxy_brokers_ch (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH: -return new be_visitor_interface_base_proxy_broker_ch (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH: -return new be_visitor_interface_remote_proxy_broker_ch (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS: -return new be_visitor_interface_remote_proxy_broker_cs (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH: -return new be_visitor_interface_strategized_proxy_broker_sh (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS: -return new be_visitor_interface_strategized_proxy_broker_ss (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH: -return new be_visitor_interface_proxy_impls_ch (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH: -return new be_visitor_interface_base_proxy_impl_ch (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH: -return new be_visitor_interface_remote_proxy_impl_ch (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS: -return new be_visitor_interface_remote_proxy_impl_cs (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH: -return new be_visitor_interface_thru_poa_proxy_impl_sh (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS: -return new be_visitor_interface_thru_poa_proxy_impl_ss (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH: -return new be_visitor_interface_direct_proxy_impl_sh (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS: -return new be_visitor_interface_direct_proxy_impl_ss (new_ctx); - -// Old Collocation Stuff. - -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH: -return new be_visitor_interface_thru_poa_collocated_sh (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS: -return new be_visitor_interface_thru_poa_collocated_ss (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH: -return new be_visitor_interface_direct_collocated_sh (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: -return new be_visitor_interface_direct_collocated_ss (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH: -return new be_visitor_interface_any_op_ch (new_ctx); -case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS: -return new be_visitor_interface_any_op_cs (new_ctx); -case TAO_CodeGen::TAO_INTERFACE_TIE_SH: -return new be_visitor_interface_tie_sh (new_ctx); -case TAO_CodeGen::TAO_INTERFACE_TIE_SI: -return new be_visitor_interface_tie_si (new_ctx); -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH: -return new be_visitor_interface_cdr_op_ch (new_ctx); -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI: -return new be_visitor_interface_cdr_op_ci (new_ctx); -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS: -return new be_visitor_interface_cdr_op_cs (new_ctx); -case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: -return new be_visitor_interface_smart_proxy_ch (new_ctx); -case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: -return new be_visitor_interface_smart_proxy_cs (new_ctx); -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: -return new be_visitor_interface_interceptors_ch (new_ctx); -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: -return new be_visitor_interface_interceptors_cs (new_ctx); -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: -return new be_visitor_interface_interceptors_sh (new_ctx); -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: -return new be_visitor_interface_interceptors_ss (new_ctx); -case TAO_CodeGen::TAO_INTERFACE_FWD_CH: -return new be_visitor_interface_fwd_ch (new_ctx); -case TAO_CodeGen::TAO_INTERFACE_FWD_CI: -return new be_visitor_interface_fwd_ci (new_ctx); - -case TAO_CodeGen::TAO_INTERFACE_FWD_CDR_OP_CH: -return new be_visitor_interface_fwd_cdr_op_ch (new_ctx); -case TAO_CodeGen::TAO_INTERFACE_FWD_CDR_OP_CI: -return new be_visitor_interface_fwd_cdr_op_ci (new_ctx); -case TAO_CodeGen::TAO_INTERFACE_FWD_CDR_OP_CS: -return new be_visitor_decl (new_ctx); // noop -case TAO_CodeGen::TAO_INTERFACE_FWD_ANY_OP_CH: -return new be_visitor_interface_fwd_any_op_ch (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH: + return new be_visitor_interface_direct_collocated_sh (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: + return new be_visitor_interface_direct_collocated_ss (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH: + return new be_visitor_interface_any_op_ch (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS: + return new be_visitor_interface_any_op_cs (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_TIE_SH: + return new be_visitor_interface_tie_sh (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_TIE_SI: + return new be_visitor_interface_tie_si (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH: + return new be_visitor_interface_cdr_op_ch (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI: + return new be_visitor_interface_cdr_op_ci (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS: + return new be_visitor_interface_cdr_op_cs (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: + return new be_visitor_interface_smart_proxy_ch (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: + return new be_visitor_interface_smart_proxy_cs (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: + return new be_visitor_interface_interceptors_ch (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: + return new be_visitor_interface_interceptors_cs (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: + return new be_visitor_interface_interceptors_sh (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: + return new be_visitor_interface_interceptors_ss (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_FWD_CH: + return new be_visitor_interface_fwd_ch (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_FWD_CI: + return new be_visitor_interface_fwd_ci (new_ctx); + + case TAO_CodeGen::TAO_INTERFACE_FWD_CDR_OP_CH: + return new be_visitor_interface_fwd_cdr_op_ch (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_FWD_CDR_OP_CI: + return new be_visitor_interface_fwd_cdr_op_ci (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_FWD_CDR_OP_CS: + return new be_visitor_decl (new_ctx); // noop + case TAO_CodeGen::TAO_INTERFACE_FWD_ANY_OP_CH: + return new be_visitor_interface_fwd_any_op_ch (new_ctx); # ifdef IDL_HAS_VALUETYPE -case TAO_CodeGen::TAO_VALUETYPE_CH: -return new be_visitor_valuetype_ch (new_ctx); -case TAO_CodeGen::TAO_VALUETYPE_CS: -return new be_visitor_valuetype_cs (new_ctx); -case TAO_CodeGen::TAO_VALUETYPE_CI: -return new be_visitor_valuetype_ci (new_ctx); + case TAO_CodeGen::TAO_VALUETYPE_CH: + return new be_visitor_valuetype_ch (new_ctx); + case TAO_CodeGen::TAO_VALUETYPE_CS: + return new be_visitor_valuetype_cs (new_ctx); + case TAO_CodeGen::TAO_VALUETYPE_CI: + return new be_visitor_valuetype_ci (new_ctx); #if 0 -case TAO_CodeGen::TAO_VALUETYPE_FWD_CH: -return new be_visitor_valuetype_fwd_ch (new_ctx); -case TAO_CodeGen::TAO_VALUETYPE_FWD_CI: -return new be_visitor_valuetype_fwd_ci (new_ctx); + case TAO_CodeGen::TAO_VALUETYPE_FWD_CH: + return new be_visitor_valuetype_fwd_ch (new_ctx); + case TAO_CodeGen::TAO_VALUETYPE_FWD_CI: + return new be_visitor_valuetype_fwd_ci (new_ctx); #endif /* 0 */ -case TAO_CodeGen::TAO_VALUETYPE_OBV_CH: -return new be_visitor_valuetype_obv_ch (new_ctx); -case TAO_CodeGen::TAO_VALUETYPE_OBV_CI: -return new be_visitor_valuetype_obv_ci (new_ctx); -case TAO_CodeGen::TAO_VALUETYPE_OBV_CS: -return new be_visitor_valuetype_obv_cs (new_ctx); - -case TAO_CodeGen::TAO_FIELD_OBV_CH: -return new be_visitor_valuetype_field_ch (new_ctx); - -case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_IMPL_CH: -case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_IMPL_CS: -case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_CH: -case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_OBV_CH: -return new be_visitor_obv_operation_arglist (new_ctx); - -case TAO_CodeGen::TAO_MODULE_OBV_CH: -case TAO_CodeGen::TAO_MODULE_OBV_CI: -case TAO_CodeGen::TAO_MODULE_OBV_CS: -return new be_visitor_obv_module (new_ctx); - -case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CH: -return new be_visitor_valuetype_cdr_op_ch (new_ctx); -case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CI: -return new be_visitor_valuetype_cdr_op_ci (new_ctx); -case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CS: -return new be_visitor_decl (new_ctx); // noop - -case TAO_CodeGen::TAO_VALUETYPE_ANY_OP_CH: -case TAO_CodeGen::TAO_VALUETYPE_ANY_OP_CS: -return new be_visitor_decl (new_ctx); // @@ TODO + case TAO_CodeGen::TAO_VALUETYPE_OBV_CH: + return new be_visitor_valuetype_obv_ch (new_ctx); + case TAO_CodeGen::TAO_VALUETYPE_OBV_CI: + return new be_visitor_valuetype_obv_ci (new_ctx); + case TAO_CodeGen::TAO_VALUETYPE_OBV_CS: + return new be_visitor_valuetype_obv_cs (new_ctx); + + case TAO_CodeGen::TAO_FIELD_OBV_CH: + return new be_visitor_valuetype_field_ch (new_ctx); + + case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_IMPL_CH: + case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_IMPL_CS: + case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_CH: + case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_OBV_CH: + return new be_visitor_obv_operation_arglist (new_ctx); + + case TAO_CodeGen::TAO_MODULE_OBV_CH: + case TAO_CodeGen::TAO_MODULE_OBV_CI: + case TAO_CodeGen::TAO_MODULE_OBV_CS: + return new be_visitor_obv_module (new_ctx); + + case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CH: + return new be_visitor_valuetype_cdr_op_ch (new_ctx); + case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CI: + return new be_visitor_valuetype_cdr_op_ci (new_ctx); + case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CS: + return new be_visitor_decl (new_ctx); // noop + + case TAO_CodeGen::TAO_VALUETYPE_ANY_OP_CH: + case TAO_CodeGen::TAO_VALUETYPE_ANY_OP_CS: + return new be_visitor_decl (new_ctx); // @@ TODO # endif /* IDL_HAS_VALUETYPE */ -case TAO_CodeGen::TAO_STRUCT_CH: -return new be_visitor_structure_ch (new_ctx); -case TAO_CodeGen::TAO_STRUCT_CS: -return new be_visitor_structure_cs (new_ctx); -case TAO_CodeGen::TAO_STRUCT_CI: -return new be_visitor_structure_ci (new_ctx); -case TAO_CodeGen::TAO_STRUCT_ANY_OP_CH: -return new be_visitor_structure_any_op_ch (new_ctx); -case TAO_CodeGen::TAO_STRUCT_ANY_OP_CS: -return new be_visitor_structure_any_op_cs (new_ctx); -case TAO_CodeGen::TAO_STRUCT_CDR_OP_CH: -return new be_visitor_structure_cdr_op_ch (new_ctx); -case TAO_CodeGen::TAO_STRUCT_CDR_OP_CI: -return new be_visitor_structure_cdr_op_ci (new_ctx); -case TAO_CodeGen::TAO_STRUCT_CDR_OP_CS: -return new be_visitor_structure_cdr_op_cs (new_ctx); - -case TAO_CodeGen::TAO_CONSTANT_CH: -return new be_visitor_constant_ch (new_ctx); -case TAO_CodeGen::TAO_CONSTANT_CS: -return new be_visitor_constant_cs (new_ctx); - -case TAO_CodeGen::TAO_ENUM_CH: -return new be_visitor_enum_ch (new_ctx); -case TAO_CodeGen::TAO_ENUM_CS: -return new be_visitor_enum_cs (new_ctx); -case TAO_CodeGen::TAO_ENUM_ANY_OP_CH: -return new be_visitor_enum_any_op_ch (new_ctx); -case TAO_CodeGen::TAO_ENUM_ANY_OP_CS: -return new be_visitor_enum_any_op_cs (new_ctx); -case TAO_CodeGen::TAO_ENUM_CDR_OP_CH: -return new be_visitor_enum_cdr_op_ch (new_ctx); -case TAO_CodeGen::TAO_ENUM_CDR_OP_CI: -return new be_visitor_enum_cdr_op_ci (new_ctx); -case TAO_CodeGen::TAO_ENUM_CDR_OP_CS: -return new be_visitor_decl (new_ctx); - -case TAO_CodeGen::TAO_FIELD_CH: -return new be_visitor_field_ch (new_ctx); -case TAO_CodeGen::TAO_FIELD_CS: -return new be_visitor_field_cs (new_ctx); -case TAO_CodeGen::TAO_FIELD_CI: -return new be_visitor_field_ci (new_ctx); -case TAO_CodeGen::TAO_FIELD_CDR_OP_CH: -return new be_visitor_field_cdr_op_ch (new_ctx); -case TAO_CodeGen::TAO_FIELD_CDR_OP_CI: -return new be_visitor_field_cdr_op_ci (new_ctx); -case TAO_CodeGen::TAO_FIELD_CDR_OP_CS: -return new be_visitor_field_cdr_op_cs (new_ctx); - -case TAO_CodeGen::TAO_UNION_CH: -return new be_visitor_union_ch (new_ctx); -case TAO_CodeGen::TAO_UNION_CI: -return new be_visitor_union_ci (new_ctx); -case TAO_CodeGen::TAO_UNION_CS: -return new be_visitor_union_cs (new_ctx); -case TAO_CodeGen::TAO_UNION_PUBLIC_CH: -return new be_visitor_union_branch_public_ch (new_ctx); -case TAO_CodeGen::TAO_UNION_PUBLIC_CI: -return new be_visitor_union_branch_public_ci (new_ctx); -case TAO_CodeGen::TAO_UNION_PUBLIC_CS: -return new be_visitor_union_branch_public_cs (new_ctx); -case TAO_CodeGen::TAO_UNION_PUBLIC_ASSIGN_CS: -return new be_visitor_union_branch_public_assign_cs (new_ctx); -case TAO_CodeGen::TAO_UNION_PUBLIC_RESET_CS: -return new be_visitor_union_branch_public_reset_cs (new_ctx); -case TAO_CodeGen::TAO_UNION_PUBLIC_ACCESS_CS: -return new be_visitor_union_branch_public_access_cs (new_ctx); -case TAO_CodeGen::TAO_UNION_PRIVATE_CH: -return new be_visitor_union_branch_private_ch (new_ctx); -case TAO_CodeGen::TAO_UNION_DISCTYPEDEFN_CH: -return new be_visitor_union_discriminant_ch (new_ctx); -case TAO_CodeGen::TAO_UNION_DISCTYPEDEFN_CI: -return new be_visitor_union_discriminant_ci (new_ctx); -case TAO_CodeGen::TAO_UNION_DISCTYPEDEFN_CS: -return new be_visitor_union_discriminant_cs (new_ctx); -case TAO_CodeGen::TAO_UNION_ANY_OP_CH: -return new be_visitor_union_any_op_ch (new_ctx); -case TAO_CodeGen::TAO_UNION_ANY_OP_CS: -break; -case TAO_CodeGen::TAO_UNION_CDR_OP_CH: -return new be_visitor_union_cdr_op_ch (new_ctx); -case TAO_CodeGen::TAO_UNION_CDR_OP_CI: -return new be_visitor_union_cdr_op_ci (new_ctx); -case TAO_CodeGen::TAO_UNION_CDR_OP_CS: -return new be_visitor_union_cdr_op_cs (new_ctx); -case TAO_CodeGen::TAO_UNION_BRANCH_CDR_OP_CH: -return new be_visitor_union_branch_cdr_op_ch (new_ctx); -case TAO_CodeGen::TAO_UNION_BRANCH_CDR_OP_CI: -return new be_visitor_union_branch_cdr_op_ci (new_ctx); -case TAO_CodeGen::TAO_UNION_BRANCH_CDR_OP_CS: -return new be_visitor_union_branch_cdr_op_cs (new_ctx); - -case TAO_CodeGen::TAO_SEQUENCE_CH: -return new be_visitor_sequence_ch (new_ctx); -case TAO_CodeGen::TAO_SEQUENCE_CI: -return new be_visitor_sequence_ci (new_ctx); -case TAO_CodeGen::TAO_SEQUENCE_CS: -return new be_visitor_sequence_cs (new_ctx); -case TAO_CodeGen::TAO_SEQUENCE_BASE_CH: -case TAO_CodeGen::TAO_SEQUENCE_BASE_CI: -case TAO_CodeGen::TAO_SEQUENCE_BASE_CS: -return new be_visitor_sequence_base (new_ctx); -case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CH: -case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CI: -return new be_visitor_sequence_elemtype (new_ctx); -case TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CH: -case TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CI: -case TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CS: -return new be_visitor_sequence_buffer_type (new_ctx); -case TAO_CodeGen::TAO_SEQUENCE_ANY_OP_CH: -return new be_visitor_sequence_any_op_ch (new_ctx); -case TAO_CodeGen::TAO_SEQUENCE_ANY_OP_CS: -return new be_visitor_sequence_any_op_cs (new_ctx); -case TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CH: -return new be_visitor_sequence_cdr_op_ch (new_ctx); -case TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CI: -return new be_visitor_sequence_cdr_op_ci (new_ctx); -case TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CS: -return new be_visitor_sequence_cdr_op_cs (new_ctx); - -case TAO_CodeGen::TAO_TYPEDEF_CH: -return new be_visitor_typedef_ch (new_ctx); -case TAO_CodeGen::TAO_TYPEDEF_CS: -return new be_visitor_typedef_cs (new_ctx); -case TAO_CodeGen::TAO_TYPEDEF_CI: -return new be_visitor_typedef_ci (new_ctx); -case TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CH: -return new be_visitor_typedef_any_op_ch (new_ctx); -case TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CS: -return new be_visitor_typedef_any_op_cs (new_ctx); -case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CH: -return new be_visitor_typedef_cdr_op_ch (new_ctx); -case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CI: -return new be_visitor_typedef_cdr_op_ci (new_ctx); -case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CS: -return new be_visitor_typedef_cdr_op_cs (new_ctx); - -case TAO_CodeGen::TAO_TYPECODE_DECL: -// Do we need TypeCode Support? -if (be_global->tc_support ()) -return new be_visitor_typecode_decl (new_ctx); -else -// return a NO_OP visitor -return new be_visitor_decl (new_ctx); - -case TAO_CodeGen::TAO_TYPECODE_DEFN: -// Do we need TypeCode Support? -if (be_global->tc_support ()) -return new be_visitor_typecode_defn (new_ctx); -else -// return a NO_OP visitor -return new be_visitor_decl (new_ctx); - -case TAO_CodeGen::TAO_ATTRIBUTE_CH: -case TAO_CodeGen::TAO_ATTRIBUTE_CS: -case TAO_CodeGen::TAO_ATTRIBUTE_SH: -case TAO_CodeGen::TAO_ATTRIBUTE_IH: -case TAO_CodeGen::TAO_ATTRIBUTE_SS: -case TAO_CodeGen::TAO_ATTRIBUTE_IS: -case TAO_CodeGen::TAO_ATTRIBUTE_TIE_SH: -case TAO_CodeGen::TAO_ATTRIBUTE_TIE_SI: -case TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_COLLOCATED_SH: -case TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_COLLOCATED_SS: -case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SH: -case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SS: -case TAO_CodeGen::TAO_ATTRIBUTE_SMART_PROXY_CH: -case TAO_CodeGen::TAO_ATTRIBUTE_SMART_PROXY_CS: -case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_CH: -case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_CS: -case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_SH: -case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_SS: - -case TAO_CodeGen::TAO_ATTRIBUTE_BASE_PROXY_IMPL_CH: -case TAO_CodeGen::TAO_ATTRIBUTE_PROXY_IMPL_XH: -case TAO_CodeGen::TAO_ATTRIBUTE_REMOTE_PROXY_IMPL_CS: -case TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_PROXY_IMPL_SS: -case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_PROXY_IMPL_SS: -return new be_visitor_attribute (new_ctx); - -case TAO_CodeGen::TAO_EXCEPTION_CH: -return new be_visitor_exception_ch (new_ctx); -case TAO_CodeGen::TAO_EXCEPTION_CI: -return new be_visitor_exception_ci (new_ctx); -case TAO_CodeGen::TAO_EXCEPTION_CS: -return new be_visitor_exception_cs (new_ctx); -case TAO_CodeGen::TAO_EXCEPTION_CTOR_CH: -case TAO_CodeGen::TAO_EXCEPTION_CTOR_CS: -return new be_visitor_exception_ctor (new_ctx); -case TAO_CodeGen::TAO_EXCEPTION_CTOR_ASSIGN_CS: -return new be_visitor_exception_ctor_assign (new_ctx); -case TAO_CodeGen::TAO_EXCEPTION_ANY_OP_CH: -return new be_visitor_exception_any_op_ch (new_ctx); -case TAO_CodeGen::TAO_EXCEPTION_ANY_OP_CS: -return new be_visitor_exception_any_op_cs (new_ctx); -case TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CH: -return new be_visitor_exception_cdr_op_ch (new_ctx); -case TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CI: -return new be_visitor_exception_cdr_op_ci (new_ctx); -case TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CS: -return new be_visitor_exception_cdr_op_cs (new_ctx); - -case TAO_CodeGen::TAO_ARRAY_CH: -return new be_visitor_array_ch (new_ctx); -case TAO_CodeGen::TAO_ARRAY_CI: -return new be_visitor_array_ci (new_ctx); -case TAO_CodeGen::TAO_ARRAY_CS: -return new be_visitor_array_cs (new_ctx); -case TAO_CodeGen::TAO_ARRAY_ANY_OP_CH: -return new be_visitor_array_any_op_ch (new_ctx); -case TAO_CodeGen::TAO_ARRAY_ANY_OP_CS: -return new be_visitor_array_any_op_cs (new_ctx); -case TAO_CodeGen::TAO_ARRAY_CDR_OP_CH: -return new be_visitor_array_cdr_op_ch (new_ctx); -case TAO_CodeGen::TAO_ARRAY_CDR_OP_CI: -return new be_visitor_array_cdr_op_ci (new_ctx); -case TAO_CodeGen::TAO_ARRAY_CDR_OP_CS: -return new be_visitor_array_cdr_op_cs (new_ctx); -default: -// an error -delete new_ctx; -return 0; -} -return 0; + case TAO_CodeGen::TAO_STRUCT_CH: + return new be_visitor_structure_ch (new_ctx); + case TAO_CodeGen::TAO_STRUCT_CS: + return new be_visitor_structure_cs (new_ctx); + case TAO_CodeGen::TAO_STRUCT_CI: + return new be_visitor_structure_ci (new_ctx); + case TAO_CodeGen::TAO_STRUCT_ANY_OP_CH: + return new be_visitor_structure_any_op_ch (new_ctx); + case TAO_CodeGen::TAO_STRUCT_ANY_OP_CS: + return new be_visitor_structure_any_op_cs (new_ctx); + case TAO_CodeGen::TAO_STRUCT_CDR_OP_CH: + return new be_visitor_structure_cdr_op_ch (new_ctx); + case TAO_CodeGen::TAO_STRUCT_CDR_OP_CI: + return new be_visitor_structure_cdr_op_ci (new_ctx); + case TAO_CodeGen::TAO_STRUCT_CDR_OP_CS: + return new be_visitor_structure_cdr_op_cs (new_ctx); + + case TAO_CodeGen::TAO_CONSTANT_CH: + return new be_visitor_constant_ch (new_ctx); + case TAO_CodeGen::TAO_CONSTANT_CS: + return new be_visitor_constant_cs (new_ctx); + + case TAO_CodeGen::TAO_ENUM_CH: + return new be_visitor_enum_ch (new_ctx); + case TAO_CodeGen::TAO_ENUM_CS: + return new be_visitor_enum_cs (new_ctx); + case TAO_CodeGen::TAO_ENUM_ANY_OP_CH: + return new be_visitor_enum_any_op_ch (new_ctx); + case TAO_CodeGen::TAO_ENUM_ANY_OP_CS: + return new be_visitor_enum_any_op_cs (new_ctx); + case TAO_CodeGen::TAO_ENUM_CDR_OP_CH: + return new be_visitor_enum_cdr_op_ch (new_ctx); + case TAO_CodeGen::TAO_ENUM_CDR_OP_CI: + return new be_visitor_enum_cdr_op_ci (new_ctx); + case TAO_CodeGen::TAO_ENUM_CDR_OP_CS: + return new be_visitor_decl (new_ctx); + + case TAO_CodeGen::TAO_FIELD_CH: + return new be_visitor_field_ch (new_ctx); + case TAO_CodeGen::TAO_FIELD_CS: + return new be_visitor_field_cs (new_ctx); + case TAO_CodeGen::TAO_FIELD_CI: + return new be_visitor_field_ci (new_ctx); + case TAO_CodeGen::TAO_FIELD_CDR_OP_CH: + return new be_visitor_field_cdr_op_ch (new_ctx); + case TAO_CodeGen::TAO_FIELD_CDR_OP_CI: + return new be_visitor_field_cdr_op_ci (new_ctx); + case TAO_CodeGen::TAO_FIELD_CDR_OP_CS: + return new be_visitor_field_cdr_op_cs (new_ctx); + + case TAO_CodeGen::TAO_UNION_CH: + return new be_visitor_union_ch (new_ctx); + case TAO_CodeGen::TAO_UNION_CI: + return new be_visitor_union_ci (new_ctx); + case TAO_CodeGen::TAO_UNION_CS: + return new be_visitor_union_cs (new_ctx); + case TAO_CodeGen::TAO_UNION_PUBLIC_CH: + return new be_visitor_union_branch_public_ch (new_ctx); + case TAO_CodeGen::TAO_UNION_PUBLIC_CI: + return new be_visitor_union_branch_public_ci (new_ctx); + case TAO_CodeGen::TAO_UNION_PUBLIC_CS: + return new be_visitor_union_branch_public_cs (new_ctx); + case TAO_CodeGen::TAO_UNION_PUBLIC_ASSIGN_CS: + return new be_visitor_union_branch_public_assign_cs (new_ctx); + case TAO_CodeGen::TAO_UNION_PUBLIC_RESET_CS: + return new be_visitor_union_branch_public_reset_cs (new_ctx); + case TAO_CodeGen::TAO_UNION_PUBLIC_ACCESS_CS: + return new be_visitor_union_branch_public_access_cs (new_ctx); + case TAO_CodeGen::TAO_UNION_PRIVATE_CH: + return new be_visitor_union_branch_private_ch (new_ctx); + case TAO_CodeGen::TAO_UNION_DISCTYPEDEFN_CH: + return new be_visitor_union_discriminant_ch (new_ctx); + case TAO_CodeGen::TAO_UNION_DISCTYPEDEFN_CI: + return new be_visitor_union_discriminant_ci (new_ctx); + case TAO_CodeGen::TAO_UNION_DISCTYPEDEFN_CS: + return new be_visitor_union_discriminant_cs (new_ctx); + case TAO_CodeGen::TAO_UNION_ANY_OP_CH: + return new be_visitor_union_any_op_ch (new_ctx); + case TAO_CodeGen::TAO_UNION_ANY_OP_CS: + break; + case TAO_CodeGen::TAO_UNION_CDR_OP_CH: + return new be_visitor_union_cdr_op_ch (new_ctx); + case TAO_CodeGen::TAO_UNION_CDR_OP_CI: + return new be_visitor_union_cdr_op_ci (new_ctx); + case TAO_CodeGen::TAO_UNION_CDR_OP_CS: + return new be_visitor_union_cdr_op_cs (new_ctx); + case TAO_CodeGen::TAO_UNION_BRANCH_CDR_OP_CH: + return new be_visitor_union_branch_cdr_op_ch (new_ctx); + case TAO_CodeGen::TAO_UNION_BRANCH_CDR_OP_CI: + return new be_visitor_union_branch_cdr_op_ci (new_ctx); + case TAO_CodeGen::TAO_UNION_BRANCH_CDR_OP_CS: + return new be_visitor_union_branch_cdr_op_cs (new_ctx); + + case TAO_CodeGen::TAO_SEQUENCE_CH: + return new be_visitor_sequence_ch (new_ctx); + case TAO_CodeGen::TAO_SEQUENCE_CI: + return new be_visitor_sequence_ci (new_ctx); + case TAO_CodeGen::TAO_SEQUENCE_CS: + return new be_visitor_sequence_cs (new_ctx); + case TAO_CodeGen::TAO_SEQUENCE_BASE_CH: + case TAO_CodeGen::TAO_SEQUENCE_BASE_CI: + case TAO_CodeGen::TAO_SEQUENCE_BASE_CS: + return new be_visitor_sequence_base (new_ctx); + case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CH: + case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CI: + return new be_visitor_sequence_elemtype (new_ctx); + case TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CH: + case TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CI: + case TAO_CodeGen::TAO_SEQUENCE_BUFFER_TYPE_CS: + return new be_visitor_sequence_buffer_type (new_ctx); + case TAO_CodeGen::TAO_SEQUENCE_ANY_OP_CH: + return new be_visitor_sequence_any_op_ch (new_ctx); + case TAO_CodeGen::TAO_SEQUENCE_ANY_OP_CS: + return new be_visitor_sequence_any_op_cs (new_ctx); + case TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CH: + return new be_visitor_sequence_cdr_op_ch (new_ctx); + case TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CI: + return new be_visitor_sequence_cdr_op_ci (new_ctx); + case TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CS: + return new be_visitor_sequence_cdr_op_cs (new_ctx); + + case TAO_CodeGen::TAO_TYPEDEF_CH: + return new be_visitor_typedef_ch (new_ctx); + case TAO_CodeGen::TAO_TYPEDEF_CS: + return new be_visitor_typedef_cs (new_ctx); + case TAO_CodeGen::TAO_TYPEDEF_CI: + return new be_visitor_typedef_ci (new_ctx); + case TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CH: + return new be_visitor_typedef_any_op_ch (new_ctx); + case TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CS: + return new be_visitor_typedef_any_op_cs (new_ctx); + case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CH: + return new be_visitor_typedef_cdr_op_ch (new_ctx); + case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CI: + return new be_visitor_typedef_cdr_op_ci (new_ctx); + case TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CS: + return new be_visitor_typedef_cdr_op_cs (new_ctx); + + case TAO_CodeGen::TAO_TYPECODE_DECL: + // Do we need TypeCode Support? + if (be_global->tc_support ()) + return new be_visitor_typecode_decl (new_ctx); + else + // return a NO_OP visitor + return new be_visitor_decl (new_ctx); + + case TAO_CodeGen::TAO_TYPECODE_DEFN: + // Do we need TypeCode Support? + if (be_global->tc_support ()) + return new be_visitor_typecode_defn (new_ctx); + else + // return a NO_OP visitor + return new be_visitor_decl (new_ctx); + + case TAO_CodeGen::TAO_ATTRIBUTE_CH: + case TAO_CodeGen::TAO_ATTRIBUTE_CS: + case TAO_CodeGen::TAO_ATTRIBUTE_SH: + case TAO_CodeGen::TAO_ATTRIBUTE_IH: + case TAO_CodeGen::TAO_ATTRIBUTE_SS: + case TAO_CodeGen::TAO_ATTRIBUTE_IS: + case TAO_CodeGen::TAO_ATTRIBUTE_TIE_SH: + case TAO_CodeGen::TAO_ATTRIBUTE_TIE_SI: + case TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_COLLOCATED_SH: + case TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_COLLOCATED_SS: + case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SH: + case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SS: + case TAO_CodeGen::TAO_ATTRIBUTE_SMART_PROXY_CH: + case TAO_CodeGen::TAO_ATTRIBUTE_SMART_PROXY_CS: + case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_CH: + case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_CS: + case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_SH: + case TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_SS: + + case TAO_CodeGen::TAO_ATTRIBUTE_BASE_PROXY_IMPL_CH: + case TAO_CodeGen::TAO_ATTRIBUTE_PROXY_IMPL_XH: + case TAO_CodeGen::TAO_ATTRIBUTE_REMOTE_PROXY_IMPL_CS: + case TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_PROXY_IMPL_SS: + case TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_PROXY_IMPL_SS: + return new be_visitor_attribute (new_ctx); + + case TAO_CodeGen::TAO_EXCEPTION_CH: + return new be_visitor_exception_ch (new_ctx); + case TAO_CodeGen::TAO_EXCEPTION_CI: + return new be_visitor_exception_ci (new_ctx); + case TAO_CodeGen::TAO_EXCEPTION_CS: + return new be_visitor_exception_cs (new_ctx); + case TAO_CodeGen::TAO_EXCEPTION_CTOR_CH: + case TAO_CodeGen::TAO_EXCEPTION_CTOR_CS: + return new be_visitor_exception_ctor (new_ctx); + case TAO_CodeGen::TAO_EXCEPTION_CTOR_ASSIGN_CS: + return new be_visitor_exception_ctor_assign (new_ctx); + case TAO_CodeGen::TAO_EXCEPTION_ANY_OP_CH: + return new be_visitor_exception_any_op_ch (new_ctx); + case TAO_CodeGen::TAO_EXCEPTION_ANY_OP_CS: + return new be_visitor_exception_any_op_cs (new_ctx); + case TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CH: + return new be_visitor_exception_cdr_op_ch (new_ctx); + case TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CI: + return new be_visitor_exception_cdr_op_ci (new_ctx); + case TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CS: + return new be_visitor_exception_cdr_op_cs (new_ctx); + + case TAO_CodeGen::TAO_ARRAY_CH: + return new be_visitor_array_ch (new_ctx); + case TAO_CodeGen::TAO_ARRAY_CI: + return new be_visitor_array_ci (new_ctx); + case TAO_CodeGen::TAO_ARRAY_CS: + return new be_visitor_array_cs (new_ctx); + case TAO_CodeGen::TAO_ARRAY_ANY_OP_CH: + return new be_visitor_array_any_op_ch (new_ctx); + case TAO_CodeGen::TAO_ARRAY_ANY_OP_CS: + return new be_visitor_array_any_op_cs (new_ctx); + case TAO_CodeGen::TAO_ARRAY_CDR_OP_CH: + return new be_visitor_array_cdr_op_ch (new_ctx); + case TAO_CodeGen::TAO_ARRAY_CDR_OP_CI: + return new be_visitor_array_cdr_op_ci (new_ctx); + case TAO_CodeGen::TAO_ARRAY_CDR_OP_CS: + return new be_visitor_array_cdr_op_cs (new_ctx); + default: + // an error + delete new_ctx; + return 0; + } + return 0; } // The concrete visitor factory for operation visitors generating compiled @@ -553,241 +553,241 @@ TAO_Compiled_Visitor_Factory::~TAO_Compiled_Visitor_Factory (void) be_visitor * TAO_Compiled_Visitor_Factory::make_visitor (be_visitor_context *ctx) { -TAO_CodeGen::CG_STATE st = ctx->state (); -// create a new context so that ownership issues are not confused. This newly -// created context is a copy of what was sent by the caller. The newly -// created visitor will own this new copy. -be_visitor_context *new_ctx = new be_visitor_context (*ctx); - -switch (st) -{ -case TAO_CodeGen::TAO_UNION_ANY_OP_CS: -return new be_visitor_union_any_op_cs (new_ctx); -case TAO_CodeGen::TAO_OPERATION_CH: -return new be_visitor_operation_ch (new_ctx); -case TAO_CodeGen::TAO_OPERATION_CS: -return new be_visitor_operation_cs (new_ctx); -case TAO_CodeGen::TAO_OPERATION_SH: -return new be_visitor_operation_sh (new_ctx); -case TAO_CodeGen::TAO_OPERATION_SS: -return new be_visitor_operation_ss (new_ctx); -case TAO_CodeGen::TAO_OPERATION_IS: -return new be_visitor_operation_is (new_ctx); -case TAO_CodeGen::TAO_OPERATION_IH: -return new be_visitor_operation_ih (new_ctx); -case TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SH: -return new be_visitor_operation_thru_poa_collocated_sh (new_ctx); -case TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SS: -return new be_visitor_operation_thru_poa_collocated_ss (new_ctx); -case TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SH: -return new be_visitor_operation_direct_collocated_sh (new_ctx); -case TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SS: -return new be_visitor_operation_direct_collocated_ss (new_ctx); -case TAO_CodeGen::TAO_OPERATION_SMART_PROXY_CH: -return new be_visitor_operation_smart_proxy_ch (new_ctx); -case TAO_CodeGen::TAO_OPERATION_SMART_PROXY_CS: -return new be_visitor_operation_smart_proxy_cs (new_ctx); -case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CH: -return new be_visitor_operation_interceptors_ch (new_ctx); -case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CS: -return new be_visitor_operation_interceptors_cs (new_ctx); -case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_SH: -return new be_visitor_operation_interceptors_sh (new_ctx); -case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_SS: -return new be_visitor_operation_interceptors_ss (new_ctx); - -case TAO_CodeGen::TAO_OPERATION_BASE_PROXY_IMPL_CH: -return new be_visitor_operation_base_proxy_impl_ch (new_ctx); -case TAO_CodeGen::TAO_OPERATION_PROXY_IMPL_XH: -return new be_visitor_operation_proxy_impl_xh (new_ctx); - -case TAO_CodeGen::TAO_OPERATION_REMOTE_PROXY_IMPL_CS: -return new be_visitor_operation_remote_proxy_impl_cs (new_ctx); - -case TAO_CodeGen::TAO_OPERATION_THRU_POA_PROXY_IMPL_SS: -return new be_visitor_operation_thru_poa_proxy_impl_ss (new_ctx); - -case TAO_CodeGen::TAO_OPERATION_DIRECT_PROXY_IMPL_SS: -return new be_visitor_operation_direct_proxy_impl_ss (new_ctx); - -case TAO_CodeGen::TAO_OPERATION_RETTYPE_CH: -case TAO_CodeGen::TAO_OPERATION_RETTYPE_SH: -case TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS: -return new be_visitor_operation_rettype (new_ctx); - -case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_RETTYPE_CH: -return new be_visitor_operation_interceptors_info_rettype (new_ctx); - -case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS: -return new be_visitor_operation_rettype_vardecl_cs (new_ctx); - -case TAO_CodeGen::TAO_OPERATION_RETVAL_PRE_INVOKE_CS: -return new be_visitor_operation_rettype_pre_invoke_cs (new_ctx); - -case TAO_CodeGen::TAO_OPERATION_RETVAL_INVOKE_CS: -return new be_visitor_operation_rettype_marshal_ss (new_ctx); - -case TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS: -return new be_visitor_operation_rettype_return_cs (new_ctx); - -case TAO_CodeGen::TAO_OPERATION_EXCEPTLIST_CS: -return new be_visitor_operation_exceptlist_cs (new_ctx); - -case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_EXCEPTLIST: -return new be_visitor_operation_interceptors_exceptlist (new_ctx); - -case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_SS: -return new be_visitor_operation_rettype_vardecl_ss (new_ctx); - -case TAO_CodeGen::TAO_OPERATION_RETVAL_MARSHAL_SS: -return new be_visitor_operation_rettype_marshal_ss (new_ctx); - -case TAO_CodeGen::TAO_OPERATION_RETVAL_ASSIGN_SS: -return new be_visitor_operation_rettype_assign_ss (new_ctx); - -case TAO_CodeGen::TAO_OPERATION_INVOKE_ARG_LIST: -return new be_visitor_operation_inv_arglist (new_ctx); - -case TAO_CodeGen::TAO_OPERATION_ARGLIST_CH: -case TAO_CodeGen::TAO_OPERATION_ARGLIST_SH: -case TAO_CodeGen::TAO_OPERATION_ARGLIST_IH: -case TAO_CodeGen::TAO_OPERATION_ARGLIST_IS: -case TAO_CodeGen::TAO_OPERATION_ARGLIST_COLLOCATED_SH: -case TAO_CodeGen::TAO_OPERATION_ARGLIST_OTHERS: - -case TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XH: -case TAO_CodeGen::TAO_OPERATION_ARGLIST_BASE_PROXY_IMPL_CH: -case TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XS: -return new be_visitor_operation_arglist (new_ctx); - -case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_CH: -case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_CS: -case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARGLIST_CH: -case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARGLIST_CS: -case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARG_INFO_CS: -case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_PARAMLIST: -case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_SH: -case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_SS: -case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARGLIST_SH: -case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARGLIST_SS: -case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARG_INFO_SS: -return new be_visitor_operation_interceptors_arglist (new_ctx); - -case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_RESULT: -return new be_visitor_operation_interceptors_result (new_ctx); - -case TAO_CodeGen::TAO_OPERATION_ARG_PRE_INVOKE_CS: -case TAO_CodeGen::TAO_OPERATION_ARG_POST_INVOKE_CS: -case TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS: -case TAO_CodeGen::TAO_OPERATION_COLLOCATED_ARG_UPCALL_SS: -case TAO_CodeGen::TAO_OPERATION_ARG_POST_UPCALL_SS: -case TAO_CodeGen::TAO_OPERATION_ARG_DECL_SS: -return new be_visitor_operation_argument (new_ctx); - -case TAO_CodeGen::TAO_OPERATION_ARG_DEMARSHAL_SS: -case TAO_CodeGen::TAO_OPERATION_ARG_MARSHAL_SS: -return new be_compiled_visitor_operation_argument_marshal (new_ctx); - -case TAO_CodeGen::TAO_OPERATION_TIE_SH: -return new be_visitor_operation_tie_sh (new_ctx); - -case TAO_CodeGen::TAO_OPERATION_TIE_SI: -return new be_visitor_operation_tie_si (new_ctx); - -case TAO_CodeGen::TAO_OPERATION_ARG_INVOKE_CS: -return new be_compiled_visitor_operation_argument_invoke (new_ctx); - -case TAO_CodeGen::TAO_ARGUMENT_ARGLIST_CH: -case TAO_CodeGen::TAO_ARGUMENT_ARGLIST_SH: -case TAO_CodeGen::TAO_ARGUMENT_ARGLIST_OTHERS: -return new be_visitor_args_arglist (new_ctx); - -case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_ARGLIST_CH: -return new be_visitor_args_request_info_ch (new_ctx); -case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_INFO_ARGLIST_CH: -return new be_visitor_args_request_info_arglist (new_ctx); -case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_ARGLIST_CS: -case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_INFO_ARGLIST_CS: -return new be_visitor_args_request_info_cs (new_ctx); -case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_PARAMLIST: -return new be_visitor_args_paramlist (new_ctx); -case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_RESULT: -return new be_visitor_args_request_info_result (new_ctx); -case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_ARGLIST_SH: -return new be_visitor_args_request_info_sh (new_ctx); -case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_ARGLIST_SS: -case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_INFO_ARGLIST_SS: -return new be_visitor_args_request_info_ss (new_ctx); - -case TAO_CodeGen::TAO_ARGUMENT_PRE_INVOKE_CS: -return new be_visitor_args_pre_invoke_cs (new_ctx); - -case TAO_CodeGen::TAO_ARGUMENT_INVOKE_CS: -return new be_visitor_args_invoke_cs (new_ctx); - -case TAO_CodeGen::TAO_ARGUMENT_POST_INVOKE_CS: -return new be_visitor_args_post_invoke_cs (new_ctx); - -case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: -return new be_visitor_args_vardecl_ss (new_ctx); - -case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: -case TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS: -return new be_visitor_args_upcall_ss (new_ctx); - -case TAO_CodeGen::TAO_ARGUMENT_DEMARSHAL_SS: -case TAO_CodeGen::TAO_ARGUMENT_MARSHAL_SS: -return new be_visitor_args_marshal_ss (new_ctx); - -// AMI next generation visitors. -case TAO_CodeGen::TAO_AMI_INTERFACE_CH: -return new be_visitor_ami_interface_ch (new_ctx); - -case TAO_CodeGen::TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CH: -return new be_visitor_operation_ami_handler_reply_stub_operation_ch (new_ctx); - -case TAO_CodeGen::TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CS: -return new be_compiled_visitor_operation_ami_handler_reply_stub_operation_cs (new_ctx); - -case TAO_CodeGen::TAO_AMI_SENDC_OPERATION_CH: -return new be_visitor_operation_ami_ch (new_ctx); - -case TAO_CodeGen::TAO_AMI_SENDC_OPERATION_CS: -return new be_compiled_visitor_operation_ami_cs (new_ctx); - -case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_RAISE_OPERATION_CS: -return new be_visitor_operation_ami_exception_holder_operation_cs (new_ctx); - -case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_VALUETYPE_CH: -return new be_visitor_valuetype_ami_exception_holder_ch (new_ctx); - -case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_VALUETYPE_CS: -return new be_visitor_valuetype_ami_exception_holder_cs (new_ctx); - -// AMH next generation visitors -case TAO_CodeGen::TAO_INTERFACE_AMH_SH: -return new be_visitor_amh_interface_sh (new_ctx); -case TAO_CodeGen::TAO_INTERFACE_AMH_SS: -return new be_visitor_amh_interface_ss (new_ctx); -case TAO_CodeGen::TAO_OPERATION_AMH_SH: -return new be_visitor_amh_operation_sh (new_ctx); -case TAO_CodeGen::TAO_OPERATION_AMH_SS: -return new be_visitor_amh_operation_ss (new_ctx); -// AMH ResponseHandler class visitors -case TAO_CodeGen::TAO_INTERFACE_AMH_RH_SH: -return new be_visitor_amh_rh_interface_sh (new_ctx); -case TAO_CodeGen::TAO_INTERFACE_AMH_RH_SS: -return new be_visitor_amh_rh_interface_ss (new_ctx); -case TAO_CodeGen::TAO_OPERATION_AMH_RH_SH: -return new be_visitor_amh_rh_operation_sh (new_ctx); -case TAO_CodeGen::TAO_OPERATION_AMH_RH_SS: -return new be_visitor_amh_rh_operation_ss (new_ctx); - -default: -// cannot handle it; delegate it to the common visitor factory -delete new_ctx; -return TAO_COMMON_VISITOR_FACTORY::instance ()->make_visitor (ctx); -} + TAO_CodeGen::CG_STATE st = ctx->state (); + // create a new context so that ownership issues are not confused. This newly + // created context is a copy of what was sent by the caller. The newly + // created visitor will own this new copy. + be_visitor_context *new_ctx = new be_visitor_context (*ctx); + + switch (st) + { + case TAO_CodeGen::TAO_UNION_ANY_OP_CS: + return new be_visitor_union_any_op_cs (new_ctx); + case TAO_CodeGen::TAO_OPERATION_CH: + return new be_visitor_operation_ch (new_ctx); + case TAO_CodeGen::TAO_OPERATION_CS: + return new be_visitor_operation_cs (new_ctx); + case TAO_CodeGen::TAO_OPERATION_SH: + return new be_visitor_operation_sh (new_ctx); + case TAO_CodeGen::TAO_OPERATION_SS: + return new be_visitor_operation_ss (new_ctx); + case TAO_CodeGen::TAO_OPERATION_IS: + return new be_visitor_operation_is (new_ctx); + case TAO_CodeGen::TAO_OPERATION_IH: + return new be_visitor_operation_ih (new_ctx); + case TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SH: + return new be_visitor_operation_thru_poa_collocated_sh (new_ctx); + case TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SS: + return new be_visitor_operation_thru_poa_collocated_ss (new_ctx); + case TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SH: + return new be_visitor_operation_direct_collocated_sh (new_ctx); + case TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SS: + return new be_visitor_operation_direct_collocated_ss (new_ctx); + case TAO_CodeGen::TAO_OPERATION_SMART_PROXY_CH: + return new be_visitor_operation_smart_proxy_ch (new_ctx); + case TAO_CodeGen::TAO_OPERATION_SMART_PROXY_CS: + return new be_visitor_operation_smart_proxy_cs (new_ctx); + case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CH: + return new be_visitor_operation_interceptors_ch (new_ctx); + case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CS: + return new be_visitor_operation_interceptors_cs (new_ctx); + case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_SH: + return new be_visitor_operation_interceptors_sh (new_ctx); + case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_SS: + return new be_visitor_operation_interceptors_ss (new_ctx); + + case TAO_CodeGen::TAO_OPERATION_BASE_PROXY_IMPL_CH: + return new be_visitor_operation_base_proxy_impl_ch (new_ctx); + case TAO_CodeGen::TAO_OPERATION_PROXY_IMPL_XH: + return new be_visitor_operation_proxy_impl_xh (new_ctx); + + case TAO_CodeGen::TAO_OPERATION_REMOTE_PROXY_IMPL_CS: + return new be_visitor_operation_remote_proxy_impl_cs (new_ctx); + + case TAO_CodeGen::TAO_OPERATION_THRU_POA_PROXY_IMPL_SS: + return new be_visitor_operation_thru_poa_proxy_impl_ss (new_ctx); + + case TAO_CodeGen::TAO_OPERATION_DIRECT_PROXY_IMPL_SS: + return new be_visitor_operation_direct_proxy_impl_ss (new_ctx); + + case TAO_CodeGen::TAO_OPERATION_RETTYPE_CH: + case TAO_CodeGen::TAO_OPERATION_RETTYPE_SH: + case TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS: + return new be_visitor_operation_rettype (new_ctx); + + case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_RETTYPE_CH: + return new be_visitor_operation_interceptors_info_rettype (new_ctx); + + case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS: + return new be_visitor_operation_rettype_vardecl_cs (new_ctx); + + case TAO_CodeGen::TAO_OPERATION_RETVAL_PRE_INVOKE_CS: + return new be_visitor_operation_rettype_pre_invoke_cs (new_ctx); + + case TAO_CodeGen::TAO_OPERATION_RETVAL_INVOKE_CS: + return new be_visitor_operation_rettype_marshal_ss (new_ctx); + + case TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS: + return new be_visitor_operation_rettype_return_cs (new_ctx); + + case TAO_CodeGen::TAO_OPERATION_EXCEPTLIST_CS: + return new be_visitor_operation_exceptlist_cs (new_ctx); + + case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_EXCEPTLIST: + return new be_visitor_operation_interceptors_exceptlist (new_ctx); + + case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_SS: + return new be_visitor_operation_rettype_vardecl_ss (new_ctx); + + case TAO_CodeGen::TAO_OPERATION_RETVAL_MARSHAL_SS: + return new be_visitor_operation_rettype_marshal_ss (new_ctx); + + case TAO_CodeGen::TAO_OPERATION_RETVAL_ASSIGN_SS: + return new be_visitor_operation_rettype_assign_ss (new_ctx); + + case TAO_CodeGen::TAO_OPERATION_INVOKE_ARG_LIST: + return new be_visitor_operation_inv_arglist (new_ctx); + + case TAO_CodeGen::TAO_OPERATION_ARGLIST_CH: + case TAO_CodeGen::TAO_OPERATION_ARGLIST_SH: + case TAO_CodeGen::TAO_OPERATION_ARGLIST_IH: + case TAO_CodeGen::TAO_OPERATION_ARGLIST_IS: + case TAO_CodeGen::TAO_OPERATION_ARGLIST_COLLOCATED_SH: + case TAO_CodeGen::TAO_OPERATION_ARGLIST_OTHERS: + + case TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XH: + case TAO_CodeGen::TAO_OPERATION_ARGLIST_BASE_PROXY_IMPL_CH: + case TAO_CodeGen::TAO_OPERATION_ARGLIST_PROXY_IMPL_XS: + return new be_visitor_operation_arglist (new_ctx); + + case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_CH: + case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_CS: + case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARGLIST_CH: + case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARGLIST_CS: + case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARG_INFO_CS: + case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_PARAMLIST: + case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_SH: + case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_INFO_ARGLIST_SS: + case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARGLIST_SH: + case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARGLIST_SS: + case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_ARG_INFO_SS: + return new be_visitor_operation_interceptors_arglist (new_ctx); + + case TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_RESULT: + return new be_visitor_operation_interceptors_result (new_ctx); + + case TAO_CodeGen::TAO_OPERATION_ARG_PRE_INVOKE_CS: + case TAO_CodeGen::TAO_OPERATION_ARG_POST_INVOKE_CS: + case TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS: + case TAO_CodeGen::TAO_OPERATION_COLLOCATED_ARG_UPCALL_SS: + case TAO_CodeGen::TAO_OPERATION_ARG_POST_UPCALL_SS: + case TAO_CodeGen::TAO_OPERATION_ARG_DECL_SS: + return new be_visitor_operation_argument (new_ctx); + + case TAO_CodeGen::TAO_OPERATION_ARG_DEMARSHAL_SS: + case TAO_CodeGen::TAO_OPERATION_ARG_MARSHAL_SS: + return new be_compiled_visitor_operation_argument_marshal (new_ctx); + + case TAO_CodeGen::TAO_OPERATION_TIE_SH: + return new be_visitor_operation_tie_sh (new_ctx); + + case TAO_CodeGen::TAO_OPERATION_TIE_SI: + return new be_visitor_operation_tie_si (new_ctx); + + case TAO_CodeGen::TAO_OPERATION_ARG_INVOKE_CS: + return new be_compiled_visitor_operation_argument_invoke (new_ctx); + + case TAO_CodeGen::TAO_ARGUMENT_ARGLIST_CH: + case TAO_CodeGen::TAO_ARGUMENT_ARGLIST_SH: + case TAO_CodeGen::TAO_ARGUMENT_ARGLIST_OTHERS: + return new be_visitor_args_arglist (new_ctx); + + case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_ARGLIST_CH: + return new be_visitor_args_request_info_ch (new_ctx); + case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_INFO_ARGLIST_CH: + return new be_visitor_args_request_info_arglist (new_ctx); + case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_ARGLIST_CS: + case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_INFO_ARGLIST_CS: + return new be_visitor_args_request_info_cs (new_ctx); + case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_PARAMLIST: + return new be_visitor_args_paramlist (new_ctx); + case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_RESULT: + return new be_visitor_args_request_info_result (new_ctx); + case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_ARGLIST_SH: + return new be_visitor_args_request_info_sh (new_ctx); + case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_ARGLIST_SS: + case TAO_CodeGen::TAO_ARGUMENT_INTERCEPTORS_INFO_ARGLIST_SS: + return new be_visitor_args_request_info_ss (new_ctx); + + case TAO_CodeGen::TAO_ARGUMENT_PRE_INVOKE_CS: + return new be_visitor_args_pre_invoke_cs (new_ctx); + + case TAO_CodeGen::TAO_ARGUMENT_INVOKE_CS: + return new be_visitor_args_invoke_cs (new_ctx); + + case TAO_CodeGen::TAO_ARGUMENT_POST_INVOKE_CS: + return new be_visitor_args_post_invoke_cs (new_ctx); + + case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: + return new be_visitor_args_vardecl_ss (new_ctx); + + case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: + case TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS: + return new be_visitor_args_upcall_ss (new_ctx); + + case TAO_CodeGen::TAO_ARGUMENT_DEMARSHAL_SS: + case TAO_CodeGen::TAO_ARGUMENT_MARSHAL_SS: + return new be_visitor_args_marshal_ss (new_ctx); + + // AMI next generation visitors. + case TAO_CodeGen::TAO_AMI_INTERFACE_CH: + return new be_visitor_ami_interface_ch (new_ctx); + + case TAO_CodeGen::TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CH: + return new be_visitor_operation_ami_handler_reply_stub_operation_ch (new_ctx); + + case TAO_CodeGen::TAO_AMI_HANDLER_REPLY_STUB_OPERATION_CS: + return new be_compiled_visitor_operation_ami_handler_reply_stub_operation_cs (new_ctx); + + case TAO_CodeGen::TAO_AMI_SENDC_OPERATION_CH: + return new be_visitor_operation_ami_ch (new_ctx); + + case TAO_CodeGen::TAO_AMI_SENDC_OPERATION_CS: + return new be_compiled_visitor_operation_ami_cs (new_ctx); + + case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_RAISE_OPERATION_CS: + return new be_visitor_operation_ami_exception_holder_operation_cs (new_ctx); + + case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_VALUETYPE_CH: + return new be_visitor_valuetype_ami_exception_holder_ch (new_ctx); + + case TAO_CodeGen::TAO_AMI_EXCEPTION_HOLDER_VALUETYPE_CS: + return new be_visitor_valuetype_ami_exception_holder_cs (new_ctx); + + // AMH next generation visitors + case TAO_CodeGen::TAO_INTERFACE_AMH_SH: + return new be_visitor_amh_interface_sh (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_AMH_SS: + return new be_visitor_amh_interface_ss (new_ctx); + case TAO_CodeGen::TAO_OPERATION_AMH_SH: + return new be_visitor_amh_operation_sh (new_ctx); + case TAO_CodeGen::TAO_OPERATION_AMH_SS: + return new be_visitor_amh_operation_ss (new_ctx); + // AMH ResponseHandler class visitors + case TAO_CodeGen::TAO_INTERFACE_AMH_RH_SH: + return new be_visitor_amh_rh_interface_sh (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_AMH_RH_SS: + return new be_visitor_amh_rh_interface_ss (new_ctx); + case TAO_CodeGen::TAO_OPERATION_AMH_RH_SH: + return new be_visitor_amh_rh_operation_sh (new_ctx); + case TAO_CodeGen::TAO_OPERATION_AMH_RH_SS: + return new be_visitor_amh_rh_operation_ss (new_ctx); + + default: + // cannot handle it; delegate it to the common visitor factory + delete new_ctx; + return TAO_COMMON_VISITOR_FACTORY::instance ()->make_visitor (ctx); + } } #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) diff --git a/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp index 7a8109613a1..51c4ce682e2 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/amh_sh.cpp @@ -17,7 +17,7 @@ #include "be_visitor_interface.h" be_visitor_amh_interface_sh::be_visitor_amh_interface_sh (be_visitor_context *ctx) -: be_visitor_interface_sh (ctx) + : be_visitor_interface_sh (ctx) { } @@ -28,19 +28,19 @@ be_visitor_amh_interface_sh::~be_visitor_amh_interface_sh (void) void be_visitor_amh_interface_sh::this_method (be_interface *node) { -TAO_OutStream *os = this->ctx_->stream (); - -ACE_CString non_amh_name = " "; -non_amh_name += node->client_enclosing_scope (); -non_amh_name += node->original_interface ()->local_name (); - -// Print out the _this() method. -*os << "// Special _this method for AMH! \n" -<< non_amh_name.c_str () << " *_this (" << be_idt << be_idt_nl -<< "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl -<< "TAO_default_environment ()" -<< be_uidt << be_uidt_nl -<< ");\n" << be_uidt_nl; + TAO_OutStream *os = this->ctx_->stream (); + + ACE_CString non_amh_name = " "; + non_amh_name += node->client_enclosing_scope (); + non_amh_name += node->original_interface ()->local_name (); + + // Print out the _this() method. + *os << "// Special _this method for AMH! \n" + << non_amh_name.c_str () << " *_this (" << be_idt << be_idt_nl + << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl + << "TAO_default_environment ()" + << be_uidt << be_uidt_nl + << ");\n" << be_uidt_nl; } @@ -48,7 +48,7 @@ non_amh_name += node->original_interface ()->local_name (); // ------------------- RH ----------------------------------------- be_visitor_amh_rh_interface_sh::be_visitor_amh_rh_interface_sh (be_visitor_context *ctx) -: be_visitor_interface_sh (ctx) + : be_visitor_interface_sh (ctx) { } @@ -56,8 +56,10 @@ be_visitor_amh_rh_interface_sh::~be_visitor_amh_rh_interface_sh (void) { } +/* void be_visitor_amh_rh_interface_sh::this_method (be_interface *node) { // No need to generate anything } +*/ diff --git a/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp index 6a74ab5330f..bcf23849187 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/amh_ss.cpp @@ -17,7 +17,7 @@ #include "be_visitor_interface.h" be_visitor_amh_interface_ss::be_visitor_amh_interface_ss (be_visitor_context *ctx) -: be_visitor_interface_ss (ctx) + : be_visitor_interface_ss (ctx) { } @@ -28,38 +28,38 @@ be_visitor_amh_interface_ss::~be_visitor_amh_interface_ss (void) void be_visitor_amh_interface_ss::this_method (be_interface *node) { -TAO_OutStream *os = this->ctx_->stream (); - -// the _this () operation -//const char *non_amh_name = node->full_name () + 4; -ACE_CString non_amh_name = " "; -non_amh_name += node->client_enclosing_scope (); -non_amh_name += node->original_interface ()->local_name (); - -*os << non_amh_name.c_str() << "*" << be_nl -<< node->full_skel_name () -<< "::_this (TAO_ENV_SINGLE_ARG_DECL)" << be_nl -<< "{" << be_idt_nl // idt = 1 -<< "TAO_Stub *stub = this->_create_stub (TAO_ENV_SINGLE_ARG_PARAMETER);" -<< be_nl -<< "ACE_CHECK_RETURN (0);" << be_nl << be_nl; + TAO_OutStream *os = this->ctx_->stream (); + + // the _this () operation + //const char *non_amh_name = node->full_name () + 4; + ACE_CString non_amh_name = " "; + non_amh_name += node->client_enclosing_scope (); + non_amh_name += node->original_interface ()->local_name (); + + *os << non_amh_name.c_str() << "*" << be_nl + << node->full_skel_name () + << "::_this (TAO_ENV_SINGLE_ARG_DECL)" << be_nl + << "{" << be_idt_nl // idt = 1 + << "TAO_Stub *stub = this->_create_stub (TAO_ENV_SINGLE_ARG_PARAMETER);" + << be_nl + << "ACE_CHECK_RETURN (0);" << be_nl << be_nl; } void be_visitor_amh_interface_ss::dispatch_method (be_interface *node) { -TAO_OutStream *os = this->ctx_->stream (); - -// now the dispatch method -*os << "void " << node->full_skel_name () << -"::_dispatch (TAO_ServerRequest &req, " << -"void *context TAO_ENV_ARG_DECL)" << be_nl; -*os << "{" << be_idt_nl; -// @todo ACE_TRY_ENV without check; -*os << "this->asynchronous_upcall_dispatch" << be_idt_nl -<< " (req, context, this TAO_ENV_ARG_PARAMETER);" << be_uidt_nl; -*os << "this->asynchronous_upcall_reply (req);" << be_uidt_nl; -*os << "}" << be_nl; + TAO_OutStream *os = this->ctx_->stream (); + + // now the dispatch method + *os << "void " << node->full_skel_name () << + "::_dispatch (TAO_ServerRequest &req, " << + "void *context TAO_ENV_ARG_DECL)" << be_nl; + *os << "{" << be_idt_nl; + // @todo ACE_TRY_ENV without check; + *os << "this->asynchronous_upcall_dispatch" << be_idt_nl + << " (req, context, this TAO_ENV_ARG_PARAMETER);" << be_uidt_nl; + *os << "this->asynchronous_upcall_reply (req);" << be_uidt_nl; + *os << "}" << be_nl; } @@ -67,7 +67,7 @@ TAO_OutStream *os = this->ctx_->stream (); // ----------------------- RH ----------------------------- be_visitor_amh_rh_interface_ss::be_visitor_amh_rh_interface_ss (be_visitor_context *ctx) -: be_visitor_interface_ss (ctx) + : be_visitor_interface_ss (ctx) { } @@ -75,7 +75,7 @@ be_visitor_amh_rh_interface_ss::~be_visitor_amh_rh_interface_ss (void) { } -void +/*void be_visitor_amh_rh_interface_ss::this_method (be_interface *node) { // No need to generate any code @@ -86,3 +86,4 @@ be_visitor_amh_rh_interface_ss::dispatch_method (be_interface *node) { // No need to generate any code } +*/ diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp index 5105299179a..d9dca9dfe45 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp @@ -27,12 +27,12 @@ ACE_RCSID(be_visitor_interface, interface, "$Id$") -// ****************************************************** -// Generic Interface visitor -// ****************************************************** + // ****************************************************** + // Generic Interface visitor + // ****************************************************** -be_visitor_interface::be_visitor_interface (be_visitor_context *ctx) -: be_visitor_scope (ctx) + be_visitor_interface::be_visitor_interface (be_visitor_context *ctx) + : be_visitor_scope (ctx) { } @@ -44,7 +44,7 @@ be_visitor_interface::~be_visitor_interface (void) int be_visitor_interface::visit_interface (be_interface *) { -return -1; + return -1; } // =all common visit methods for interface visitor @@ -53,497 +53,497 @@ return -1; int be_visitor_interface::visit_attribute (be_attribute *node) { -// instantiate a visitor context with a copy of our context. This info -// will be modified based on what type of node we are visiting -be_visitor_context ctx (*this->ctx_); -ctx.node (node); // set the node to be the node being visited. The scope is -// still the same - -// this switch is acceptable rather than having derived visitors overriding -// this method and differing only in what state they set -ACE_DEBUG ((LM_DEBUG, "%d, : %s ", this->ctx_->state () )); -switch (this->ctx_->state ()) -{ -case TAO_CodeGen::TAO_INTERFACE_CH: -ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_CH); -break; -case TAO_CodeGen::TAO_INTERFACE_CS: -ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_CS); -break; -case TAO_CodeGen::TAO_INTERFACE_SH: -ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_SH); -break; -case TAO_CodeGen::TAO_INTERFACE_IH: -ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_IH); -break; -case TAO_CodeGen::TAO_INTERFACE_SS: -ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_SS); -break; -case TAO_CodeGen::TAO_INTERFACE_IS: -ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_IS); -break; -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH: -ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_COLLOCATED_SH); -break; -case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH: -ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SH); -break; -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS: -ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_COLLOCATED_SS); -break; -case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: -ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SS); -break; -case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: -ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_SMART_PROXY_CH); -break; -case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: -ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_SMART_PROXY_CS); -break; -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: -ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_CH); -break; -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: -ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_CS); -break; -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: -ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_SH); -break; -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: -ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_SS); -break; -case TAO_CodeGen::TAO_INTERFACE_TIE_SH: -ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_TIE_SH); -break; -case TAO_CodeGen::TAO_INTERFACE_TIE_SI: -ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_TIE_SI); -break; - - -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH: -ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_BASE_PROXY_IMPL_CH); -break; - - -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH: -ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_PROXY_IMPL_XH); -break; - -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS: -ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_REMOTE_PROXY_IMPL_CS); -break; -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS: -ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_PROXY_IMPL_SS); -break; -case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS: -ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_PROXY_IMPL_SS); -break; - -// AMH stuff -case TAO_CodeGen::TAO_INTERFACE_AMH_SH: -ctx.state (TAO_CodeGen::TAO_OPERATION_AMH_SH); -break; -case TAO_CodeGen::TAO_INTERFACE_AMH_SS: -ctx.state (TAO_CodeGen::TAO_OPERATION_AMH_SS); -break; - -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CS: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SS: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CS: - -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CS: -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SS: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CS: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS: -case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH: -case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS: - - -case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH: -case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS: -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH: -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI: -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS: -case TAO_CodeGen::TAO_INTERFACE_CI: -case TAO_CodeGen::TAO_INTERFACE_SI: -return 0; // nothing to be done -default: -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_attribute - " -"Bad context state\n: " ), --1); -} -} - -be_visitor *visitor = tao_cg->make_visitor (&ctx); -if (!visitor) -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_attribute - " -"NUL visitor\n" -), -1); -} - -// let the node accept this visitor -if (node->accept (visitor) == -1) -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_attribute - " -"failed to accept visitor\n" -), -1); -} -delete visitor; -return 0; + // instantiate a visitor context with a copy of our context. This info + // will be modified based on what type of node we are visiting + be_visitor_context ctx (*this->ctx_); + ctx.node (node); // set the node to be the node being visited. The scope is + // still the same + + // this switch is acceptable rather than having derived visitors overriding + // this method and differing only in what state they set + ACE_DEBUG ((LM_DEBUG, "%d, : %s ", this->ctx_->state () )); + switch (this->ctx_->state ()) + { + case TAO_CodeGen::TAO_INTERFACE_CH: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_CH); + break; + case TAO_CodeGen::TAO_INTERFACE_CS: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_CS); + break; + case TAO_CodeGen::TAO_INTERFACE_SH: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_SH); + break; + case TAO_CodeGen::TAO_INTERFACE_IH: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_IH); + break; + case TAO_CodeGen::TAO_INTERFACE_SS: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_SS); + break; + case TAO_CodeGen::TAO_INTERFACE_IS: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_IS); + break; + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_COLLOCATED_SH); + break; + case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SH); + break; + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_COLLOCATED_SS); + break; + case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_COLLOCATED_SS); + break; + case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_SMART_PROXY_CH); + break; + case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_SMART_PROXY_CS); + break; + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_CH); + break; + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_CS); + break; + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_SH); + break; + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_INTERCEPTORS_SS); + break; + case TAO_CodeGen::TAO_INTERFACE_TIE_SH: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_TIE_SH); + break; + case TAO_CodeGen::TAO_INTERFACE_TIE_SI: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_TIE_SI); + break; + + + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_BASE_PROXY_IMPL_CH); + break; + + + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_PROXY_IMPL_XH); + break; + + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_REMOTE_PROXY_IMPL_CS); + break; + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_THRU_POA_PROXY_IMPL_SS); + break; + case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS: + ctx.state (TAO_CodeGen::TAO_ATTRIBUTE_DIRECT_PROXY_IMPL_SS); + break; + + // AMH stuff + case TAO_CodeGen::TAO_INTERFACE_AMH_SH: + ctx.state (TAO_CodeGen::TAO_OPERATION_AMH_SH); + break; + case TAO_CodeGen::TAO_INTERFACE_AMH_SS: + ctx.state (TAO_CodeGen::TAO_OPERATION_AMH_SS); + break; + + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CS: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SS: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CS: + + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CS: + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SS: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CS: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS: + case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH: + case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS: + + + case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH: + case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS: + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH: + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI: + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS: + case TAO_CodeGen::TAO_INTERFACE_CI: + case TAO_CodeGen::TAO_INTERFACE_SI: + return 0; // nothing to be done + default: + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_attribute - " + "Bad context state\n: " ), + -1); + } + } + + be_visitor *visitor = tao_cg->make_visitor (&ctx); + if (!visitor) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_attribute - " + "NUL visitor\n" + ), -1); + } + + // let the node accept this visitor + if (node->accept (visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_attribute - " + "failed to accept visitor\n" + ), -1); + } + delete visitor; + return 0; } // visit a constant int be_visitor_interface::visit_constant (be_constant *node) { -// instantiate a visitor context with a copy of our context. This info -// will be modified based on what type of node we are visiting -be_visitor_context ctx (*this->ctx_); -ctx.node (node); // set the node to be the node being visited. The scope is -// still the same - -// this switch is acceptable rather than having derived visitors overriding -// this method and differing only in what state they set - -switch (this->ctx_->state ()) -{ -case TAO_CodeGen::TAO_INTERFACE_CH: -ctx.state (TAO_CodeGen::TAO_CONSTANT_CH); -break; -case TAO_CodeGen::TAO_INTERFACE_CS: -ctx.state (TAO_CodeGen::TAO_CONSTANT_CS); -break; -case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH: -case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS: -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH: -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI: -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: -case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: -case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: -case TAO_CodeGen::TAO_INTERFACE_CI: -case TAO_CodeGen::TAO_INTERFACE_SH: -case TAO_CodeGen::TAO_INTERFACE_IH: -case TAO_CodeGen::TAO_INTERFACE_IS: -case TAO_CodeGen::TAO_INTERFACE_SI: -case TAO_CodeGen::TAO_INTERFACE_SS: -case TAO_CodeGen::TAO_INTERFACE_TIE_SH: -case TAO_CodeGen::TAO_INTERFACE_TIE_SI: - -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CS: -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SS: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CS: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS: -case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH: -case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CS: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SS: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CS: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS: - -case TAO_CodeGen::TAO_INTERFACE_AMH_SH: -case TAO_CodeGen::TAO_INTERFACE_AMH_SS: - -return 0; // nothing to be done -default: -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_constant - " -"Bad context state\n" -), -1); -} -} - -be_visitor *visitor = tao_cg->make_visitor (&ctx); -if (!visitor) -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_constant - " -"NUL visitor\n" -), -1); -} - -// let the node accept this visitor -if (node->accept (visitor) == -1) -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_constant - " -"failed to accept visitor\n" -), -1); -} -delete visitor; -return 0; + // instantiate a visitor context with a copy of our context. This info + // will be modified based on what type of node we are visiting + be_visitor_context ctx (*this->ctx_); + ctx.node (node); // set the node to be the node being visited. The scope is + // still the same + + // this switch is acceptable rather than having derived visitors overriding + // this method and differing only in what state they set + + switch (this->ctx_->state ()) + { + case TAO_CodeGen::TAO_INTERFACE_CH: + ctx.state (TAO_CodeGen::TAO_CONSTANT_CH); + break; + case TAO_CodeGen::TAO_INTERFACE_CS: + ctx.state (TAO_CodeGen::TAO_CONSTANT_CS); + break; + case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH: + case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS: + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH: + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI: + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: + case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: + case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: + case TAO_CodeGen::TAO_INTERFACE_CI: + case TAO_CodeGen::TAO_INTERFACE_SH: + case TAO_CodeGen::TAO_INTERFACE_IH: + case TAO_CodeGen::TAO_INTERFACE_IS: + case TAO_CodeGen::TAO_INTERFACE_SI: + case TAO_CodeGen::TAO_INTERFACE_SS: + case TAO_CodeGen::TAO_INTERFACE_TIE_SH: + case TAO_CodeGen::TAO_INTERFACE_TIE_SI: + + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CS: + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SS: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CS: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS: + case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH: + case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CS: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SS: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CS: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS: + + case TAO_CodeGen::TAO_INTERFACE_AMH_SH: + case TAO_CodeGen::TAO_INTERFACE_AMH_SS: + + return 0; // nothing to be done + default: + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_constant - " + "Bad context state\n" + ), -1); + } + } + + be_visitor *visitor = tao_cg->make_visitor (&ctx); + if (!visitor) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_constant - " + "NUL visitor\n" + ), -1); + } + + // let the node accept this visitor + if (node->accept (visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_constant - " + "failed to accept visitor\n" + ), -1); + } + delete visitor; + return 0; } //visit an enum int be_visitor_interface::visit_enum (be_enum *node) { -// instantiate a visitor context with a copy of our context. This info -// will be modified based on what type of node we are visiting -be_visitor_context ctx (*this->ctx_); -ctx.node (node); // set the node to be the node being visited. The scope is -// still the same - -// this switch is acceptable rather than having derived visitors overriding -// this method and differing only in what state they set - -switch (this->ctx_->state ()) -{ -case TAO_CodeGen::TAO_INTERFACE_CH: -ctx.state (TAO_CodeGen::TAO_ENUM_CH); -break; -case TAO_CodeGen::TAO_INTERFACE_CS: -ctx.state (TAO_CodeGen::TAO_ENUM_CS); -break; -case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH: -ctx.state (TAO_CodeGen::TAO_ENUM_ANY_OP_CH); -break; -case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS: -ctx.state (TAO_CodeGen::TAO_ENUM_ANY_OP_CS); -break; -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH: -ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CH); -break; -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI: -ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CI); -break; -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS: -ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CS); -break; - -case TAO_CodeGen::TAO_INTERFACE_CI: -case TAO_CodeGen::TAO_INTERFACE_SH: -case TAO_CodeGen::TAO_INTERFACE_IH: -case TAO_CodeGen::TAO_INTERFACE_IS: -case TAO_CodeGen::TAO_INTERFACE_SI: -case TAO_CodeGen::TAO_INTERFACE_SS: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: -case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: -case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: -case TAO_CodeGen::TAO_INTERFACE_TIE_SH: -case TAO_CodeGen::TAO_INTERFACE_TIE_SI: - -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CS: -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SS: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CS: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS: -case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH: -case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CS: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SS: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CS: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS: - -case TAO_CodeGen::TAO_INTERFACE_AMH_SH: -case TAO_CodeGen::TAO_INTERFACE_AMH_SS: - -return 0; // nothing to be done -default: -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_enum - " -"Bad context state\n" -), -1); -} -} - -be_visitor *visitor = tao_cg->make_visitor (&ctx); -if (!visitor) -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_enum - " -"NUL visitor\n" -), -1); -} - -// let the node accept this visitor -if (node->accept (visitor) == -1) -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_enum - " -"failed to accept visitor\n" -), -1); -} -delete visitor; -return 0; + // instantiate a visitor context with a copy of our context. This info + // will be modified based on what type of node we are visiting + be_visitor_context ctx (*this->ctx_); + ctx.node (node); // set the node to be the node being visited. The scope is + // still the same + + // this switch is acceptable rather than having derived visitors overriding + // this method and differing only in what state they set + + switch (this->ctx_->state ()) + { + case TAO_CodeGen::TAO_INTERFACE_CH: + ctx.state (TAO_CodeGen::TAO_ENUM_CH); + break; + case TAO_CodeGen::TAO_INTERFACE_CS: + ctx.state (TAO_CodeGen::TAO_ENUM_CS); + break; + case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH: + ctx.state (TAO_CodeGen::TAO_ENUM_ANY_OP_CH); + break; + case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS: + ctx.state (TAO_CodeGen::TAO_ENUM_ANY_OP_CS); + break; + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH: + ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CH); + break; + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI: + ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CI); + break; + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS: + ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CS); + break; + + case TAO_CodeGen::TAO_INTERFACE_CI: + case TAO_CodeGen::TAO_INTERFACE_SH: + case TAO_CodeGen::TAO_INTERFACE_IH: + case TAO_CodeGen::TAO_INTERFACE_IS: + case TAO_CodeGen::TAO_INTERFACE_SI: + case TAO_CodeGen::TAO_INTERFACE_SS: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: + case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: + case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: + case TAO_CodeGen::TAO_INTERFACE_TIE_SH: + case TAO_CodeGen::TAO_INTERFACE_TIE_SI: + + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CS: + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SS: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CS: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS: + case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH: + case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CS: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SS: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CS: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS: + + case TAO_CodeGen::TAO_INTERFACE_AMH_SH: + case TAO_CodeGen::TAO_INTERFACE_AMH_SS: + + return 0; // nothing to be done + default: + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_enum - " + "Bad context state\n" + ), -1); + } + } + + be_visitor *visitor = tao_cg->make_visitor (&ctx); + if (!visitor) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_enum - " + "NUL visitor\n" + ), -1); + } + + // let the node accept this visitor + if (node->accept (visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_enum - " + "failed to accept visitor\n" + ), -1); + } + delete visitor; + return 0; } // visit an exception int be_visitor_interface::visit_exception (be_exception *node) { -// instantiate a visitor context with a copy of our context. This info -// will be modified based on what type of node we are visiting -be_visitor_context ctx (*this->ctx_); -ctx.node (node); // set the node to be the node being visited. The scope is -// still the same - -// this switch is acceptable rather than having derived visitors overriding -// this method and differing only in what state they set - -switch (this->ctx_->state ()) -{ -case TAO_CodeGen::TAO_INTERFACE_CH: -ctx.state (TAO_CodeGen::TAO_EXCEPTION_CH); -break; -case TAO_CodeGen::TAO_INTERFACE_CI: -ctx.state (TAO_CodeGen::TAO_EXCEPTION_CI); -break; -case TAO_CodeGen::TAO_INTERFACE_CS: -ctx.state (TAO_CodeGen::TAO_EXCEPTION_CS); -break; -case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH: -ctx.state (TAO_CodeGen::TAO_EXCEPTION_ANY_OP_CH); -break; -case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS: -ctx.state (TAO_CodeGen::TAO_EXCEPTION_ANY_OP_CS); -break; -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH: -ctx.state (TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CH); -break; -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI: -ctx.state (TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CI); -break; -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS: -ctx.state (TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CS); -break; -case TAO_CodeGen::TAO_INTERFACE_SH: -case TAO_CodeGen::TAO_INTERFACE_IH: -case TAO_CodeGen::TAO_INTERFACE_IS: -case TAO_CodeGen::TAO_INTERFACE_SI: -case TAO_CodeGen::TAO_INTERFACE_SS: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: -case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: -case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: -case TAO_CodeGen::TAO_INTERFACE_TIE_SH: -case TAO_CodeGen::TAO_INTERFACE_TIE_SI: - -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CS: -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SS: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CS: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS: -case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH: -case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CS: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SS: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CS: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS: - -case TAO_CodeGen::TAO_INTERFACE_AMH_SH: -case TAO_CodeGen::TAO_INTERFACE_AMH_SS: - -return 0; // nothing to be done -default: -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_exception - " -"Bad context state\n" -), -1); -} -} - -be_visitor *visitor = tao_cg->make_visitor (&ctx); -if (!visitor) -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_exception - " -"NUL visitor\n" -), -1); -} - -// let the node accept this visitor -if (node->accept (visitor) == -1) -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_exception - " -"failed to accept visitor\n" -), -1); -} -delete visitor; -return 0; + // instantiate a visitor context with a copy of our context. This info + // will be modified based on what type of node we are visiting + be_visitor_context ctx (*this->ctx_); + ctx.node (node); // set the node to be the node being visited. The scope is + // still the same + + // this switch is acceptable rather than having derived visitors overriding + // this method and differing only in what state they set + + switch (this->ctx_->state ()) + { + case TAO_CodeGen::TAO_INTERFACE_CH: + ctx.state (TAO_CodeGen::TAO_EXCEPTION_CH); + break; + case TAO_CodeGen::TAO_INTERFACE_CI: + ctx.state (TAO_CodeGen::TAO_EXCEPTION_CI); + break; + case TAO_CodeGen::TAO_INTERFACE_CS: + ctx.state (TAO_CodeGen::TAO_EXCEPTION_CS); + break; + case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH: + ctx.state (TAO_CodeGen::TAO_EXCEPTION_ANY_OP_CH); + break; + case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS: + ctx.state (TAO_CodeGen::TAO_EXCEPTION_ANY_OP_CS); + break; + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH: + ctx.state (TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CH); + break; + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI: + ctx.state (TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CI); + break; + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS: + ctx.state (TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CS); + break; + case TAO_CodeGen::TAO_INTERFACE_SH: + case TAO_CodeGen::TAO_INTERFACE_IH: + case TAO_CodeGen::TAO_INTERFACE_IS: + case TAO_CodeGen::TAO_INTERFACE_SI: + case TAO_CodeGen::TAO_INTERFACE_SS: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: + case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: + case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: + case TAO_CodeGen::TAO_INTERFACE_TIE_SH: + case TAO_CodeGen::TAO_INTERFACE_TIE_SI: + + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CS: + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SS: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CS: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS: + case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH: + case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CS: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SS: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CS: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS: + + case TAO_CodeGen::TAO_INTERFACE_AMH_SH: + case TAO_CodeGen::TAO_INTERFACE_AMH_SS: + + return 0; // nothing to be done + default: + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_exception - " + "Bad context state\n" + ), -1); + } + } + + be_visitor *visitor = tao_cg->make_visitor (&ctx); + if (!visitor) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_exception - " + "NUL visitor\n" + ), -1); + } + + // let the node accept this visitor + if (node->accept (visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_exception - " + "failed to accept visitor\n" + ), -1); + } + delete visitor; + return 0; } // visit an operation @@ -551,533 +551,533 @@ int be_visitor_interface::visit_operation (be_operation *node) { -// instantiate a visitor context with a copy of our context. This info -// will be modified ased on what type of node we are visiting -be_visitor_context ctx (*this->ctx_); -ctx.node (node); // set the node to be the node being visited. The scope is -// still the same - -// this switch is acceptable rather than having derived visitors overriding -// this method and differing only in what state they set - -switch (this->ctx_->state ()) -{ -case TAO_CodeGen::TAO_INTERFACE_CH: -ctx.state (TAO_CodeGen::TAO_OPERATION_CH); -break; -case TAO_CodeGen::TAO_INTERFACE_CS: -ctx.state (TAO_CodeGen::TAO_OPERATION_CS); -break; -case TAO_CodeGen::TAO_INTERFACE_SH: -ctx.state (TAO_CodeGen::TAO_OPERATION_SH); -break; -case TAO_CodeGen::TAO_INTERFACE_IH: -ctx.state (TAO_CodeGen::TAO_OPERATION_IH); -break; -case TAO_CodeGen::TAO_INTERFACE_SS: -ctx.state (TAO_CodeGen::TAO_OPERATION_SS); -break; -case TAO_CodeGen::TAO_INTERFACE_IS: -ctx.state (TAO_CodeGen::TAO_OPERATION_IS); -break; -case TAO_CodeGen::TAO_INTERFACE_TIE_SH: -ctx.state (TAO_CodeGen::TAO_OPERATION_TIE_SH); -break; -case TAO_CodeGen::TAO_INTERFACE_TIE_SI: -ctx.state (TAO_CodeGen::TAO_OPERATION_TIE_SI); -break; -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH: -ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SH); -break; -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS: -ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SS); -break; -case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH: -ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SH); -break; -case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: -ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SS); -break; -case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: -ctx.state (TAO_CodeGen::TAO_OPERATION_SMART_PROXY_CH); -break; -case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: -ctx.state (TAO_CodeGen::TAO_OPERATION_SMART_PROXY_CS); -break; -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: -ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CH); -break; -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: -ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CS); -break; -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: -ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_SH); -break; -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: -ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_SS); -break; -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH: -ctx.state (TAO_CodeGen::TAO_OPERATION_BASE_PROXY_IMPL_CH); -break; -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH: -ctx.state (TAO_CodeGen::TAO_OPERATION_PROXY_IMPL_XH); -break; - -// AMH stuff -case TAO_CodeGen::TAO_INTERFACE_AMH_SH: -ctx.state (TAO_CodeGen::TAO_OPERATION_AMH_SH); -break; -case TAO_CodeGen::TAO_INTERFACE_AMH_SS: -return 0; // don't do anything for now -case TAO_CodeGen::TAO_INTERFACE_AMH_RH_SH: -ctx.state (TAO_CodeGen::TAO_OPERATION_AMH_RH_SH); -break; -case TAO_CodeGen::TAO_INTERFACE_AMH_RH_SS: -//ctx.state (TAO_CodeGen::TAO_OPERATION_SS); -//break; -return 0; // don't do anything for now - -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS: -ctx.state (TAO_CodeGen::TAO_OPERATION_REMOTE_PROXY_IMPL_CS); -break; - -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS: -ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_PROXY_IMPL_SS); -break; - -case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS: -ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_PROXY_IMPL_SS); -break; - -case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH: -case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS: -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH: -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI: -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS: -case TAO_CodeGen::TAO_INTERFACE_CI: -case TAO_CodeGen::TAO_INTERFACE_SI: -return 0; // nothing to be done -default: -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_operation - " -"Bad context state\n"), --1); -} -} - -// Change the state depending on the kind of node strategy -ctx.state (node->next_state (ctx.state ())); - - -// grab the appropriate visitor -be_visitor *visitor = tao_cg->make_visitor (&ctx); -if (!visitor) -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_operation - " -"NUL visitor\n" -), -1); -} - -// visit the node using this visitor -if (node->accept (visitor) == -1) -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_operation - " -"failed to accept visitor\n" -), -1); -} -delete visitor; -visitor = 0; - -// Do additional code generation is necessary. -// Note, this call is delegated to the strategy connected to -// the node. -if (node->has_extra_code_generation (ctx.state ())) -{ -// Change the state depending on the kind of node strategy -ctx.state (node->next_state (ctx.state (), 1)); - -// grab the appropriate visitor -visitor = tao_cg->make_visitor (&ctx); -if (!visitor) -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_operation - " -"NUL visitor\n" -), -1); -} - -// visit the node using this visitor -if (node->accept (visitor) == -1) -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_operation - " -"failed to accept visitor\n" -), -1); -} -delete visitor; -visitor = 0; -} - -return 0; + // instantiate a visitor context with a copy of our context. This info + // will be modified ased on what type of node we are visiting + be_visitor_context ctx (*this->ctx_); + ctx.node (node); // set the node to be the node being visited. The scope is + // still the same + + // this switch is acceptable rather than having derived visitors overriding + // this method and differing only in what state they set + + switch (this->ctx_->state ()) + { + case TAO_CodeGen::TAO_INTERFACE_CH: + ctx.state (TAO_CodeGen::TAO_OPERATION_CH); + break; + case TAO_CodeGen::TAO_INTERFACE_CS: + ctx.state (TAO_CodeGen::TAO_OPERATION_CS); + break; + case TAO_CodeGen::TAO_INTERFACE_SH: + ctx.state (TAO_CodeGen::TAO_OPERATION_SH); + break; + case TAO_CodeGen::TAO_INTERFACE_IH: + ctx.state (TAO_CodeGen::TAO_OPERATION_IH); + break; + case TAO_CodeGen::TAO_INTERFACE_SS: + ctx.state (TAO_CodeGen::TAO_OPERATION_SS); + break; + case TAO_CodeGen::TAO_INTERFACE_IS: + ctx.state (TAO_CodeGen::TAO_OPERATION_IS); + break; + case TAO_CodeGen::TAO_INTERFACE_TIE_SH: + ctx.state (TAO_CodeGen::TAO_OPERATION_TIE_SH); + break; + case TAO_CodeGen::TAO_INTERFACE_TIE_SI: + ctx.state (TAO_CodeGen::TAO_OPERATION_TIE_SI); + break; + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH: + ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SH); + break; + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS: + ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_COLLOCATED_SS); + break; + case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH: + ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SH); + break; + case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: + ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SS); + break; + case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: + ctx.state (TAO_CodeGen::TAO_OPERATION_SMART_PROXY_CH); + break; + case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: + ctx.state (TAO_CodeGen::TAO_OPERATION_SMART_PROXY_CS); + break; + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: + ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CH); + break; + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: + ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_CS); + break; + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: + ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_SH); + break; + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: + ctx.state (TAO_CodeGen::TAO_OPERATION_INTERCEPTORS_SS); + break; + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH: + ctx.state (TAO_CodeGen::TAO_OPERATION_BASE_PROXY_IMPL_CH); + break; + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH: + ctx.state (TAO_CodeGen::TAO_OPERATION_PROXY_IMPL_XH); + break; + + // AMH stuff + case TAO_CodeGen::TAO_INTERFACE_AMH_SH: + ctx.state (TAO_CodeGen::TAO_OPERATION_AMH_SH); + break; + case TAO_CodeGen::TAO_INTERFACE_AMH_SS: + return 0; // don't do anything for now + case TAO_CodeGen::TAO_INTERFACE_AMH_RH_SH: + ctx.state (TAO_CodeGen::TAO_OPERATION_AMH_RH_SH); + break; + case TAO_CodeGen::TAO_INTERFACE_AMH_RH_SS: + //ctx.state (TAO_CodeGen::TAO_OPERATION_SS); + //break; + return 0; // don't do anything for now + + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS: + ctx.state (TAO_CodeGen::TAO_OPERATION_REMOTE_PROXY_IMPL_CS); + break; + + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS: + ctx.state (TAO_CodeGen::TAO_OPERATION_THRU_POA_PROXY_IMPL_SS); + break; + + case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS: + ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_PROXY_IMPL_SS); + break; + + case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH: + case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS: + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH: + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI: + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS: + case TAO_CodeGen::TAO_INTERFACE_CI: + case TAO_CodeGen::TAO_INTERFACE_SI: + return 0; // nothing to be done + default: + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_operation - " + "Bad context state\n"), + -1); + } + } + + // Change the state depending on the kind of node strategy + ctx.state (node->next_state (ctx.state ())); + + + // grab the appropriate visitor + be_visitor *visitor = tao_cg->make_visitor (&ctx); + if (!visitor) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_operation - " + "NUL visitor\n" + ), -1); + } + + // visit the node using this visitor + if (node->accept (visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_operation - " + "failed to accept visitor\n" + ), -1); + } + delete visitor; + visitor = 0; + + // Do additional code generation is necessary. + // Note, this call is delegated to the strategy connected to + // the node. + if (node->has_extra_code_generation (ctx.state ())) + { + // Change the state depending on the kind of node strategy + ctx.state (node->next_state (ctx.state (), 1)); + + // grab the appropriate visitor + visitor = tao_cg->make_visitor (&ctx); + if (!visitor) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_operation - " + "NUL visitor\n" + ), -1); + } + + // visit the node using this visitor + if (node->accept (visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_operation - " + "failed to accept visitor\n" + ), -1); + } + delete visitor; + visitor = 0; + } + + return 0; } // Visit an structure. int be_visitor_interface::visit_structure (be_structure *node) { -// instantiate a visitor context with a copy of our context. This info -// will be modified based on what type of node we are visiting -be_visitor_context ctx (*this->ctx_); -ctx.node (node); // set the node to be the node being visited. The scope is -// still the same - -// this switch is acceptable rather than having derived visitors overriding -// this method and differing only in what state they set - -switch (this->ctx_->state ()) -{ -case TAO_CodeGen::TAO_INTERFACE_CH: -ctx.state (TAO_CodeGen::TAO_STRUCT_CH); -break; -case TAO_CodeGen::TAO_INTERFACE_CI: -ctx.state (TAO_CodeGen::TAO_STRUCT_CI); -break; -case TAO_CodeGen::TAO_INTERFACE_CS: -ctx.state (TAO_CodeGen::TAO_STRUCT_CS); -break; -case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH: -ctx.state (TAO_CodeGen::TAO_STRUCT_ANY_OP_CH); -break; -case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS: -ctx.state (TAO_CodeGen::TAO_STRUCT_ANY_OP_CS); -break; -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH: -ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CH); -break; -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI: -ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CI); -break; -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS: -ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CS); -break; -case TAO_CodeGen::TAO_INTERFACE_SH: -case TAO_CodeGen::TAO_INTERFACE_IH: -case TAO_CodeGen::TAO_INTERFACE_IS: -case TAO_CodeGen::TAO_INTERFACE_SI: -case TAO_CodeGen::TAO_INTERFACE_SS: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: -case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: -case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: -case TAO_CodeGen::TAO_INTERFACE_TIE_SH: -case TAO_CodeGen::TAO_INTERFACE_TIE_SI: - -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CS: -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SS: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CS: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS: -case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH: -case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CS: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SS: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CS: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS: - -case TAO_CodeGen::TAO_INTERFACE_AMH_SH: -case TAO_CodeGen::TAO_INTERFACE_AMH_SS: - -return 0; // nothing to be done -default: -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_structure - " -"Bad context state\n" -), -1); -} -} - -be_visitor *visitor = tao_cg->make_visitor (&ctx); -if (!visitor) -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_structure - " -"NUL visitor\n" -), -1); -} - -// let the node accept this visitor -if (node->accept (visitor) == -1) -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_structure - " -"failed to accept visitor\n" -), -1); -} -delete visitor; -return 0; + // instantiate a visitor context with a copy of our context. This info + // will be modified based on what type of node we are visiting + be_visitor_context ctx (*this->ctx_); + ctx.node (node); // set the node to be the node being visited. The scope is + // still the same + + // this switch is acceptable rather than having derived visitors overriding + // this method and differing only in what state they set + + switch (this->ctx_->state ()) + { + case TAO_CodeGen::TAO_INTERFACE_CH: + ctx.state (TAO_CodeGen::TAO_STRUCT_CH); + break; + case TAO_CodeGen::TAO_INTERFACE_CI: + ctx.state (TAO_CodeGen::TAO_STRUCT_CI); + break; + case TAO_CodeGen::TAO_INTERFACE_CS: + ctx.state (TAO_CodeGen::TAO_STRUCT_CS); + break; + case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH: + ctx.state (TAO_CodeGen::TAO_STRUCT_ANY_OP_CH); + break; + case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS: + ctx.state (TAO_CodeGen::TAO_STRUCT_ANY_OP_CS); + break; + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH: + ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CH); + break; + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI: + ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CI); + break; + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS: + ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CS); + break; + case TAO_CodeGen::TAO_INTERFACE_SH: + case TAO_CodeGen::TAO_INTERFACE_IH: + case TAO_CodeGen::TAO_INTERFACE_IS: + case TAO_CodeGen::TAO_INTERFACE_SI: + case TAO_CodeGen::TAO_INTERFACE_SS: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: + case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: + case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: + case TAO_CodeGen::TAO_INTERFACE_TIE_SH: + case TAO_CodeGen::TAO_INTERFACE_TIE_SI: + + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CS: + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SS: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CS: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS: + case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH: + case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CS: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SS: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CS: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS: + + case TAO_CodeGen::TAO_INTERFACE_AMH_SH: + case TAO_CodeGen::TAO_INTERFACE_AMH_SS: + + return 0; // nothing to be done + default: + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_structure - " + "Bad context state\n" + ), -1); + } + } + + be_visitor *visitor = tao_cg->make_visitor (&ctx); + if (!visitor) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_structure - " + "NUL visitor\n" + ), -1); + } + + // let the node accept this visitor + if (node->accept (visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_structure - " + "failed to accept visitor\n" + ), -1); + } + delete visitor; + return 0; } // visit a union int be_visitor_interface::visit_union (be_union *node) { -// instantiate a visitor context with a copy of our context. This info -// will be modified based on what type of node we are visiting -be_visitor_context ctx (*this->ctx_); -ctx.node (node); // set the node to be the node being visited. The scope is -// still the same - -// this switch is acceptable rather than having derived visitors overriding -// this method and differing only in what state they set - -switch (this->ctx_->state ()) -{ -case TAO_CodeGen::TAO_INTERFACE_CH: -ctx.state (TAO_CodeGen::TAO_UNION_CH); -break; -case TAO_CodeGen::TAO_INTERFACE_CI: -ctx.state (TAO_CodeGen::TAO_UNION_CI); -break; -case TAO_CodeGen::TAO_INTERFACE_CS: -ctx.state (TAO_CodeGen::TAO_UNION_CS); -break; -case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH: -ctx.state (TAO_CodeGen::TAO_UNION_ANY_OP_CH); -break; -case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS: -ctx.state (TAO_CodeGen::TAO_UNION_ANY_OP_CS); -break; -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH: -ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CH); -break; -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI: -ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CI); -break; -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS: -ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CS); -break; -case TAO_CodeGen::TAO_INTERFACE_SH: -case TAO_CodeGen::TAO_INTERFACE_IH: -case TAO_CodeGen::TAO_INTERFACE_IS: -case TAO_CodeGen::TAO_INTERFACE_SI: -case TAO_CodeGen::TAO_INTERFACE_SS: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: -case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: -case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: -case TAO_CodeGen::TAO_INTERFACE_TIE_SH: -case TAO_CodeGen::TAO_INTERFACE_TIE_SI: - -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CS: -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SS: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CS: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS: -case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH: -case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CS: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SS: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CS: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS: - -case TAO_CodeGen::TAO_INTERFACE_AMH_SH: -case TAO_CodeGen::TAO_INTERFACE_AMH_SS: -return 0; // nothing to be done -default: -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_union - " -"Bad context state\n" -), -1); -} -} - -be_visitor *visitor = tao_cg->make_visitor (&ctx); -if (!visitor) -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_union - " -"NUL visitor\n" -), -1); -} - -// let the node accept this visitor -if (node->accept (visitor) == -1) -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_union - " -"failed to accept visitor\n" -), -1); -} -delete visitor; -return 0; + // instantiate a visitor context with a copy of our context. This info + // will be modified based on what type of node we are visiting + be_visitor_context ctx (*this->ctx_); + ctx.node (node); // set the node to be the node being visited. The scope is + // still the same + + // this switch is acceptable rather than having derived visitors overriding + // this method and differing only in what state they set + + switch (this->ctx_->state ()) + { + case TAO_CodeGen::TAO_INTERFACE_CH: + ctx.state (TAO_CodeGen::TAO_UNION_CH); + break; + case TAO_CodeGen::TAO_INTERFACE_CI: + ctx.state (TAO_CodeGen::TAO_UNION_CI); + break; + case TAO_CodeGen::TAO_INTERFACE_CS: + ctx.state (TAO_CodeGen::TAO_UNION_CS); + break; + case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH: + ctx.state (TAO_CodeGen::TAO_UNION_ANY_OP_CH); + break; + case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS: + ctx.state (TAO_CodeGen::TAO_UNION_ANY_OP_CS); + break; + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH: + ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CH); + break; + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI: + ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CI); + break; + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS: + ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CS); + break; + case TAO_CodeGen::TAO_INTERFACE_SH: + case TAO_CodeGen::TAO_INTERFACE_IH: + case TAO_CodeGen::TAO_INTERFACE_IS: + case TAO_CodeGen::TAO_INTERFACE_SI: + case TAO_CodeGen::TAO_INTERFACE_SS: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: + case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: + case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: + case TAO_CodeGen::TAO_INTERFACE_TIE_SH: + case TAO_CodeGen::TAO_INTERFACE_TIE_SI: + + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CS: + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SS: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CS: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS: + case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH: + case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CS: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SS: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CS: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS: + + case TAO_CodeGen::TAO_INTERFACE_AMH_SH: + case TAO_CodeGen::TAO_INTERFACE_AMH_SS: + return 0; // nothing to be done + default: + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_union - " + "Bad context state\n" + ), -1); + } + } + + be_visitor *visitor = tao_cg->make_visitor (&ctx); + if (!visitor) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_union - " + "NUL visitor\n" + ), -1); + } + + // let the node accept this visitor + if (node->accept (visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_union - " + "failed to accept visitor\n" + ), -1); + } + delete visitor; + return 0; } // visit a typedef int be_visitor_interface::visit_typedef (be_typedef *node) { -// instantiate a visitor context with a copy of our context. This info -// will be modified based on what type of node we are visiting -be_visitor_context ctx (*this->ctx_); -ctx.node (node); // set the node to be the node being visited. The scope is -// still the same - -// this switch is acceptable rather than having derived visitors overriding -// this method and differing only in what state they set - -switch (this->ctx_->state ()) -{ -case TAO_CodeGen::TAO_INTERFACE_CH: -ctx.state (TAO_CodeGen::TAO_TYPEDEF_CH); -break; -case TAO_CodeGen::TAO_INTERFACE_CI: -ctx.state (TAO_CodeGen::TAO_TYPEDEF_CI); -break; -case TAO_CodeGen::TAO_INTERFACE_CS: -ctx.state (TAO_CodeGen::TAO_TYPEDEF_CS); -break; -case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH: -ctx.state (TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CH); -break; -case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS: -ctx.state (TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CS); -break; -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH: -ctx.state (TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CH); -break; -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI: -ctx.state (TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CI); -break; -case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS: -ctx.state (TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CS); -break; -case TAO_CodeGen::TAO_INTERFACE_SH: -case TAO_CodeGen::TAO_INTERFACE_IH: -case TAO_CodeGen::TAO_INTERFACE_IS: -case TAO_CodeGen::TAO_INTERFACE_SI: -case TAO_CodeGen::TAO_INTERFACE_SS: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: -case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: -case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: -case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: -case TAO_CodeGen::TAO_INTERFACE_TIE_SH: -case TAO_CodeGen::TAO_INTERFACE_TIE_SI: - -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CS: -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SS: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CS: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS: -case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH: -case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CS: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SH: -case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SS: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH: -case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CS: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH: -case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH: -case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH: -case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS: - -case TAO_CodeGen::TAO_INTERFACE_AMH_SH: -case TAO_CodeGen::TAO_INTERFACE_AMH_SS: -return 0; // nothing to be done -default: -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_typedef - " -"Bad context state\n" -), -1); -} -} - -be_visitor *visitor = tao_cg->make_visitor (&ctx); -if (!visitor) -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_typedef - " -"NUL visitor\n" -), -1); -} - -// let the node accept this visitor -if (node->accept (visitor) == -1) -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_interface::" -"visit_typedef - " -"failed to accept visitor\n" -), -1); -} -delete visitor; -return 0; + // instantiate a visitor context with a copy of our context. This info + // will be modified based on what type of node we are visiting + be_visitor_context ctx (*this->ctx_); + ctx.node (node); // set the node to be the node being visited. The scope is + // still the same + + // this switch is acceptable rather than having derived visitors overriding + // this method and differing only in what state they set + + switch (this->ctx_->state ()) + { + case TAO_CodeGen::TAO_INTERFACE_CH: + ctx.state (TAO_CodeGen::TAO_TYPEDEF_CH); + break; + case TAO_CodeGen::TAO_INTERFACE_CI: + ctx.state (TAO_CodeGen::TAO_TYPEDEF_CI); + break; + case TAO_CodeGen::TAO_INTERFACE_CS: + ctx.state (TAO_CodeGen::TAO_TYPEDEF_CS); + break; + case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH: + ctx.state (TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CH); + break; + case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS: + ctx.state (TAO_CodeGen::TAO_TYPEDEF_ANY_OP_CS); + break; + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH: + ctx.state (TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CH); + break; + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CI: + ctx.state (TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CI); + break; + case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CS: + ctx.state (TAO_CodeGen::TAO_TYPEDEF_CDR_OP_CS); + break; + case TAO_CodeGen::TAO_INTERFACE_SH: + case TAO_CodeGen::TAO_INTERFACE_IH: + case TAO_CodeGen::TAO_INTERFACE_IS: + case TAO_CodeGen::TAO_INTERFACE_SI: + case TAO_CodeGen::TAO_INTERFACE_SS: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: + case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CH: + case TAO_CodeGen::TAO_INTERFACE_SMART_PROXY_CS: + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CH: + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_CS: + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SH: + case TAO_CodeGen::TAO_INTERFACE_INTERCEPTORS_SS: + case TAO_CodeGen::TAO_INTERFACE_TIE_SH: + case TAO_CodeGen::TAO_INTERFACE_TIE_SI: + + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_CS: + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_BROKERS_SS: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CH: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_BROKER_CS: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CH: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_BROKER_CS: + case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SH: + case TAO_CodeGen::TAO_INTERFACE_STRATEGIZED_PROXY_BROKER_SS: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_CS: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SH: + case TAO_CodeGen::TAO_INTERFACE_PROXY_IMPLS_SS: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CH: + case TAO_CodeGen::TAO_INTERFACE_BASE_PROXY_IMPL_CS: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CH: + case TAO_CodeGen::TAO_INTERFACE_REMOTE_PROXY_IMPL_CS: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SH: + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_PROXY_IMPL_SS: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SH: + case TAO_CodeGen::TAO_INTERFACE_DIRECT_PROXY_IMPL_SS: + + case TAO_CodeGen::TAO_INTERFACE_AMH_SH: + case TAO_CodeGen::TAO_INTERFACE_AMH_SS: + return 0; // nothing to be done + default: + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_typedef - " + "Bad context state\n" + ), -1); + } + } + + be_visitor *visitor = tao_cg->make_visitor (&ctx); + if (!visitor) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_typedef - " + "NUL visitor\n" + ), -1); + } + + // let the node accept this visitor + if (node->accept (visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_interface::" + "visit_typedef - " + "failed to accept visitor\n" + ), -1); + } + delete visitor; + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp index be2435bf844..bdbc5763080 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/amh_sh.cpp @@ -29,12 +29,12 @@ ACE_RCSID(be_visitor_operation, operation_amh_sh, "$Id$") -// ****************************************************** -// Visitor for generating AMH skeleton for "operation" in skeleton header. -// ****************************************************** + // ****************************************************** + // Visitor for generating AMH skeleton for "operation" in skeleton header. + // ****************************************************** -be_visitor_amh_operation_sh::be_visitor_amh_operation_sh (be_visitor_context *ctx) -: be_visitor_operation (ctx) + be_visitor_amh_operation_sh::be_visitor_amh_operation_sh (be_visitor_context *ctx) + : be_visitor_operation (ctx) { } @@ -45,109 +45,109 @@ be_visitor_amh_operation_sh::~be_visitor_amh_operation_sh (void) int be_visitor_amh_operation_sh::visit_operation (be_operation *node) { -// Nothing to be done for oneway operations. -if (node->flags () == AST_Operation::OP_oneway) -{ -return 0; -} - -// Output stream. -TAO_OutStream *os = this->ctx_->stream (); -this->ctx_->node (node); - -*os << "\n// \t *** AMH operation declaration starts here ***\n"; - -be_interface *intf; -intf = this->ctx_->attribute () -? be_interface::narrow_from_scope (this->ctx_->attribute()->defined_in ()) -: be_interface::narrow_from_scope (node->defined_in ()); - -if (!intf) -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_operation_sh::" -"visit_operation - " -"bad interface scope\n"), --1); -} - -// Step 1 : Generate return type: always void -os->indent (); -*os << "virtual void "; -// only for source: *os << intf->full_skel_name () << "::"; - - -// Step 2: Generate the method name -// Check if we are an attribute node in disguise. -if (this->ctx_->attribute ()) -{ -// Now check if we are a "get" or "set" operation. -if (node->nmembers () == 1) -{ -*os << "set_"; -} -else -{ -*os << "get_"; -} -} -*os << node->local_name(); - -/* -// STEP 3: Generate the argument list with the appropriate -// mapping. For these we grab a visitor that generates the -// parameter listing. We also generate the ResponseHandler -// argument 'on the fly' and add it to the argument list - -//ACE_CString rh_name; -//ACE_OSTREAM temp; -AST_Decl *parent = ScopeAsDecl (intf->defined_in ()); -if (parent) -{ -*os << parent->name (); -} -*os << intf->local_name () ; -//<< "ResponseHandler *response_handler, "; -AST_Type *rh_field_type = new AST_Type; - -// Create the argument -Identifier *id = new Identifier ("ResponseHandler"); -UTL_IdList *list = new UTL_IdList (id, 0); -be_argument *rh_arg = new be_argument (AST_Argument::dir_IN, -rh_field_type, -list, -0); -node->add_argument_to_scope (rh_arg); -*/ - -be_visitor_context ctx (*this->ctx_); -ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_SH); -be_visitor *visitor = tao_cg->make_visitor (&ctx); - -if (!visitor) -{ -ACE_ERROR_RETURN ((LM_ERROR, -"be_visitor_operation_amh_sh::" -"visit_operation - " -"Bad visitor to return type\n"), --1); -} - -if (node->accept (visitor) == -1) -{ -delete visitor; -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_operation_sh::" -"visit_operation - " -"codegen for argument list failed\n"), --1); -} - -delete visitor; - -*os << be_nl; - -return 0; + // Nothing to be done for oneway operations. + if (node->flags () == AST_Operation::OP_oneway) + { + return 0; + } + + // Output stream. + TAO_OutStream *os = this->ctx_->stream (); + this->ctx_->node (node); + + *os << "\n// \t *** AMH operation declaration starts here ***\n"; + + be_interface *intf; + intf = this->ctx_->attribute () + ? be_interface::narrow_from_scope (this->ctx_->attribute()->defined_in ()) + : be_interface::narrow_from_scope (node->defined_in ()); + + if (!intf) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_sh::" + "visit_operation - " + "bad interface scope\n"), + -1); + } + + // Step 1 : Generate return type: always void + os->indent (); + *os << "virtual void "; + // only for source: *os << intf->full_skel_name () << "::"; + + + // Step 2: Generate the method name + // Check if we are an attribute node in disguise. + if (this->ctx_->attribute ()) + { + // Now check if we are a "get" or "set" operation. + if (node->nmembers () == 1) + { + *os << "set_"; + } + else + { + *os << "get_"; + } + } + *os << node->local_name(); + + /* + // STEP 3: Generate the argument list with the appropriate + // mapping. For these we grab a visitor that generates the + // parameter listing. We also generate the ResponseHandler + // argument 'on the fly' and add it to the argument list + + //ACE_CString rh_name; + //ACE_OSTREAM temp; + AST_Decl *parent = ScopeAsDecl (intf->defined_in ()); + if (parent) + { + *os << parent->name (); + } + *os << intf->local_name () ; + //<< "ResponseHandler *response_handler, "; + AST_Type *rh_field_type = new AST_Type; + + // Create the argument + Identifier *id = new Identifier ("ResponseHandler"); + UTL_IdList *list = new UTL_IdList (id, 0); + be_argument *rh_arg = new be_argument (AST_Argument::dir_IN, + rh_field_type, + list, + 0); + node->add_argument_to_scope (rh_arg); + */ + + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_SH); + be_visitor *visitor = tao_cg->make_visitor (&ctx); + + if (!visitor) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_operation_amh_sh::" + "visit_operation - " + "Bad visitor to return type\n"), + -1); + } + + if (node->accept (visitor) == -1) + { + delete visitor; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_sh::" + "visit_operation - " + "codegen for argument list failed\n"), + -1); + } + + delete visitor; + + *os << be_nl; + + return 0; } @@ -157,7 +157,7 @@ return 0; // ****************************************************** be_visitor_amh_rh_operation_sh::be_visitor_amh_rh_operation_sh (be_visitor_context *ctx) -: be_visitor_operation (ctx) + : be_visitor_operation (ctx) { } @@ -168,80 +168,80 @@ be_visitor_amh_rh_operation_sh::~be_visitor_amh_rh_operation_sh (void) int be_visitor_amh_rh_operation_sh::visit_operation (be_operation *node) { -// Nothing to be done for oneway operations. -if (node->flags () == AST_Operation::OP_oneway) -{ -return 0; -} - -// Output stream. -TAO_OutStream *os = this->ctx_->stream (); -this->ctx_->node (node); - -*os << "\n// \t *** AMH-RH operation declaration starts here ***\n"; - -be_interface *intf; -intf = this->ctx_->attribute () -? be_interface::narrow_from_scope (this->ctx_->attribute()->defined_in ()) -: be_interface::narrow_from_scope (node->defined_in ()); - -if (!intf) -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_operation_sh::" -"visit_operation - " -"bad interface scope\n"), --1); -} - -// Step 1 : Generate return type: always void -os->indent (); -*os << "virtual void "; -// only for source: *os << intf->full_skel_name () << "::"; - - -// Step 2: Generate the method name -// Check if we are an attribute node in disguise. -if (this->ctx_->attribute ()) -{ -// Now check if we are a "get" or "set" operation. -if (node->nmembers () == 1) -{ -*os << "set_"; -} -else -{ -*os << "get_"; -} -} -*os << node->local_name(); - -be_visitor_context ctx (*this->ctx_); -ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_SH); -be_visitor *visitor = tao_cg->make_visitor (&ctx); - -if (!visitor) -{ -ACE_ERROR_RETURN ((LM_ERROR, -"be_visitor_operation_amh_sh::" -"visit_operation - " -"Bad visitor to return type\n"), --1); -} - -if (node->accept (visitor) == -1) -{ -delete visitor; -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_operation_sh::" -"visit_operation - " -"codegen for argument list failed\n"), --1); -} - -delete visitor; - -*os << be_nl; - -return 0; + // Nothing to be done for oneway operations. + if (node->flags () == AST_Operation::OP_oneway) + { + return 0; + } + + // Output stream. + TAO_OutStream *os = this->ctx_->stream (); + this->ctx_->node (node); + + *os << "\n// \t *** AMH-RH operation declaration starts here ***\n"; + + be_interface *intf; + intf = this->ctx_->attribute () + ? be_interface::narrow_from_scope (this->ctx_->attribute()->defined_in ()) + : be_interface::narrow_from_scope (node->defined_in ()); + + if (!intf) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_sh::" + "visit_operation - " + "bad interface scope\n"), + -1); + } + + // Step 1 : Generate return type: always void + os->indent (); + *os << "virtual void "; + // only for source: *os << intf->full_skel_name () << "::"; + + + // Step 2: Generate the method name + // Check if we are an attribute node in disguise. + if (this->ctx_->attribute ()) + { + // Now check if we are a "get" or "set" operation. + if (node->nmembers () == 1) + { + *os << "set_"; + } + else + { + *os << "get_"; + } + } + *os << node->local_name(); + + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_SH); + be_visitor *visitor = tao_cg->make_visitor (&ctx); + + if (!visitor) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_operation_amh_sh::" + "visit_operation - " + "Bad visitor to return type\n"), + -1); + } + + if (node->accept (visitor) == -1) + { + delete visitor; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_sh::" + "visit_operation - " + "codegen for argument list failed\n"), + -1); + } + + delete visitor; + + *os << be_nl; + + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp index c8c85b57eb7..7218da114ed 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp @@ -17,7 +17,7 @@ #include "be_visitor_operation.h" be_visitor_amh_operation_ss::be_visitor_amh_operation_ss (be_visitor_context *ctx) -: be_visitor_operation (ctx) + : be_visitor_operation (ctx) { } @@ -28,64 +28,64 @@ be_visitor_amh_operation_ss::~be_visitor_amh_operation_ss (void) int be_visitor_amh_operation_ss::visit_operation (be_operation *node) { -this->ctx_->node (node); -TAO_OutStream *os = this->ctx_->stream (); - -// If there is an argument of type "native", return immediately. -if (node->has_native ()) -return 0; - -// We need the interface node in which this operation was defined. However, -// if this operation node was an attribute node in disguise, we get this -// information from the context -be_interface *intf; -intf = this->ctx_->attribute () -? be_interface::narrow_from_scope (this->ctx_->attribute ()->defined_in ()) -: be_interface::narrow_from_scope (node->defined_in ()); - + this->ctx_->node (node); + TAO_OutStream *os = this->ctx_->stream (); + + // If there is an argument of type "native", return immediately. + if (node->has_native ()) + return 0; + + // We need the interface node in which this operation was defined. However, + // if this operation node was an attribute node in disguise, we get this + // information from the context + be_interface *intf; + intf = this->ctx_->attribute () + ? be_interface::narrow_from_scope (this->ctx_->attribute ()->defined_in ()) + : be_interface::narrow_from_scope (node->defined_in ()); + if (!intf) -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_operation_ss::" -"visit_operation - " -"bad interface scope\n"), --1); -} - -os->indent (); -*os << "void " << intf->full_skel_name () << "::"; - -// Check if we are an attribute node in disguise -if (this->ctx_->attribute ()) -{ -// now check if we are a "get" or "set" operation -if (node->nmembers () == 1) // set -*os << "_set_"; -else -*os << "_get_"; -} - -*os << node->local_name () -<< "_skel (" << be_idt << be_idt_nl -<< "TAO_ServerRequest &_tao_server_request," << be_nl -<< "void *_tao_object_reference, " << be_nl -<< "void * /* context */ " << be_nl -<< "TAO_ENV_ARG_DECL" << be_uidt_nl -<< ")" << be_uidt_nl; - -// Generate the actual code for the skeleton. However, if any of the argument -// types is "native", we do not generate any skeleton -// last argument - is always TAO_ENV_ARG_PARAMETER. -*os << "{" << be_idt_nl; - -*os << "// foo" << be_uidt_nl; - -*os << "}" << be_nl << be_nl; - - -// see <be_visitor_operation_ss::visit_operation> for more info - -return 0; + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_ss::" + "visit_operation - " + "bad interface scope\n"), + -1); + } + + os->indent (); + *os << "void " << intf->full_skel_name () << "::"; + + // Check if we are an attribute node in disguise + if (this->ctx_->attribute ()) + { + // now check if we are a "get" or "set" operation + if (node->nmembers () == 1) // set + *os << "_set_"; + else + *os << "_get_"; + } + + *os << node->local_name () + << "_skel (" << be_idt << be_idt_nl + << "TAO_ServerRequest &_tao_server_request," << be_nl + << "void *_tao_object_reference, " << be_nl + << "void * /* context */ " << be_nl + << "TAO_ENV_ARG_DECL" << be_uidt_nl + << ")" << be_uidt_nl; + + // Generate the actual code for the skeleton. However, if any of the argument + // types is "native", we do not generate any skeleton + // last argument - is always TAO_ENV_ARG_PARAMETER. + *os << "{" << be_idt_nl; + + *os << "// foo" << be_uidt_nl; + + *os << "}" << be_nl << be_nl; + + + // see <be_visitor_operation_ss::visit_operation> for more info + + return 0; } @@ -93,7 +93,7 @@ return 0; // ------------------------- RH ------------------------------------------- be_visitor_amh_rh_operation_ss::be_visitor_amh_rh_operation_ss (be_visitor_context *ctx) -: be_visitor_operation (ctx) + : be_visitor_operation (ctx) { } @@ -104,62 +104,62 @@ be_visitor_amh_rh_operation_ss::~be_visitor_amh_rh_operation_ss (void) int be_visitor_amh_rh_operation_ss::visit_operation (be_operation *node) { -this->ctx_->node (node); -TAO_OutStream *os = this->ctx_->stream (); - -// If there is an argument of type "native", return immediately. -if (node->has_native ()) -return 0; - -// We need the interface node in which this operation was defined. However, -// if this operation node was an attribute node in disguise, we get this -// information from the context -be_interface *intf; -intf = this->ctx_->attribute () -? be_interface::narrow_from_scope (this->ctx_->attribute ()->defined_in ()) -: be_interface::narrow_from_scope (node->defined_in ()); - -if (!intf) -{ -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_operation_ss::" -"visit_operation - " -"bad interface scope\n"), --1); -} - -os->indent (); -*os << "void " << intf->full_skel_name () << "::"; - -// Check if we are an attribute node in disguise -if (this->ctx_->attribute ()) -{ -// now check if we are a "get" or "set" operation -if (node->nmembers () == 1) // set -*os << "_set_"; -else -*os << "_get_"; -} - -*os << node->local_name () -<< "_skel (" << be_idt << be_idt_nl -<< "TAO_ServerRequest &_tao_server_request," << be_nl -<< "void *_tao_object_reference, " << be_nl -<< "void * /* context */, " << be_nl -<< "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl -<< ")" << be_uidt_nl; - -// Generate the actual code for the skeleton. However, if any of the argument -// types is "native", we do not generate any skeleton -// last argument - is always CORBA::Environment. -*os << "{" << be_idt_nl; - -*os << "// foo" << be_uidt_nl; - -*os << "}" << be_nl << be_nl; - - -// see <be_visitor_operation_ss::visit_operation> for more info - -return 0; + this->ctx_->node (node); + TAO_OutStream *os = this->ctx_->stream (); + + // If there is an argument of type "native", return immediately. + if (node->has_native ()) + return 0; + + // We need the interface node in which this operation was defined. However, + // if this operation node was an attribute node in disguise, we get this + // information from the context + be_interface *intf; + intf = this->ctx_->attribute () + ? be_interface::narrow_from_scope (this->ctx_->attribute ()->defined_in ()) + : be_interface::narrow_from_scope (node->defined_in ()); + + if (!intf) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_ss::" + "visit_operation - " + "bad interface scope\n"), + -1); + } + + os->indent (); + *os << "void " << intf->full_skel_name () << "::"; + + // Check if we are an attribute node in disguise + if (this->ctx_->attribute ()) + { + // now check if we are a "get" or "set" operation + if (node->nmembers () == 1) // set + *os << "_set_"; + else + *os << "_get_"; + } + + *os << node->local_name () + << "_skel (" << be_idt << be_idt_nl + << "TAO_ServerRequest &_tao_server_request," << be_nl + << "void *_tao_object_reference, " << be_nl + << "void * /* context */, " << be_nl + << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl + << ")" << be_uidt_nl; + + // Generate the actual code for the skeleton. However, if any of the argument + // types is "native", we do not generate any skeleton + // last argument - is always CORBA::Environment. + *os << "{" << be_idt_nl; + + *os << "// foo" << be_uidt_nl; + + *os << "}" << be_nl << be_nl; + + + // see <be_visitor_operation_ss::visit_operation> for more info + + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp index 5bc63cb9691..23e83c4c5c7 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation.cpp @@ -27,12 +27,12 @@ ACE_RCSID(be_visitor_operation, operation, "$Id$") -// ************************************************************ -// Generic Operation visitor -// ************************************************************ + // ************************************************************ + // Generic Operation visitor + // ************************************************************ -be_visitor_operation::be_visitor_operation (be_visitor_context *ctx) -: be_visitor_scope (ctx) + be_visitor_operation::be_visitor_operation (be_visitor_context *ctx) + : be_visitor_scope (ctx) { } @@ -44,81 +44,81 @@ be_visitor_operation::~be_visitor_operation (void) int be_visitor_operation::void_return_type (be_type *bt) { -// is the operation return type void? - -if (bt->node_type () == AST_Decl::NT_pre_defined -&& (be_predefined_type::narrow_from_decl (bt)->pt () -== AST_PredefinedType::PT_void)) -return 1; -else -return 0; + // is the operation return type void? + + if (bt->node_type () == AST_Decl::NT_pre_defined + && (be_predefined_type::narrow_from_decl (bt)->pt () + == AST_PredefinedType::PT_void)) + return 1; + else + return 0; } int be_visitor_operation::has_param_type (be_operation *node, -AST_Argument::Direction dir) -{ -// proceed if the number of members in our scope is greater than 0 -if (node->nmembers () > 0) -{ -// initialize an iterator to iterate thru our scope -UTL_ScopeActiveIterator *si; -ACE_NEW_RETURN (si, -UTL_ScopeActiveIterator (node, -UTL_Scope::IK_decls), -0); -// continue until each element is visited -while (!si->is_done ()) -{ -be_argument *bd = be_argument::narrow_from_decl (si->item ()); -if (bd && (bd->direction () == dir)) -return 1; - -si->next (); -} // end of while loop -delete si; -} // end of if - -// not of the type we are looking for -return 0; + AST_Argument::Direction dir) +{ + // proceed if the number of members in our scope is greater than 0 + if (node->nmembers () > 0) + { + // initialize an iterator to iterate thru our scope + UTL_ScopeActiveIterator *si; + ACE_NEW_RETURN (si, + UTL_ScopeActiveIterator (node, + UTL_Scope::IK_decls), + 0); + // continue until each element is visited + while (!si->is_done ()) + { + be_argument *bd = be_argument::narrow_from_decl (si->item ()); + if (bd && (bd->direction () == dir)) + return 1; + + si->next (); + } // end of while loop + delete si; + } // end of if + + // not of the type we are looking for + return 0; } size_t be_visitor_operation::count_non_out_parameters (be_operation *node) { -size_t count = 0; + size_t count = 0; -// proceed if the number of members in our scope is greater than 0 -if (node->nmembers () > 0) -{ -// initialize an iterator to iterate thru our scope -UTL_ScopeActiveIterator *si; -ACE_NEW_RETURN (si, -UTL_ScopeActiveIterator (node, -UTL_Scope::IK_decls), -0); - -// Continue until each element is visited -while (!si->is_done ()) -{ -be_argument *bd = -be_argument::narrow_from_decl (si->item ()); + // proceed if the number of members in our scope is greater than 0 + if (node->nmembers () > 0) + { + // initialize an iterator to iterate thru our scope + UTL_ScopeActiveIterator *si; + ACE_NEW_RETURN (si, + UTL_ScopeActiveIterator (node, + UTL_Scope::IK_decls), + 0); -// We do not generate insertion operators for valuetypes -// yet. Do not include them in the count. -be_valuetype *vt = -be_valuetype::narrow_from_decl (bd->field_type ()); + // Continue until each element is visited + while (!si->is_done ()) + { + be_argument *bd = + be_argument::narrow_from_decl (si->item ()); -if (bd && (bd->direction () != AST_Argument::dir_OUT) && !vt) -count++; + // We do not generate insertion operators for valuetypes + // yet. Do not include them in the count. + be_valuetype *vt = + be_valuetype::narrow_from_decl (bd->field_type ()); -si->next (); -} + if (bd && (bd->direction () != AST_Argument::dir_OUT) && !vt) + count++; -delete si; -} + si->next (); + } + + delete si; + } -return count; + return count; } @@ -127,72 +127,72 @@ return count; int be_visitor_operation::gen_throw_spec (be_operation *node) { -TAO_OutStream *os = this->ctx_->stream (); // grab the out stream - -if (be_global->use_raw_throw ()) -*os << be_idt_nl << "throw ("; -else -*os << be_idt_nl << "ACE_THROW_SPEC (("; - -*os << be_idt_nl << "CORBA::SystemException"; -if (node->exceptions ()) -{ - -// initialize an iterator to iterate thru the exception list -UTL_ExceptlistActiveIterator *ei; -ACE_NEW_RETURN (ei, -UTL_ExceptlistActiveIterator (node->exceptions ()), --1); -// continue until each element is visited -while (!ei->is_done ()) -{ -be_exception *excp = be_exception::narrow_from_decl (ei->item ()); - -if (excp == 0) -{ -delete ei; -ACE_ERROR_RETURN ((LM_ERROR, -"(%N:%l) be_visitor_operation" -"gen_throw_spec - " -"bad exception node\n"), -1); - -} - -*os << "," << be_nl; -// allocator method -*os << excp->name (); -ei->next (); -} // end of while loop - -delete ei; -} // end of if - -if (be_global->use_raw_throw ()) -{ -*os << be_uidt_nl << ")" << be_uidt; -} -else -{ -*os << be_uidt_nl << "))" << be_uidt; -} - -return 0; + TAO_OutStream *os = this->ctx_->stream (); // grab the out stream + + if (be_global->use_raw_throw ()) + *os << be_idt_nl << "throw ("; + else + *os << be_idt_nl << "ACE_THROW_SPEC (("; + + *os << be_idt_nl << "CORBA::SystemException"; + if (node->exceptions ()) + { + + // initialize an iterator to iterate thru the exception list + UTL_ExceptlistActiveIterator *ei; + ACE_NEW_RETURN (ei, + UTL_ExceptlistActiveIterator (node->exceptions ()), + -1); + // continue until each element is visited + while (!ei->is_done ()) + { + be_exception *excp = be_exception::narrow_from_decl (ei->item ()); + + if (excp == 0) + { + delete ei; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation" + "gen_throw_spec - " + "bad exception node\n"), -1); + + } + + *os << "," << be_nl; + // allocator method + *os << excp->name (); + ei->next (); + } // end of while loop + + delete ei; + } // end of if + + if (be_global->use_raw_throw ()) + { + *os << be_uidt_nl << ")" << be_uidt; + } + else + { + *os << be_uidt_nl << "))" << be_uidt; + } + + return 0; } //Method that returns the appropriate CORBA::Environment variable const char * be_visitor_operation::gen_environment_var () { -static const char *ace_try_env_decl = "ACE_DECLARE_NEW_CORBA_ENV;"; -static const char *null_env_decl = ""; - -// check if we are generating stubs/skeletons for true C++ exception support -if (be_global->exception_support ()) -{ -return ace_try_env_decl; -} -else -{ -return null_env_decl; -} + static const char *ace_try_env_decl = "ACE_DECLARE_NEW_CORBA_ENV;"; + static const char *null_env_decl = ""; + + // check if we are generating stubs/skeletons for true C++ exception support + if (be_global->exception_support ()) + { + return ace_try_env_decl; + } + else + { + return null_env_decl; + } } |