summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be/be_union.cpp
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-01-18 21:47:25 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-01-18 21:47:25 +0000
commit36a2a432195e610e2dd8fa5a5ff308081a7f9d86 (patch)
tree77f79cbea41e568f9a4769248d50ab7449b23fdf /TAO/TAO_IDL/be/be_union.cpp
parentf61eba9806da55091faa47b30466b04ee28684c8 (diff)
downloadATCD-36a2a432195e610e2dd8fa5a5ff308081a7f9d86.tar.gz
ChangeLogTag: Thu Jan 18 15:43:52 2001 Jeff Parsons <parsons@cs.wustl.edu>
Diffstat (limited to 'TAO/TAO_IDL/be/be_union.cpp')
-rw-r--r--TAO/TAO_IDL/be/be_union.cpp43
1 files changed, 27 insertions, 16 deletions
diff --git a/TAO/TAO_IDL/be/be_union.cpp b/TAO/TAO_IDL/be/be_union.cpp
index 7bdd366aa67..03e9ac71cee 100644
--- a/TAO/TAO_IDL/be/be_union.cpp
+++ b/TAO/TAO_IDL/be/be_union.cpp
@@ -285,22 +285,33 @@ be_union::gen_var_impl (char *,
// Assignment operator from _var.
ci->indent ();
- *ci << "ACE_INLINE ::" << fname << " &" << nl;
- *ci << fname << "::operator= (const ::" << fname
- << " &p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "if (this != &p)" << nl;
- *ci << "{\n";
- ci->incr_indent ();
- *ci << "delete this->ptr_;" << nl;
- *ci << "ACE_NEW_RETURN (this->ptr_, ::" << this->name ()
- << " (*p.ptr_), *this);\n";
- ci->decr_indent ();
- *ci << "}" << nl;
- *ci << "return *this;\n";
- ci->decr_indent ();
- *ci << "}\n\n";
+ *ci << "ACE_INLINE ::" << fname << " &" << be_nl
+ << fname << "::operator= (const ::" << fname
+ << " &p)" << be_nl
+ << "{" << be_idt_nl
+ << "if (this != &p)" << be_idt_nl
+ << "{" << be_idt_nl
+ << "if (p.ptr_ == 0)" << be_idt_nl
+ << "{" << be_idt_nl
+ << "delete this->ptr_;" << be_nl
+ << "this->ptr_ = 0;" << be_uidt_nl
+ << "}" << be_uidt_nl
+ << "else" << be_idt_nl
+ << "{" << be_idt_nl
+ << this->name () << " *deep_copy =" << be_idt_nl
+ << "new " << this->name () << " (*p.ptr_);"
+ << be_uidt_nl << be_nl
+ << "if (deep_copy != 0)" << be_idt_nl
+ << "{" << be_idt_nl
+ << this->name () << " *tmp = deep_copy;" << be_nl
+ << "deep_copy = this->ptr_;" << be_nl
+ << "this->ptr_ = tmp;" << be_nl
+ << "delete deep_copy;" << be_uidt_nl
+ << "}" << be_uidt << be_uidt_nl
+ << "}" << be_uidt << be_uidt_nl
+ << "}" << be_uidt_nl << be_nl
+ << "return *this;" << be_uidt_nl
+ << "}\n\n";
// Fixed-size types only.
if (this->size_type () == be_decl::FIXED)