diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-11-08 03:54:14 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-11-08 03:54:14 +0000 |
commit | 05ce2043201881642b53e9889b5b49e20631caba (patch) | |
tree | e0ee1d4cf123b9c7bff910e91a88eb6c67edd41f /TAO/TAO_IDL | |
parent | 8fdb10ab4a8a950801cc2f1e73ad306da351ce48 (diff) | |
download | ATCD-05ce2043201881642b53e9889b5b49e20631caba.tar.gz |
ChangeLogTag:Fri Nov 07 21:23:35 1997 Carlos O'Ryan <coryan@MILONGA>
Diffstat (limited to 'TAO/TAO_IDL')
-rw-r--r-- | TAO/TAO_IDL/be/be_exception.cpp | 53 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_state.cpp | 49 |
2 files changed, 74 insertions, 28 deletions
diff --git a/TAO/TAO_IDL/be/be_exception.cpp b/TAO/TAO_IDL/be/be_exception.cpp index 9486cbe5a36..b06f60afe3b 100644 --- a/TAO/TAO_IDL/be/be_exception.cpp +++ b/TAO/TAO_IDL/be/be_exception.cpp @@ -1,3 +1,7 @@ +// +// $Id$ +// + #include "idl.h" #include "idl_extern.h" #include "be.h" @@ -68,11 +72,32 @@ be_exception::gen_client_header (void) TAO_OutStream *ch = cg->client_header (); // output stream TAO_NL nl; // end line - ACE_UNUSED_ARG (nl); cg->outstream (ch); ch->indent (); // start from whatever indentation level we were at + ch->gen_ifdef_macro (this->flatname (), "_ptr"); + + ch->indent (); + *ch << "class " << this->local_name () << ";" << nl; + // generate the _ptr declaration + *ch << "typedef " << this->local_name () << " *" + << this->local_name () << "_ptr;" << nl; + ch->gen_endif (); + + ch->gen_ifdef_macro (this->flatname ()); + + ch->indent (); + *ch << "class " << this->local_name () + << " : public virtual CORBA::UserException" << nl; + *ch << "{" << nl + << "public:" << nl; + ch->incr_indent (); + *ch << this->local_name () << " (void);\n"; + ch->decr_indent (); + *ch << "};" << nl << nl; + ch->gen_endif (); + *ch << "static CORBA::TypeCode_ptr " << this->tc_name ()->last_component () << ";\n\n"; @@ -85,6 +110,32 @@ be_exception::gen_client_header (void) int be_exception::gen_client_inline (void) { + if (!this->cli_inline_gen_) + { + TAO_NL nl; // end line + + TAO_CodeGen *cg = TAO_CODEGEN::instance (); + TAO_OutStream *ci = cg->client_inline (); + + *ci << "// *************************************************************" + << nl; + *ci << "// Inline operations for exception " << this->name () << nl; + *ci << "// *************************************************************\n\n"; + + ci->indent (); + *ci << "// default constructor" << nl; + *ci << "ACE_INLINE" << nl; + *ci << this->name () << "::" << this->local_name () << " (void)" << nl; + ci->incr_indent (); + *ci << ": CORBA_UserException (_tc_" + << this->local_name () + << ")\n"; + ci->decr_indent (); + *ci << "{" << nl; + *ci << "}" << nl << nl; + + this->cli_inline_gen_ = I_TRUE; + } return 0; } diff --git a/TAO/TAO_IDL/be/be_state.cpp b/TAO/TAO_IDL/be/be_state.cpp index e7ae89a4894..878c3303118 100644 --- a/TAO/TAO_IDL/be/be_state.cpp +++ b/TAO/TAO_IDL/be/be_state.cpp @@ -1556,7 +1556,6 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) } break; case TAO_CodeGen::TAO_ARGUMENT_CH: - case TAO_CodeGen::TAO_ARGUMENT_SH: { // to keep the MSVC++ compiler happy *os << bt->nested_type_name (bif, "_ptr") << " "; @@ -1567,6 +1566,7 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) *os << arg->local_name () << ", "; } break; + case TAO_CodeGen::TAO_ARGUMENT_SH: default: { *os << bt->name () << "_ptr "; @@ -1591,17 +1591,12 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) } break; case TAO_CodeGen::TAO_ARGUMENT_CH: - case TAO_CodeGen::TAO_ARGUMENT_SH: { // to keep the MSVC++ compiler happy *os << bt->nested_type_name (bif, "_ptr") << " &"; } break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; + case TAO_CodeGen::TAO_ARGUMENT_SH: default: { *os << bt->name () << "_ptr &"; @@ -1628,7 +1623,6 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) } break; case TAO_CodeGen::TAO_ARGUMENT_CH: - case TAO_CodeGen::TAO_ARGUMENT_SH: { // to keep the MSVC++ compiler happy *os << bt->nested_type_name (bif, "_out") << " "; @@ -1639,6 +1633,7 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) *os << arg->local_name () << "_out, "; } break; + case TAO_CodeGen::TAO_ARGUMENT_SH: default: { *os << bt->name () << "_out "; @@ -1675,7 +1670,6 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) } break; case TAO_CodeGen::TAO_ARGUMENT_CH: - case TAO_CodeGen::TAO_ARGUMENT_SH: { *os << "const " << bt->nested_type_name (bif) << " &"; } @@ -1685,6 +1679,7 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) *os << arg->local_name () << ", "; } break; + case TAO_CodeGen::TAO_ARGUMENT_SH: default: { *os << "const " << bt->name () << " &"; @@ -1709,7 +1704,6 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) } break; case TAO_CodeGen::TAO_ARGUMENT_CH: - case TAO_CodeGen::TAO_ARGUMENT_SH: { *os << "const " << bt->nested_type_name (bif) << " &"; } @@ -1719,6 +1713,7 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) *os << arg->local_name () << ", "; } break; + case TAO_CodeGen::TAO_ARGUMENT_SH: default: { *os << bt->name () << " &"; @@ -1743,7 +1738,6 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) } break; case TAO_CodeGen::TAO_ARGUMENT_CH: - case TAO_CodeGen::TAO_ARGUMENT_SH: { *os << bt->nested_type_name (bif, "_out") << " "; } @@ -1753,6 +1747,7 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) *os << arg->local_name () << ", "; } break; + case TAO_CodeGen::TAO_ARGUMENT_SH: default: { *os << bt->name () << "_out "; @@ -1783,7 +1778,6 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) } break; case TAO_CodeGen::TAO_ARGUMENT_CH: - case TAO_CodeGen::TAO_ARGUMENT_SH: { *os << bt->nested_type_name (bif, "_ptr") << " "; } @@ -1793,6 +1787,7 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) *os << arg->local_name () << ", "; } break; + case TAO_CodeGen::TAO_ARGUMENT_SH: default: { *os << bt->name () << "_ptr "; @@ -1817,7 +1812,6 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) } break; case TAO_CodeGen::TAO_ARGUMENT_CH: - case TAO_CodeGen::TAO_ARGUMENT_SH: { *os << bt->nested_type_name (bif, "_ptr") << " &"; } @@ -1827,6 +1821,7 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) *os << arg->local_name () << ", "; } break; + case TAO_CodeGen::TAO_ARGUMENT_SH: default: { *os << bt->name () << "_ptr &"; @@ -1854,7 +1849,6 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) } break; case TAO_CodeGen::TAO_ARGUMENT_CH: - case TAO_CodeGen::TAO_ARGUMENT_SH: { *os << bt->nested_type_name (bif, "_out") << " "; } @@ -1864,6 +1858,7 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) *os << arg->local_name () << "_out, "; } break; + case TAO_CodeGen::TAO_ARGUMENT_SH: default: { *os << bt->name () << "_out "; @@ -1894,7 +1889,6 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) } break; case TAO_CodeGen::TAO_ARGUMENT_CH: - case TAO_CodeGen::TAO_ARGUMENT_SH: { *os << bt->nested_type_name (bif); } @@ -1904,6 +1898,7 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) *os << arg->local_name () << ", "; } break; + case TAO_CodeGen::TAO_ARGUMENT_SH: default: { *os << bt->name (); @@ -1928,7 +1923,6 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) } break; case TAO_CodeGen::TAO_ARGUMENT_CH: - case TAO_CodeGen::TAO_ARGUMENT_SH: { *os << bt->nested_type_name (bif) << " &"; } @@ -1938,6 +1932,7 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) *os << arg->local_name () << ", "; } break; + case TAO_CodeGen::TAO_ARGUMENT_SH: default: { *os << bt->name () << " &"; @@ -1962,7 +1957,6 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) } break; case TAO_CodeGen::TAO_ARGUMENT_CH: - case TAO_CodeGen::TAO_ARGUMENT_SH: { *os << bt->nested_type_name (bif, "_out"); } @@ -1972,6 +1966,7 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) *os << arg->local_name () << ", "; } break; + case TAO_CodeGen::TAO_ARGUMENT_SH: default: { *os << bt->name () << "_out"; @@ -2060,7 +2055,6 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) } break; case TAO_CodeGen::TAO_ARGUMENT_CH: - case TAO_CodeGen::TAO_ARGUMENT_SH: { *os << bt->nested_type_name (bif, "_out"); } @@ -2070,6 +2064,7 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) *os << arg->local_name () << ", "; } break; + case TAO_CodeGen::TAO_ARGUMENT_SH: default: { *os << bt->name () << "_out"; @@ -2101,7 +2096,6 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) } break; case TAO_CodeGen::TAO_ARGUMENT_CH: - case TAO_CodeGen::TAO_ARGUMENT_SH: { // to keep the MSVC++ compiler happy *os << "const " << bt->nested_type_name (bif); @@ -2112,6 +2106,7 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) *os << arg->local_name () << ", "; } break; + case TAO_CodeGen::TAO_ARGUMENT_SH: default: { *os << "const " << bt->name (); @@ -2142,7 +2137,6 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) } break; case TAO_CodeGen::TAO_ARGUMENT_CH: - case TAO_CodeGen::TAO_ARGUMENT_SH: { // to keep the MSVC++ compiler happy if (bt->size_type () == be_decl::VARIABLE) @@ -2160,6 +2154,7 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) *os << arg->local_name () << ", "; } break; + case TAO_CodeGen::TAO_ARGUMENT_SH: default: { *os << bt->name (); @@ -2190,7 +2185,6 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) } break; case TAO_CodeGen::TAO_ARGUMENT_CH: - case TAO_CodeGen::TAO_ARGUMENT_SH: { // to keep the MSVC++ compiler happy *os << bt->nested_type_name (bif, "_out") << " "; @@ -2201,6 +2195,7 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) *os << arg->local_name () << ", "; } break; + case TAO_CodeGen::TAO_ARGUMENT_SH: default: { *os << bt->name () << "_out"; @@ -2234,7 +2229,6 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) } break; case TAO_CodeGen::TAO_ARGUMENT_CH: - case TAO_CodeGen::TAO_ARGUMENT_SH: { // to keep the MSVC++ compiler happy *os << "const " << bt->nested_type_name (bif) << " &"; @@ -2245,6 +2239,7 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) *os << arg->local_name () << ", "; } break; + case TAO_CodeGen::TAO_ARGUMENT_SH: default: { *os << "const " << bt->name () << " &"; @@ -2271,7 +2266,6 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) } break; case TAO_CodeGen::TAO_ARGUMENT_CH: - case TAO_CodeGen::TAO_ARGUMENT_SH: { // to keep the MSVC++ compiler happy *os << bt->nested_type_name (bif) << " &"; @@ -2282,6 +2276,7 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) *os << arg->local_name () << ", "; } break; + case TAO_CodeGen::TAO_ARGUMENT_SH: default: { *os << bt->name () << " &"; @@ -2326,7 +2321,6 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) } break; case TAO_CodeGen::TAO_ARGUMENT_CH: - case TAO_CodeGen::TAO_ARGUMENT_SH: { // to keep the MSVC++ compiler happy *os << bt->nested_type_name (bif, "_out") << " "; @@ -2340,6 +2334,7 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) *os << arg->local_name () << ", "; } break; + case TAO_CodeGen::TAO_ARGUMENT_SH: default: { *os << bt->name () << "_out"; @@ -2372,7 +2367,6 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) } break; case TAO_CodeGen::TAO_ARGUMENT_CH: - case TAO_CodeGen::TAO_ARGUMENT_SH: { // to keep the MSVC++ compiler happy *os << bt->nested_type_name (bif); @@ -2383,6 +2377,7 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) *os << arg->local_name () << ", "; } break; + case TAO_CodeGen::TAO_ARGUMENT_SH: default: { *os << bt->name (); @@ -2409,7 +2404,6 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) } break; case TAO_CodeGen::TAO_ARGUMENT_CH: - case TAO_CodeGen::TAO_ARGUMENT_SH: { // to keep the MSVC++ compiler happy *os << bt->nested_type_name (bif) << " &"; @@ -2420,6 +2414,7 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) *os << arg->local_name () << ", "; } break; + case TAO_CodeGen::TAO_ARGUMENT_SH: default: { *os << bt->name () << " &"; @@ -2446,7 +2441,6 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) } break; case TAO_CodeGen::TAO_ARGUMENT_CH: - case TAO_CodeGen::TAO_ARGUMENT_SH: { // to keep the MSVC++ compiler happy *os << bt->nested_type_name (bif, "_out") << " "; @@ -2457,6 +2451,7 @@ be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) *os << arg->local_name () << ", "; } break; + case TAO_CodeGen::TAO_ARGUMENT_SH: default: { *os << bt->name () << "_out"; |