From b10f8fc37382f4ab610702dfc8e6a3f69a0a85df Mon Sep 17 00:00:00 2001 From: parsons Date: Sun, 30 Jun 2002 22:18:16 +0000 Subject: ChangeLogTag: Sun Jun 30 17:15:52 2002 Jeff Parsons --- TAO/TAO_IDL/be/be_visitor_valuetype/arglist.cpp | 49 +++++++++++++++++++++- .../be_include/be_visitor_valuetype/arglist.h | 3 ++ 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/arglist.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/arglist.cpp index 0b984e62acb..4fc80e5de03 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/arglist.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/arglist.cpp @@ -41,6 +41,40 @@ be_visitor_obv_operation_arglist::~be_visitor_obv_operation_arglist (void) { } +int +be_visitor_obv_operation_arglist::is_amh_exception_holder (be_operation *node) +{ + UTL_Scope *scope = node->defined_in (); + be_interface *iface = be_interface::narrow_from_scope (scope); + + int is_an_amh_exception_holder = 0; + + if (iface != 0) + { + const char *amh_underbar = "AMH_"; + const char *node_name = iface->local_name (); + + if( amh_underbar[0] == node_name[0] && + amh_underbar[1] == node_name[1] && + amh_underbar[2] == node_name[2] && + amh_underbar[3] == node_name[3] + ) // node name starts with "AMH_" + { + //ACE_DEBUG ((LM_DEBUG, "Passed first test of amh_excepholder \n")); + const char *last_E = ACE_OS::strrchr (iface->full_name (), 'E'); + + if (last_E != 0 + && ACE_OS::strcmp (last_E, "ExceptionHolder") == 0) + { + //ACE_DEBUG ((LM_DEBUG, "obv_operation: Passed second test of amh_excepholder \n")); + is_an_amh_exception_holder = 1; + } + } + } + + return is_an_amh_exception_holder; +} + int be_visitor_obv_operation_arglist::visit_operation (be_operation *node) { @@ -102,8 +136,21 @@ be_visitor_obv_operation_arglist::visit_operation (be_operation *node) switch (this->ctx_->state ()) { case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_CH: + /***********************************************************/ + // 2.1 // Each method is pure virtual in the Valuetype class. - *os << " = 0;" << be_nl; + // BUT, not if it is an AMH ExceptionHolder! + /***********************************************************/ + if (is_amh_exception_holder (node)) + { + *os << "{ this->exception->_raise (); }" + << be_uidt_nl; + } + /***********************************************************/ + else + { + *os << " = 0;" << be_uidt_nl; + } break; case TAO_CodeGen::TAO_OBV_OPERATION_ARGLIST_IH: break; diff --git a/TAO/TAO_IDL/be_include/be_visitor_valuetype/arglist.h b/TAO/TAO_IDL/be_include/be_visitor_valuetype/arglist.h index e9b6747180d..9e8002f517a 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_valuetype/arglist.h +++ b/TAO/TAO_IDL/be_include/be_visitor_valuetype/arglist.h @@ -41,6 +41,9 @@ public: ~be_visitor_obv_operation_arglist (void); // destructor + int is_amh_exception_holder (be_operation *node); + // special arglist generation for amh_exceptionholders + int visit_operation (be_operation *node); // visit the operation -- cgit v1.2.1