summaryrefslogtreecommitdiff
path: root/trunk/TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ch.cpp')
-rw-r--r--trunk/TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ch.cpp79
1 files changed, 79 insertions, 0 deletions
diff --git a/trunk/TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ch.cpp b/trunk/TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ch.cpp
new file mode 100644
index 00000000000..442d4bd54f0
--- /dev/null
+++ b/trunk/TAO/TAO_IDL/be/be_visitor_interface_fwd/cdr_op_ch.cpp
@@ -0,0 +1,79 @@
+//
+// $Id$
+//
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO IDL
+//
+// = FILENAME
+// cdr_op_ch.cpp
+//
+// = DESCRIPTION
+// Visitor generating code for CDR operators for forward declared
+// interfaces. This uses compiled marshaling.
+//
+// = AUTHOR
+// Jeff Parsons
+//
+// ============================================================================
+
+ACE_RCSID (be_visitor_interface_fwd,
+ cdr_op_ch,
+ "$Id$")
+
+// ***************************************************************************
+// Forward declared interface visitor for generating CDR operator declarations
+// in the client header. Called if this node is not later defined in the file.
+// ***************************************************************************
+
+be_visitor_interface_fwd_cdr_op_ch::be_visitor_interface_fwd_cdr_op_ch (
+ be_visitor_context *ctx
+ )
+ : be_visitor_decl (ctx)
+{
+}
+
+be_visitor_interface_fwd_cdr_op_ch::~be_visitor_interface_fwd_cdr_op_ch (void)
+{
+}
+
+int
+be_visitor_interface_fwd_cdr_op_ch::visit_interface_fwd (be_interface_fwd *node)
+{
+ // If this forward declared interface is defined later in the file,
+ // the CDR operator declaration (along with the corresponding
+ // declarations for members of the interface's scope) will be
+ // generated then.
+ if (node->full_def_seen () || node->is_local ())
+ {
+ return 0;
+ }
+
+ // No CDR operations for locality constraint interfaces.
+ if (node->cli_hdr_cdr_op_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;
+
+ *os << be_global->core_versioning_begin () << be_nl;
+
+ *os << be_global->stub_export_macro () << " ::CORBA::Boolean "
+ << "operator<< (TAO_OutputCDR &, const " << node->full_name ()
+ << "_ptr );" << be_nl;
+ *os << be_global->stub_export_macro () << " ::CORBA::Boolean "
+ << "operator>> (TAO_InputCDR &, "
+ << node->full_name () << "_ptr &);\n";
+
+ *os << be_global->core_versioning_end () << be_nl;
+
+ node->cli_hdr_cdr_op_gen (1);
+ return 0;
+}