diff options
author | kolpackov <kolpackov@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-01-31 14:22:25 +0000 |
---|---|---|
committer | kolpackov <kolpackov@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-01-31 14:22:25 +0000 |
commit | baad19c03f7bf70e0842b03af0544c44e91fc971 (patch) | |
tree | 953509f29a3a5887b14784d94a1c88773f9eb75c | |
parent | b63ef8cdac7ef1def68522bd4c35373e659f6be7 (diff) | |
download | ATCD-baad19c03f7bf70e0842b03af0544c44e91fc971.tar.gz |
ChangeLogTag Thu Jan 31 14:14:32 2002 Boris Kolpackov <bosk@ipmce.ru>
-rw-r--r-- | TAO/ChangeLogs/ChangeLog-02a | 6 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp | 88 |
2 files changed, 91 insertions, 3 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index b5a2bea4bca..c456347717a 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,9 @@ +Thu Jan 31 14:14:32 2002 Boris Kolpackov <bosk@ipmce.ru> + + * TAO_IDL/be/be_visitor_valuetype/valuetype.cpp (visit_exception): + + Added generation of nested into valuetype exceptions. + Thu Jan 31 13:06:12 2002 Boris Kolpackov <bosk@ipmce.ru> * TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp: diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp index 329e1b42f3f..c468e7a18ea 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp @@ -388,10 +388,92 @@ be_visitor_valuetype::visit_operation (be_operation *) // visit an exception (not used) int -be_visitor_valuetype::visit_exception (be_exception *) +be_visitor_valuetype::visit_exception (be_exception *node) { - ACE_ASSERT (0); - 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_VALUETYPE_CH: + ctx.state (TAO_CodeGen::TAO_EXCEPTION_CH); + break; + case TAO_CodeGen::TAO_VALUETYPE_CI: + ctx.state (TAO_CodeGen::TAO_EXCEPTION_CI); + break; + case TAO_CodeGen::TAO_VALUETYPE_CS: + ctx.state (TAO_CodeGen::TAO_EXCEPTION_CS); + break; + case TAO_CodeGen::TAO_VALUETYPE_ANY_OP_CH: + ctx.state (TAO_CodeGen::TAO_EXCEPTION_ANY_OP_CH); + break; + case TAO_CodeGen::TAO_VALUETYPE_ANY_OP_CS: + ctx.state (TAO_CodeGen::TAO_EXCEPTION_ANY_OP_CS); + break; + case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CH: + ctx.state (TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CH); + break; + case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CI: + ctx.state (TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CI); + break; + case TAO_CodeGen::TAO_VALUETYPE_CDR_OP_CS: + ctx.state (TAO_CodeGen::TAO_EXCEPTION_CDR_OP_CS); + break; + + case TAO_CodeGen::TAO_VALUETYPE_SH: + case TAO_CodeGen::TAO_VALUETYPE_IH: + case TAO_CodeGen::TAO_VALUETYPE_SI: + case TAO_CodeGen::TAO_VALUETYPE_SS: + case TAO_CodeGen::TAO_VALUETYPE_IS: + case TAO_CodeGen::TAO_VALUETYPE_OBV_CH: + case TAO_CodeGen::TAO_VALUETYPE_OBV_CI: + case TAO_CodeGen::TAO_VALUETYPE_OBV_CS: + case TAO_CodeGen::TAO_VALUETYPE_COLLOCATED_SH: + case TAO_CodeGen::TAO_VALUETYPE_COLLOCATED_SS: + case TAO_CodeGen::TAO_VALUETYPE_MARSHAL_CH: + case TAO_CodeGen::TAO_VALUETYPE_MARSHAL_CS: + case TAO_CodeGen::TAO_VALUETYPE_INIT_CH: + case TAO_CodeGen::TAO_VALUETYPE_INIT_CI: + case TAO_CodeGen::TAO_VALUETYPE_INIT_CS: + case TAO_CodeGen::TAO_VALUETYPE_INIT_ARGLIST_CH: + 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 a structure |