summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be/be_visitor_field
diff options
context:
space:
mode:
authorgmaxey <gmaxey@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-06-21 20:31:32 +0000
committergmaxey <gmaxey@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-06-21 20:31:32 +0000
commit40e01c9ee3de87d4dbfe43d712bfd3ca03e88157 (patch)
tree40aaff56f3bb55025945f3042670b5d3afe6c1e1 /TAO/TAO_IDL/be/be_visitor_field
parent4a759eae1a8d64d26166966a90882fcc138561b2 (diff)
downloadATCD-40e01c9ee3de87d4dbfe43d712bfd3ca03e88157.tar.gz
Tue Jun 21 13:35:00 2005 Gary Maxey <gary.maxey@hp.com>
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_field')
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp70
-rw-r--r--TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp105
2 files changed, 37 insertions, 138 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp
index 66bf273b6b2..9488c0de507 100644
--- a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_cs.cpp
@@ -392,47 +392,15 @@ be_visitor_field_cdr_op_cs::visit_component_fwd (be_component_fwd *node)
return this->visit_interface_fwd (node);
}
+be_visitor_field_cdr_op_cs::visit_valuebox (be_valuebox *)
+{
+ return this->emit_valuetype_common ();
+}
+
int
be_visitor_field_cdr_op_cs::visit_valuetype (be_valuetype *)
{
- TAO_OutStream *os = this->ctx_->stream ();
- be_field *f = this->ctx_->be_node_as_field ();
-
- if (!f)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_valuetype - "
- "cannot retrieve field node\n"),
- -1);
- }
-
- // Check what is the code generations substate. Are we generating code for
- // the in/out operators for our parent or for us?
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_CDR_INPUT:
- *os << "(strm >> _tao_aggregate." << f->local_name () << ".out ())";
-
- break;
- case TAO_CodeGen::TAO_CDR_OUTPUT:
- *os << "(strm << _tao_aggregate." << f->local_name () << ".in ())";
-
- break;
- case TAO_CodeGen::TAO_CDR_SCOPE:
- // Nothing to be done because a valuetype cannot be declared inside a
- // structure.
- break;
- default:
- // Error.
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_valuetype - "
- "bad sub state\n"),
- -1);
- }
-
- return 0;
+ return this->emit_valuetype_common ();
}
int
@@ -444,16 +412,27 @@ be_visitor_field_cdr_op_cs::visit_eventtype (be_eventtype *node)
int
be_visitor_field_cdr_op_cs::visit_valuetype_fwd (be_valuetype_fwd *)
{
- TAO_OutStream *os = this->ctx_->stream ();
+ return this->emit_valuetype_common ();
+}
- // Retrieve the field node.
+int
+be_visitor_field_cdr_op_cs::visit_eventtype_fwd (be_eventtype_fwd *node)
+{
+ return this->visit_valuetype_fwd (node);
+}
+
+
+int
+be_visitor_field_cdr_op_cs::emit_valuetype_common (void)
+{
+ TAO_OutStream *os = this->ctx_->stream ();
be_field *f = this->ctx_->be_node_as_field ();
- if (f == 0)
+ if (!f)
{
ACE_ERROR_RETURN ((LM_ERROR,
"(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_valuetype_fwd - "
+ "emit_common - "
"cannot retrieve field node\n"),
-1);
}
@@ -478,7 +457,7 @@ be_visitor_field_cdr_op_cs::visit_valuetype_fwd (be_valuetype_fwd *)
// Error.
ACE_ERROR_RETURN ((LM_ERROR,
"(%N:%l) be_visitor_field_cdr_op_cs::"
- "visit_valuetype_fwd - "
+ "emit_common - "
"bad sub state\n"),
-1);
}
@@ -486,11 +465,6 @@ be_visitor_field_cdr_op_cs::visit_valuetype_fwd (be_valuetype_fwd *)
return 0;
}
-int
-be_visitor_field_cdr_op_cs::visit_eventtype_fwd (be_eventtype_fwd *node)
-{
- return this->visit_valuetype_fwd (node);
-}
// Visit predefined type.
int
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 8c3669fb306..5a923830956 100644
--- a/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp
@@ -204,111 +204,37 @@ be_visitor_field_ch::visit_enum (be_enum *node)
int
be_visitor_field_ch::visit_interface (be_interface *node)
{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- // This was a typedefed array.
- // ACE_NESTED_CLASS macro generated by nested_type_name
- // is necessary if the struct, union, or valuetype containing this
- // field was not defined inside a module. In such a case, VC++
- // complains that the non-module scope is not yet fully defined.
- UTL_Scope *holds_container = this->ctx_->scope ()->defined_in ();
- AST_Decl *hc_decl = ScopeAsDecl (holds_container);
-
- if (hc_decl->node_type () != AST_Decl::NT_module)
- {
- *os << bt->nested_type_name (this->ctx_->scope (), "_var");
- }
- else
- {
- *os << bt->name () << "_var";
- }
-
- return 0;
+ return this->emit_common (node);
}
int
be_visitor_field_ch::visit_interface_fwd (be_interface_fwd *node)
{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- // This was a typedefed array.
- // ACE_NESTED_CLASS macro generated by nested_type_name
- // is necessary if the struct, union, or valuetype containing this
- // field was not defined inside a module. In such a case, VC++
- // complains that the non-module scope is not yet fully defined.
- UTL_Scope *holds_container = this->ctx_->scope ()->defined_in ();
- AST_Decl *hc_decl = ScopeAsDecl (holds_container);
-
- if (hc_decl->node_type () != AST_Decl::NT_module)
- {
- *os << bt->nested_type_name (this->ctx_->scope (), "_var");
- }
- else
- {
- *os << bt->name () << "_var";
- }
+ return this->emit_common (node);
+}
- return 0;
+int
+be_visitor_field_ch::visit_valuebox (be_valuebox *node)
+{
+ return this->emit_common (node);
}
int
be_visitor_field_ch::visit_valuetype (be_valuetype *node)
{
- TAO_OutStream *os = this->ctx_->stream ();
- be_type *bt;
-
- if (this->ctx_->alias ())
- {
- bt = this->ctx_->alias ();
- }
- else
- {
- bt = node;
- }
-
- // This was a typedefed array.
- // ACE_NESTED_CLASS macro generated by nested_type_name
- // is necessary if the struct, union, or valuetype containing this
- // field was not defined inside a module. In such a case, VC++
- // complains that the non-module scope is not yet fully defined.
- UTL_Scope *holds_container = this->ctx_->scope ()->defined_in ();
- AST_Decl *hc_decl = ScopeAsDecl (holds_container);
-
- if (hc_decl->node_type () != AST_Decl::NT_module)
- {
- *os << bt->nested_type_name (this->ctx_->scope (), "_var");
- }
- else
- {
- *os << bt->name () << "_var";
- }
-
- return 0;
+ return this->emit_common (node);
}
int
be_visitor_field_ch::visit_valuetype_fwd (be_valuetype_fwd *node)
{
+ return this->emit_common (node);
+}
+
+
+int
+be_visitor_field_ch::emit_common (be_type *node)
+{
TAO_OutStream *os = this->ctx_->stream ();
be_type *bt;
@@ -321,7 +247,6 @@ be_visitor_field_ch::visit_valuetype_fwd (be_valuetype_fwd *node)
bt = node;
}
- // This was a typedefed array.
// ACE_NESTED_CLASS macro generated by nested_type_name
// is necessary if the struct, union, or valuetype containing this
// field was not defined inside a module. In such a case, VC++