summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be/be_visitor_module/module_sh.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_module/module_sh.cpp')
-rw-r--r--TAO/TAO_IDL/be/be_visitor_module/module_sh.cpp87
1 files changed, 87 insertions, 0 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_module/module_sh.cpp b/TAO/TAO_IDL/be/be_visitor_module/module_sh.cpp
new file mode 100644
index 00000000000..7466b7aa0f6
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_module/module_sh.cpp
@@ -0,0 +1,87 @@
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// module_sh.cpp
+//
+// = DESCRIPTION
+// Visitor generating code for Module in the server header
+//
+// = AUTHOR
+// Aniruddha Gokhale
+//
+// ============================================================================
+
+ACE_RCSID (be_visitor_module,
+ module_sh,
+ "$Id$")
+
+// ************************************************************
+// Module visitor for server header
+// ************************************************************
+
+be_visitor_module_sh::be_visitor_module_sh (be_visitor_context *ctx)
+ : be_visitor_module (ctx)
+{
+}
+
+be_visitor_module_sh::~be_visitor_module_sh (void)
+{
+}
+
+int
+be_visitor_module_sh::visit_module (be_module *node)
+{
+ // Not generated and not imported.
+ if (node->srv_hdr_gen () || node->imported ())
+ {
+ return 0;
+ }
+
+ TAO_OutStream *os = this->ctx_->stream ();
+
+ *os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
+ << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
+
+ // Generate the skeleton class name.
+
+ // Now generate the class definition. The prefix POA_ is prepended to our
+ // name only if we are the outermost module.
+ *os << "namespace ";
+
+ if (!node->is_nested ())
+ {
+ // We are outermost module.
+ *os << "POA_" << node->local_name () << be_nl;
+ }
+ else
+ {
+ // We are inside another module.
+ *os << node->local_name () << be_nl;
+ }
+
+ *os << "{" << be_idt_nl;
+
+ if (this->visit_scope (node) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_module_sh::"
+ "visit_module - "
+ "codegen for scope failed\n"),
+ -1);
+ }
+
+ *os << be_uidt_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
+ << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
+
+ *os << "} // module "
+ << node->name ();
+
+ return 0;
+
+}