diff options
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_valuetype/marshal_ch.cpp')
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_valuetype/marshal_ch.cpp | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_ch.cpp new file mode 100644 index 00000000000..55aec2de444 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_ch.cpp @@ -0,0 +1,90 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// marshal_ch.cpp +// +// = DESCRIPTION +// Concrete visitor for valuetypes. +// This one provides code generation for marshalling. +// +// = AUTHOR +// Torsten Kuepper <kuepper2@lfa.uni-wuppertal.de> +// based on code from Aniruddha Gokhale +// +// ============================================================================ + +ACE_RCSID (be_visitor_valuetype, + marshal_ch, + "$Id$") + +// *************************************************************************** +// Structure visitor for generating declarations +// *************************************************************************** + +be_visitor_valuetype_marshal_ch::be_visitor_valuetype_marshal_ch ( + be_visitor_context *ctx + ) + : be_visitor_scope (ctx) +{ +} + +be_visitor_valuetype_marshal_ch::~be_visitor_valuetype_marshal_ch (void) +{ +} + +int +be_visitor_valuetype_marshal_ch::visit_valuetype (be_valuetype *node) +{ + this->elem_number_ = 0; + + for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls); + !si.is_done (); + si.next()) + { + AST_Decl *d = si.item (); + + if (!d) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_scope::visit_scope - " + "bad node in this scope\n"), + -1); + + } + + be_field *field = be_field::narrow_from_decl (d); + + if (field) + { + be_visitor_context ctx (*this->ctx_); + be_visitor_valuetype_field_cdr_ch visitor (&ctx); + visitor.pre_ = node->field_pd_prefix (); + visitor.post_ = node->field_pd_postfix (); + + if (visitor.visit_field (field) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_valuetype_marshal_ch::" + "visit_valuetype - " + "codegen for scope failed\n"), + -1); + } + } + } + + return 0; +} + +int +be_visitor_valuetype_marshal_ch::visit_eventtype (be_eventtype *node) +{ + return this->visit_valuetype (node); +} + |