diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-07-12 08:21:28 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-07-12 08:21:28 +0000 |
commit | d2f0da8c66586cb487f7bb10b40f0ccd81237743 (patch) | |
tree | f727076bd18c8241aa3312826ac4cfea09ef368a /TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp | |
parent | aa30c8711cfe2c1837eedfcd7ae1b699cbe8969a (diff) | |
download | ATCD-d2f0da8c66586cb487f7bb10b40f0ccd81237743.tar.gz |
ChangeLogTag: Mon Jul 12 08:19:49 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp')
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp | 83 |
1 files changed, 13 insertions, 70 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp index c605c0c83b5..874ba46a403 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp @@ -24,60 +24,6 @@ be_visitor_operation_upcall_command_ss::~be_visitor_operation_upcall_command_ss { } -// The following needs to be done to deal until the MSVC compiler's broken -// handling of namespaces is fixed (hopefully forthcoming in version 7). -int -be_visitor_operation_upcall_command_ss::gen_nested_namespace_begin ( - be_module *node) -{ - TAO_OutStream *os = this->ctx_->stream (); - char *item_name = 0; - bool first_level = true; - - for (UTL_IdListActiveIterator i (node->name ()); !i.is_done (); i.next ()) - { - item_name = i.item ()->get_string (); - - if (ACE_OS::strcmp (item_name, "") != 0) - { - // Leave the outermost root scope. - *os << "namespace "; - - if (first_level) - { - // We are outermost module. - *os << "POA_"; - first_level = false; - } - - *os << item_name << be_nl - << "{" << be_idt_nl; - } - } - - return 0; -} - -// The following needs to be done to deal until the MSVC compiler's broken -// handling of namespaces is fixed (hopefully forthcoming in version 7). -int -be_visitor_operation_upcall_command_ss::gen_nested_namespace_end ( - be_module *node) -{ - TAO_OutStream *os = this->ctx_->stream (); - - for (UTL_IdListActiveIterator i (node->name ()); !i.is_done (); i.next ()) - { - if (ACE_OS::strcmp (i.item ()->get_string (), "") != 0) - { - // Leave the outermost root scope. - *os << be_uidt_nl << "}" << be_nl; - } - } - - return 0; -} - int be_visitor_operation_upcall_command_ss::visit ( be_operation * node, @@ -96,14 +42,16 @@ be_visitor_operation_upcall_command_ss::visit ( if (!intf) { ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_upcall_command_ss::" - "visit - " - "bad interface scope\n"), + ACE_TEXT ("be_visitor_upcall_command_ss::") + ACE_TEXT ("visit - ") + ACE_TEXT ("bad interface scope\n")), -1); } be_module *module = 0; + TAO_OutStream & os = *this->ctx_->stream (); + // Is our enclosing scope a module? We need this check because for // platforms that support namespaces, the typecode must be declared // extern. @@ -112,22 +60,23 @@ be_visitor_operation_upcall_command_ss::visit ( { module = be_module::narrow_from_scope (intf->defined_in ()); - if (!module || (this->gen_nested_namespace_begin (module) == -1)) + if (module == 0) { ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_operation_upcall_command_ss::visit - " - "Error parsing nested name\n"), + ACE_TEXT ("be_visitor_operation_") + ACE_TEXT ("upcall_command_ss::visit - ") + ACE_TEXT ("Error parsing nested name\n")), -1); } - } + be_util::gen_nested_namespace_begin (&os, module, true); + } + be_visitor_context ctx (*this->ctx_); // save the node. this->ctx_->node (node); - TAO_OutStream & os = *this->ctx_->stream (); - os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl; @@ -254,13 +203,7 @@ be_visitor_operation_upcall_command_ss::visit ( if (module != 0) { - if (this->gen_nested_namespace_end (module) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_operation_upcall_command_ss::visit - " - "Error parsing nested name\n"), - -1); - } + be_util::gen_nested_namespace_end (&os, module); } return 0; |