diff options
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp')
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp | 97 |
1 files changed, 48 insertions, 49 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp b/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp index 4c3d9d8a4af..376e6244a6a 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_cs.cpp @@ -49,7 +49,7 @@ int be_visitor_exception_cs::visit_exception (be_exception *node) os->indent (); - // Generate stub code required of any anonymous types of members. + // Generate stub code required of any anonymous types of members. if (this->visit_scope (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -59,53 +59,6 @@ int be_visitor_exception_cs::visit_exception (be_exception *node) -1); } - be_visitor_context ctx (*this->ctx_); - - // Constructor taking all members. It exists only if there are any - // members. - if (node->member_count () > 0) - { - // Generate the signature. - ctx.state (TAO_CodeGen::TAO_EXCEPTION_CTOR_CS); - be_visitor_exception_ctor ec_visitor (&ctx); - - if (node->accept (&ec_visitor) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_exception::" - "visit_exception - " - "codegen for ctor failed\n"), - -1); - } - - *os << be_idt_nl - << ": ::CORBA::UserException (" - << be_idt << be_idt << be_idt_nl - << "\"" << node->repoID () << "\"," << be_nl - << "\"" << node->local_name () << "\"" << be_uidt_nl - << ")" << be_uidt << be_uidt << be_uidt_nl; - *os << "{" << be_idt; - - // Assign each individual member. We need yet another state. - ctx = *this->ctx_; - - // Indicate that the special ctor is being generated. - ctx.exception (true); - - be_visitor_exception_ctor_assign eca_visitor (&ctx); - - if (node->accept (&eca_visitor) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_exception_cs::" - "visit_exception -" - "codegen for scope failed\n"), - -1); - } - - *os << be_uidt_nl << "}" << be_nl << be_nl; - } - *os << be_nl << be_nl << "// TAO_IDL - Generated from " << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; @@ -134,7 +87,7 @@ int be_visitor_exception_cs::visit_exception (be_exception *node) << ")" << be_uidt << be_uidt << be_uidt_nl; *os << "{"; - ctx = *this->ctx_; + be_visitor_context ctx (*this->ctx_); if (node->nmembers () > 0) { @@ -322,6 +275,52 @@ int be_visitor_exception_cs::visit_exception (be_exception *node) *os << "}" << be_nl << be_nl; } + // Constructor taking all members. It exists only if there are any + // members. + if (node->member_count () > 0) + { + // Generate the signature. + ctx = *this->ctx_; + ctx.state (TAO_CodeGen::TAO_EXCEPTION_CTOR_CS); + be_visitor_exception_ctor ec_visitor (&ctx); + + if (node->accept (&ec_visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_exception::" + "visit_exception - " + "codegen for ctor failed\n"), + -1); + } + + *os << be_idt_nl + << ": ::CORBA::UserException (" + << be_idt << be_idt << be_idt_nl + << "\"" << node->repoID () << "\"," << be_nl + << "\"" << node->local_name () << "\"" << be_uidt_nl + << ")" << be_uidt << be_uidt << be_uidt_nl; + *os << "{" << be_idt; + + // Assign each individual member. We need yet another state. + ctx = *this->ctx_; + + // Indicate that the special ctor is being generated. + ctx.exception (1); + + be_visitor_exception_ctor_assign eca_visitor (&ctx); + + if (node->accept (&eca_visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_exception_cs::" + "visit_exception -" + "codegen for scope failed\n"), + -1); + } + + *os << be_uidt_nl << "}" << be_nl << be_nl; + } + // Switch streams to the *A.cpp file if we are using this option. if (be_global->gen_anyop_files ()) { |