diff options
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_operation/operation_ih.cpp')
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_operation/operation_ih.cpp | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_ih.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_ih.cpp index 872dbd8a9f6..ed375de2dfe 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ih.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_ih.cpp @@ -116,7 +116,7 @@ be_visitor_operation_ih::visit_operation (be_operation *node) delete visitor; //generate the exceptions that are thrown by the operation - this->gen_throw_spec (node); + gen_raise_exception (node); *os << ";\n\n"; @@ -124,3 +124,54 @@ be_visitor_operation_ih::visit_operation (be_operation *node) } +//Method to generate the exceptions that are thrown by the operation +int +be_visitor_operation_ih::gen_raise_exception (be_operation *node) +{ + + TAO_OutStream *os = this->ctx_->stream (); // grab the out stream + + if (node->exceptions ()) + { + os->indent (); + + // initialize an iterator to iterate thru the exception list + UTL_ExceptlistActiveIterator *ei; + ACE_NEW_RETURN (ei, + UTL_ExceptlistActiveIterator (node->exceptions ()), + -1); + *os << be_idt_nl << "TAO_THROW_SPEC (("; + // 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_exceptlist_cs" + "visit_operation - " + "codegen for scope failed\n"), -1); + + } + + + // allocator method + *os << excp->name (); + ei->next (); + if (!ei->is_done ()) + { + *os << "," <<be_nl<<"\t\t"; + //os->indent (); + } + // except the last one is processed? + + } // end of while loop + delete ei; + *os << "))"<<be_uidt; + } // end of if + + return 0; + +} |