summaryrefslogtreecommitdiff
path: root/TAO
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-11-01 15:40:31 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-11-01 15:40:31 +0000
commit4665b868845822a098500592b119c7406d58572a (patch)
tree30244a5a754ea9a130fd94003447aa7df81442b5 /TAO
parent24078b7148e93e099adc17087f677a44b067c356 (diff)
downloadATCD-4665b868845822a098500592b119c7406d58572a.tar.gz
ChangeLogTag: Tue Nov 1 15:37:04 UTC 2005 Jeff Parsons <j.parsons@vanderbilt.edu>
Diffstat (limited to 'TAO')
-rw-r--r--TAO/ChangeLog10
-rw-r--r--TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp65
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_valuetype/valuetype_obv_cs.h4
3 files changed, 73 insertions, 6 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 451bab782f9..28346418adb 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,13 @@
+Tue Nov 1 15:37:04 UTC 2005 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp:
+ * TAO_IDL/be_include/be_visitor_valuetype/valuetype_obv_cs.h:
+
+ Fixed generation of valuetype initializing constructor for
+ array members. These cannot be handled in the constructor's
+ initialization list, so they are handled in the constructor
+ body.
+
Tue Nov 1 14:49:12 UTC 2005 Johnny Willemsen <jwillemsen@remedy.nl>
* tests/Sequence_Unit_Tests/unbounded_value_sequence_ut.cpp:
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp
index 52da0deeca9..f900c6a1510 100644
--- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp
@@ -84,14 +84,17 @@ be_visitor_valuetype_obv_cs::visit_valuetype (be_valuetype *node)
this->gen_obv_init_constructor_args (node, index);
*os << be_uidt_nl
- << ")" << be_nl
- << ": " << be_idt;
+ << ")";
- index = 0;
this->gen_obv_init_constructor_init_list (node);
*os << be_uidt << be_uidt_nl
- << "{}" << be_nl << be_nl;
+ << "{" << be_idt;
+
+ this->gen_obv_init_constructor_array_inits (node);
+
+ *os << be_uidt_nl
+ << "}" << be_nl << be_nl;
}
// Destructor.
@@ -232,8 +235,23 @@ be_visitor_valuetype_obv_cs::gen_obv_init_constructor_init_list (
{
continue;
}
+
+ AST_Decl::NodeType nt =
+ f->field_type ()->unaliased_type ()->node_type ();
+
+ // Arrays can't be done in the initialization list, they're done
+ // later in the constructor body.
+ if (nt == AST_Decl::NT_array)
+ {
+ continue;
+ }
- if (index++ != 0)
+ if (0 == index++)
+ {
+ *os << be_nl
+ << ": " << be_idt;
+ }
+ else
{
*os << "," << be_nl;
}
@@ -279,3 +297,40 @@ be_visitor_valuetype_obv_cs::gen_obv_init_base_constructor_args (
}
}
+void
+be_visitor_valuetype_obv_cs::gen_obv_init_constructor_array_inits (
+ be_valuetype *node
+ )
+{
+ TAO_OutStream *os = this->ctx_->stream ();
+
+ for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
+ !si.is_done ();
+ si.next())
+ {
+ // be_attribute doesn't inherit from be_field (unlike the
+ // AST_* counterparts, so this screens attributes and operations.
+ be_field *f = be_field::narrow_from_decl (si.item ());
+
+ if (f == 0)
+ {
+ continue;
+ }
+
+ AST_Decl::NodeType nt =
+ f->field_type ()->unaliased_type ()->node_type ();
+
+ // All other members are handled in the initialization list.
+ if (nt != AST_Decl::NT_array)
+ {
+ continue;
+ }
+
+ *os << be_nl
+ << f->field_type ()->name () << "_copy ("
+ << node->field_pd_prefix () << f->local_name ()
+ << ", _tao_init_" << f->local_name () << ");";
+ }
+}
+
+
diff --git a/TAO/TAO_IDL/be_include/be_visitor_valuetype/valuetype_obv_cs.h b/TAO/TAO_IDL/be_include/be_visitor_valuetype/valuetype_obv_cs.h
index 4c5eca7d56d..2c10e07ac01 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_valuetype/valuetype_obv_cs.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_valuetype/valuetype_obv_cs.h
@@ -52,7 +52,9 @@ private:
void gen_obv_init_base_constructor_args (be_valuetype *node,
unsigned long &index);
// Called by method above to generate base class constructor call.
-
+
+ void gen_obv_init_constructor_array_inits (be_valuetype *node);
+ // Must generate array member initialization in the body.
};
#endif /* _BE_VALUETYPE_VALUETYPE_OBV_CS_H_ */