diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-09-18 20:01:59 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-09-18 20:01:59 +0000 |
commit | f356e808764e5f31a3266d9b5e7fdc73aba3082f (patch) | |
tree | 9843791b1b85c72734b87dc6ba085637ffc6f161 /TAO/TAO_IDL | |
parent | 35b9a21b0350f8fbcff7f725daec093ec9ee8838 (diff) | |
download | ATCD-f356e808764e5f31a3266d9b5e7fdc73aba3082f.tar.gz |
ChangeLogTag: Mon Sep 18 19:54:49 UTC 2006 Jeff Parsons <j.parsons@vanderbilt.edu>
Diffstat (limited to 'TAO/TAO_IDL')
-rw-r--r-- | TAO/TAO_IDL/be/be_decl.cpp | 1 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_predefined_type.cpp | 9 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_sequence.cpp | 3 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp | 3 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp | 1 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_array/serializer_op_cs.cpp | 1 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp | 9 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_operation/rettype.cpp | 1 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_sequence/buffer_type.cpp | 3 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_sequence/serializer_op_cs.cpp | 3 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp | 3 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp | 11 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp | 1 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp | 159 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_union_branch/serializer_op_cs.cpp | 10 |
15 files changed, 132 insertions, 86 deletions
diff --git a/TAO/TAO_IDL/be/be_decl.cpp b/TAO/TAO_IDL/be/be_decl.cpp index 81b23b7d59c..9bdf24f9d94 100644 --- a/TAO/TAO_IDL/be/be_decl.cpp +++ b/TAO/TAO_IDL/be/be_decl.cpp @@ -940,6 +940,7 @@ be_decl::set_arg_seen_bit (be_type *bt) case AST_PredefinedType::PT_object: case AST_PredefinedType::PT_pseudo: case AST_PredefinedType::PT_value: + case AST_PredefinedType::PT_abstract: idl_global->object_arg_seen_ = true; break; case AST_PredefinedType::PT_any: diff --git a/TAO/TAO_IDL/be/be_predefined_type.cpp b/TAO/TAO_IDL/be/be_predefined_type.cpp index 0d1c7a6b69b..c91e7d7d1a4 100644 --- a/TAO/TAO_IDL/be/be_predefined_type.cpp +++ b/TAO/TAO_IDL/be/be_predefined_type.cpp @@ -77,6 +77,10 @@ be_predefined_type::be_predefined_type (AST_PredefinedType::PredefinedType t, { this->fwd_helper_name_ = "::CORBA::tao_ValueBase"; } + else if (t == AST_PredefinedType::PT_abstract) + { + this->fwd_helper_name_ = "::CORBA::tao_AbstractBase"; + } switch (t) { @@ -91,6 +95,7 @@ be_predefined_type::be_predefined_type (AST_PredefinedType::PredefinedType t, case AST_PredefinedType::PT_value: case AST_PredefinedType::PT_void: case AST_PredefinedType::PT_pseudo: + case AST_PredefinedType::PT_abstract: break; default: idl_global->basic_type_seen_ = true; @@ -184,6 +189,10 @@ be_predefined_type::compute_tc_name (void) ACE_NEW (id, Identifier ("_tc_ValueBase")); break; + case AST_PredefinedType::PT_abstract: + ACE_NEW (id, + Identifier ("_tc_AbstractBase")); + break; case AST_PredefinedType::PT_pseudo: { char tcname [100]; diff --git a/TAO/TAO_IDL/be/be_sequence.cpp b/TAO/TAO_IDL/be/be_sequence.cpp index a724cbb35f1..57e3185c11b 100644 --- a/TAO/TAO_IDL/be/be_sequence.cpp +++ b/TAO/TAO_IDL/be/be_sequence.cpp @@ -346,9 +346,8 @@ be_sequence::managed_type (void) switch (pt) { case AST_PredefinedType::PT_pseudo: - this->mt_ = be_sequence::MNG_PSEUDO; - break; case AST_PredefinedType::PT_object: + case AST_PredefinedType::PT_abstract: this->mt_ = be_sequence::MNG_PSEUDO; break; case AST_PredefinedType::PT_value: diff --git a/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp b/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp index 97293ddf2a3..a236e184cad 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/arglist.cpp @@ -215,7 +215,8 @@ int be_visitor_args_arglist::visit_predefined_type (be_predefined_type *node) } } else if (pt == AST_PredefinedType::PT_pseudo - || pt == AST_PredefinedType::PT_object) + || pt == AST_PredefinedType::PT_object + || pt == AST_PredefinedType::PT_abstract) { // The only PT_pseudo that doesn't take a _ptr suffix. bool is_tckind = diff --git a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp index 262dce2236d..166803e0a6a 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp @@ -269,6 +269,7 @@ be_visitor_array_cdr_op_cs::visit_predefined_type (be_predefined_type *node) case AST_PredefinedType::PT_pseudo: case AST_PredefinedType::PT_object: case AST_PredefinedType::PT_value: + case AST_PredefinedType::PT_abstract: case AST_PredefinedType::PT_any: // Let the helper handle this. return this->visit_node (node); diff --git a/TAO/TAO_IDL/be/be_visitor_array/serializer_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_array/serializer_op_cs.cpp index e5e8505c325..e3502b3cf17 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/serializer_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/serializer_op_cs.cpp @@ -394,6 +394,7 @@ be_visitor_array_serializer_op_cs::visit_predefined_type ( case AST_PredefinedType::PT_pseudo: case AST_PredefinedType::PT_object: case AST_PredefinedType::PT_value: + case AST_PredefinedType::PT_abstract: case AST_PredefinedType::PT_any: // Let the helper handle this. return this->visit_node (node); diff --git a/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp b/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp index 710f8b1c8b8..e0bc53cf9ac 100644 --- a/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp @@ -289,16 +289,19 @@ be_visitor_field_ch::visit_predefined_type (be_predefined_type *node) { *os << "::"; } + + AST_PredefinedType::PredefinedType pt = node->pt (); - if (node->pt () == AST_PredefinedType::PT_object) + if (pt == AST_PredefinedType::PT_object + || pt == AST_PredefinedType::PT_abstract) { *os << bt->name () << "_var"; } - else if (node->pt () == AST_PredefinedType::PT_value) + else if (pt == AST_PredefinedType::PT_value) { *os << bt->name () << " *"; } - else if (node->pt () == AST_PredefinedType::PT_pseudo) + else if (pt == AST_PredefinedType::PT_pseudo) { // This was a typedefed array. // ACE_NESTED_CLASS macro generated by nested_type_name diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype.cpp index d638fcb6eea..6efeb883b34 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/rettype.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/rettype.cpp @@ -170,6 +170,7 @@ be_visitor_operation_rettype::visit_predefined_type (be_predefined_type *node) { case AST_PredefinedType::PT_pseudo: case AST_PredefinedType::PT_object: + case AST_PredefinedType::PT_abstract: *os << bt->name (); // If it's not TCKind, it's either Object, TypeCode or ValueBase. diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/buffer_type.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/buffer_type.cpp index 9442ec63130..ad68909d8fb 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/buffer_type.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/buffer_type.cpp @@ -74,7 +74,8 @@ be_visitor_sequence_buffer_type::visit_predefined_type (be_predefined_type *node *os << "::"; if (pt == AST_PredefinedType::PT_pseudo - || pt == AST_PredefinedType::PT_object) + || pt == AST_PredefinedType::PT_object + || pt == AST_PredefinedType::PT_abstract) { *os << node->name () << "_ptr"; } diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/serializer_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/serializer_op_cs.cpp index 103a4281f78..e7828e2eb85 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/serializer_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/serializer_op_cs.cpp @@ -473,6 +473,7 @@ be_visitor_sequence_serializer_op_cs::visit_predefined_type ( switch (node->pt ()) { case AST_PredefinedType::PT_object: + case AST_PredefinedType::PT_abstract: case AST_PredefinedType::PT_value: case AST_PredefinedType::PT_pseudo: case AST_PredefinedType::PT_any: @@ -1153,6 +1154,7 @@ switch (this->ctx_->sub_state ()) switch (pt->pt ()) { case AST_PredefinedType::PT_pseudo: + case AST_PredefinedType::PT_abstract: case AST_PredefinedType::PT_object: case AST_PredefinedType::PT_value: *os << "_tao_marshal_flag = (strm >> _tao_sequence[i].out ());"; @@ -1269,6 +1271,7 @@ switch (this->ctx_->sub_state ()) switch (pt->pt ()) { case AST_PredefinedType::PT_pseudo: + case AST_PredefinedType::PT_abstract: case AST_PredefinedType::PT_object: case AST_PredefinedType::PT_value: *os << "_tao_marshal_flag = (strm << _tao_sequence[i].in ());"; diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp index dd2990bacba..6505411703f 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp @@ -500,7 +500,8 @@ be_visitor_union_branch_cdr_op_cs::visit_predefined_type ( switch (this->ctx_->sub_state ()) { case TAO_CodeGen::TAO_CDR_INPUT: - if (pt == AST_PredefinedType::PT_object) + if (pt == AST_PredefinedType::PT_object + || pt == AST_PredefinedType::PT_abstract) { *os << "::CORBA::Object_var _tao_union_tmp;" << be_nl; diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp index 41b1fd747bb..ed55708c8ca 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp @@ -389,23 +389,26 @@ be_visitor_union_branch_private_ch::visit_predefined_type ( *os << be_nl << (td == 0 ? "::" : ""); + + AST_PredefinedType::PredefinedType pt = node->pt (); - if (node->pt () == AST_PredefinedType::PT_object) + if (pt == AST_PredefinedType::PT_object + || pt == AST_PredefinedType::PT_abstract) { *os << bt->name () << "_var" << " *" << ub->local_name () << "_;"; } - else if (node->pt () == AST_PredefinedType::PT_pseudo) + else if (pt == AST_PredefinedType::PT_pseudo) { *os << bt->nested_type_name (bu, "_ptr") << " " << ub->local_name () << "_;"; } - else if (node->pt () == AST_PredefinedType::PT_value) + else if (pt == AST_PredefinedType::PT_value) { *os << bt->nested_type_name (bu, " *") << " " << ub->local_name () << "_;"; } - else if (node->pt () == AST_PredefinedType::PT_any) + else if (pt == AST_PredefinedType::PT_any) { // Cannot have an object inside of a union. In addition, an Any is a // variable data type. diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp index 979a3c5f7c6..7c41c84c7ce 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp @@ -465,6 +465,7 @@ be_visitor_union_branch_public_ch::visit_predefined_type (be_predefined_type *no { case AST_PredefinedType::PT_pseudo: case AST_PredefinedType::PT_object: + case AST_PredefinedType::PT_abstract: *os << be_nl << be_nl << "void " << ub->local_name () << " (const " << no_td_global << bt->nested_type_name (bu, "_ptr") << ");" << be_nl; diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp index afcf5ee165f..e2ea59b744e 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp @@ -584,7 +584,8 @@ be_visitor_union_branch_public_ci::visit_predefined_type ( AST_PredefinedType::PredefinedType pt = node->pt (); if (pt == AST_PredefinedType::PT_pseudo - || pt == AST_PredefinedType::PT_object) + || pt == AST_PredefinedType::PT_object + || pt == AST_PredefinedType::PT_abstract) { *os << "const ::" << bt->name () << "_ptr"; } @@ -630,6 +631,15 @@ be_visitor_union_branch_public_ci::visit_predefined_type ( << ");" << be_uidt << be_uidt_nl; break; + case AST_PredefinedType::PT_abstract: + *os << "typedef ::CORBA::AbstractBase_var OBJECT_FIELD;" << be_nl + << "ACE_NEW (" << be_idt << be_idt_nl + << "this->u_." << ub->local_name () << "_," << be_nl + << "OBJECT_FIELD ( ::CORBA::AbstractBase::_duplicate (val))" + << be_uidt_nl + << ");" << be_uidt << be_uidt_nl; + + break; case AST_PredefinedType::PT_pseudo: *os << "this->u_." << ub->local_name () << "_ = ::" << bt->name () << "::_duplicate (val);" << be_uidt_nl; @@ -663,80 +673,81 @@ be_visitor_union_branch_public_ci::visit_predefined_type ( switch (pt) { - case AST_PredefinedType::PT_object: - // Get method. - *os << "/// Retrieve the member." << be_nl - << "ACE_INLINE" << be_nl - << "::" << bt->name () << "_ptr" << be_nl - << bu->name () << "::" << ub->local_name () - << " (void) const" << be_nl - << "{" << be_idt_nl; - *os << "return this->u_." << ub->local_name () - << "_->in ();" << be_uidt_nl; - *os << "}"; - - break; - case AST_PredefinedType::PT_pseudo: - // Get method. - *os << "/// Retrieve the member." << be_nl - << "ACE_INLINE" << be_nl - << "::" << bt->name () << "_ptr" << be_nl - << bu->name () << "::" << ub->local_name () - << " (void) const" << be_nl - << "{" << be_idt_nl; - *os << "return this->u_." << ub->local_name () - << "_;" << be_uidt_nl; - *os << "}"; - - break; - case AST_PredefinedType::PT_value: - // Get method. - *os << "/// Retrieve the member." << be_nl - << "ACE_INLINE" << be_nl - << "::" << bt->name () << " *" << be_nl - << bu->name () << "::" << ub->local_name () - << " (void) const" << be_nl - << "{" << be_idt_nl; - *os << "return this->u_." << ub->local_name () - << "_;" << be_uidt_nl; - *os << "}"; - - break; - case AST_PredefinedType::PT_any: - // Get method with read-only access. - *os << "/// Retrieve the member." << be_nl - << "ACE_INLINE" << be_nl - << "const ::" << bt->name () << " &" << be_nl - << bu->name () << "::" << ub->local_name () - << " (void) const" << be_nl - << "{" << be_idt_nl - << "return *this->u_." << ub->local_name () << "_;" << be_uidt_nl - << "}" << be_nl << be_nl; + case AST_PredefinedType::PT_object: + case AST_PredefinedType::PT_abstract: + // Get method. + *os << "/// Retrieve the member." << be_nl + << "ACE_INLINE" << be_nl + << "::" << bt->name () << "_ptr" << be_nl + << bu->name () << "::" << ub->local_name () + << " (void) const" << be_nl + << "{" << be_idt_nl; + *os << "return this->u_." << ub->local_name () + << "_->in ();" << be_uidt_nl; + *os << "}"; + + break; + case AST_PredefinedType::PT_pseudo: + // Get method. + *os << "/// Retrieve the member." << be_nl + << "ACE_INLINE" << be_nl + << "::" << bt->name () << "_ptr" << be_nl + << bu->name () << "::" << ub->local_name () + << " (void) const" << be_nl + << "{" << be_idt_nl; + *os << "return this->u_." << ub->local_name () + << "_;" << be_uidt_nl; + *os << "}"; - // Get method with read/write access - *os << "/// Retrieve the member." << be_nl - << "ACE_INLINE" << be_nl - << "::" << bt->name () << " &" << be_nl - << bu->name () << "::" << ub->local_name () - << " (void)" << be_nl - << "{" << be_idt_nl - << "return *this->u_." << ub->local_name () << "_;" << be_uidt_nl - << "}"; - break; - case AST_PredefinedType::PT_void: - break; - default: - // Get method. - *os << "/// Retrieve the member." << be_nl - << "ACE_INLINE" << be_nl - << "::" << bt->name () << be_nl - << bu->name () << "::" << ub->local_name () - << " (void) const" << be_nl - << "{" << be_idt_nl - << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl - << "}"; - - break; + break; + case AST_PredefinedType::PT_value: + // Get method. + *os << "/// Retrieve the member." << be_nl + << "ACE_INLINE" << be_nl + << "::" << bt->name () << " *" << be_nl + << bu->name () << "::" << ub->local_name () + << " (void) const" << be_nl + << "{" << be_idt_nl; + *os << "return this->u_." << ub->local_name () + << "_;" << be_uidt_nl; + *os << "}"; + + break; + case AST_PredefinedType::PT_any: + // Get method with read-only access. + *os << "/// Retrieve the member." << be_nl + << "ACE_INLINE" << be_nl + << "const ::" << bt->name () << " &" << be_nl + << bu->name () << "::" << ub->local_name () + << " (void) const" << be_nl + << "{" << be_idt_nl + << "return *this->u_." << ub->local_name () << "_;" << be_uidt_nl + << "}" << be_nl << be_nl; + + // Get method with read/write access + *os << "/// Retrieve the member." << be_nl + << "ACE_INLINE" << be_nl + << "::" << bt->name () << " &" << be_nl + << bu->name () << "::" << ub->local_name () + << " (void)" << be_nl + << "{" << be_idt_nl + << "return *this->u_." << ub->local_name () << "_;" << be_uidt_nl + << "}"; + break; + case AST_PredefinedType::PT_void: + break; + default: + // Get method. + *os << "/// Retrieve the member." << be_nl + << "ACE_INLINE" << be_nl + << "::" << bt->name () << be_nl + << bu->name () << "::" << ub->local_name () + << " (void) const" << be_nl + << "{" << be_idt_nl + << "return this->u_." << ub->local_name () << "_;" << be_uidt_nl + << "}"; + + break; } return 0; diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/serializer_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/serializer_op_cs.cpp index 41c4c88334e..5992bc606e7 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/serializer_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/serializer_op_cs.cpp @@ -723,6 +723,16 @@ be_visitor_union_branch_serializer_op_cs::visit_predefined_type (be_predefined_t << "_tao_union." << f->local_name () << " (_tao_union_tmp.in ());"; } + else if (pt == AST_PredefinedType::PT_abstract) + { + *os << "::CORBA::AbstractBase_var _tao_union_tmp;" << be_nl; + + *os << "result = strm >> _tao_union_tmp.out ();" << be_nl << be_nl + << "if (result)" << be_idt_nl + << "{" << be_idt_nl + << "_tao_union." << f->local_name () << " (_tao_union_tmp.in ());"; + + } else if (pt == AST_PredefinedType::PT_pseudo) { *os << "::CORBA::TypeCode_var _tao_union_tmp;" << be_nl |