summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2005-01-07 09:11:02 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2005-01-07 09:11:02 +0000
commit547993a828406a3f1ebf45a350bab1123e2ea770 (patch)
tree8f61aa7b32f499a4572f1aeed56ac7f928d67a30
parent5312e0d3c5080c0dd000f63db29d5dd56b73720a (diff)
downloadATCD-547993a828406a3f1ebf45a350bab1123e2ea770.tar.gz
*** empty log message ***
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp4
-rw-r--r--TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp4
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typecode.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typecode/alias_typecode.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typecode/objref_typecode.cpp42
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp97
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp334
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typedef/typedef_cs.cpp2
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_typecode.h2
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_typecode/objref_typecode.h54
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_typecode/struct_typecode.h59
-rw-r--r--TAO/TAO_IDL/be_include/be_visitor_typecode/typecode_defn.h10
12 files changed, 434 insertions, 178 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp
index 071136f1ee2..8a15a18139a 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp
@@ -454,8 +454,8 @@ be_visitor_interface_cs::visit_interface (be_interface *node)
if (be_global->tc_support ())
{
be_visitor_context ctx = *this->ctx_;
- ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE);
- be_visitor_typecode_defn tc_visitor (&ctx);
+ // ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE);
+ TAO::be_visitor_objref_typecode tc_visitor (&ctx);
if (node->accept (&tc_visitor) == -1)
{
diff --git a/TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp b/TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp
index 93262de456e..fe7103074a5 100644
--- a/TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_structure/structure_cs.cpp
@@ -46,8 +46,8 @@ be_visitor_structure_cs::visit_structure (be_structure *node)
if (be_global->tc_support ())
{
be_visitor_context ctx (*this->ctx_);
- ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE);
- be_visitor_typecode_defn visitor (&ctx);
+ // ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE);
+ TAO::be_visitor_struct_typecode visitor (&ctx);
if (visitor.visit_structure (node) == -1)
{
diff --git a/TAO/TAO_IDL/be/be_visitor_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode.cpp
index 9f9b5559c89..ceac4cd8d90 100644
--- a/TAO/TAO_IDL/be/be_visitor_typecode.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_typecode.cpp
@@ -48,6 +48,8 @@
#include "be_visitor_typecode/typecode_defn.cpp"
#include "be_visitor_typecode/alias_typecode.cpp"
+#include "be_visitor_typecode/objref_typecode.cpp"
+#include "be_visitor_typecode/struct_typecode.cpp"
ACE_RCSID (be,
diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/alias_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/alias_typecode.cpp
index 558b3b3b219..0b8ececd286 100644
--- a/TAO/TAO_IDL/be/be_visitor_typecode/alias_typecode.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_typecode/alias_typecode.cpp
@@ -32,7 +32,7 @@ TAO::be_visitor_alias_typecode::visit_typedef (be_typedef * node)
// Generate the TypeCode instantiation.
os
- << "static TAO::TypeCode::Alias<const char *," << be_nl
+ << "static TAO::TypeCode::Alias<char const *," << be_nl
<< " TAO::Null_RefCount_Policy> const"
<< be_idt_nl
<< "_tao_tc_" << node->flat_name () << " (" << be_idt_nl
diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/objref_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/objref_typecode.cpp
new file mode 100644
index 00000000000..66bb1bd3952
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_typecode/objref_typecode.cpp
@@ -0,0 +1,42 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file objref_typecode.cpp
+ *
+ * $Id$
+ *
+ * Object reference TypeCode generation visitor.
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+TAO::be_visitor_objref_typecode::be_visitor_objref_typecode (
+ be_visitor_context * ctx)
+ : be_visitor_typecode_defn (ctx)
+{
+}
+
+int
+TAO::be_visitor_objref_typecode::visit_interface (be_interface * node)
+{
+ 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 TypeCode instantiation.
+ os
+ << "static TAO::TypeCode::Objref<char const *," << be_nl
+ << " TAO::Null_RefCount_Policy> const"
+ << be_idt_nl
+ << "_tao_tc_" << node->flat_name () << " (" << be_idt_nl
+ << "\"" << node->repoID () << "\"," << be_nl
+ << "\"" << node->original_local_name () << "\");" << be_uidt_nl
+ << be_uidt_nl;
+
+ return this->gen_typecode_ptr (node);
+}
diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp
new file mode 100644
index 00000000000..de9d810b5aa
--- /dev/null
+++ b/TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp
@@ -0,0 +1,97 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file struct_typecode.cpp
+ *
+ * $Id$
+ *
+ * Structure TypeCode generation visitor.
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+
+#include <string>
+
+
+TAO::be_visitor_struct_typecode::be_visitor_struct_typecode (
+ be_visitor_context * ctx)
+ : be_visitor_typecode_defn (ctx)
+{
+}
+
+int
+TAO::be_visitor_struct_typecode::visit_structure (be_structure * node)
+{
+ TAO_OutStream & os = *this->ctx_->stream ();
+
+ os << be_nl << be_nl
+ << "// TAO_IDL - Generated from" << be_nl
+ << "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
+
+
+ std::string const fields_name (std::string ("_tao_fields_")
+ + node->flat_name ());
+
+ // Generate array containing struct field characteristics.
+ os << "static TAO::TypeCode::Field<char const *> const "
+ << fields_name.c_str ()
+ << " =" << be_idt_nl
+ << "{" << be_idt_nl;
+
+ if (this->visit_members (node) != 0)
+ return -1;
+
+ os << be_uidt_nl
+ << "};" << be_uidt_nl << be_nl;
+
+
+ // Generate the TypeCode instantiation.
+ os
+ << "static TAO::TypeCode::Struct<char const *," << be_nl
+ << " TAO::Null_RefCount_Policy> const"
+ << be_idt_nl
+ << "_tao_tc_" << node->flat_name () << " (" << be_idt_nl
+ << "\"" << node->repoID () << "\"," << be_nl
+ << "\"" << node->original_local_name () << "\"," << be_nl
+ << "_tao_fields_" << node->flat_name () << "," << be_nl
+ << node->nfields () << ");" << be_uidt_nl
+ << be_uidt_nl;
+
+ return this->gen_typecode_ptr (node);
+}
+
+int
+TAO::be_visitor_struct_typecode::visit_members (be_structure * node)
+{
+ AST_Field ** member_ptr = 0;
+
+ size_t const count = node->nfields ();
+
+ TAO_OutStream & os = *this->ctx_->stream ();
+
+ for (size_t i = 0; i < count; ++i)
+ {
+ node->field (member_ptr, i);
+
+ be_decl * const member_decl =
+ be_decl::narrow_from_decl (*member_ptr);
+
+ be_type * const member_type =
+ be_type::narrow_from_decl ((*member_ptr)->field_type ());
+
+ os << "{ "
+ << "\"" << member_decl->original_local_name () << "\", "
+ << "&" << member_type->tc_name ()
+ << " }";
+
+ if (i < count - 1)
+ os << ",";
+
+ os << be_nl;
+ }
+
+ return 0;
+}
diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp
index 61f334e6edf..61cfa07e83e 100644
--- a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp
@@ -77,69 +77,69 @@ be_visitor_typecode_defn::~be_visitor_typecode_defn (void)
this->queue_reset (this->compute_queue_);
}
-int
-be_visitor_typecode_defn::visit_members (AST_Structure *node)
-{
- this->elem_number_ = 0;
- AST_Field **member_ptr = 0;
- size_t count = node->nfields ();
- be_decl *enclosing = be_decl::narrow_from_decl (node);
+// int
+// be_visitor_typecode_defn::visit_members (AST_Structure *node)
+// {
+// this->elem_number_ = 0;
+// AST_Field **member_ptr = 0;
+// size_t count = node->nfields ();
+// be_decl *enclosing = be_decl::narrow_from_decl (node);
- for (size_t i = 0; i < count; ++i)
- {
- node->field (member_ptr, i);
+// for (size_t i = 0; i < count; ++i)
+// {
+// node->field (member_ptr, i);
- be_decl *bd = be_decl::narrow_from_decl (*member_ptr);
+// be_decl *bd = be_decl::narrow_from_decl (*member_ptr);
- // Set the node to be visited.
- this->ctx_->node (bd);
+// // Set the node to be visited.
+// this->ctx_->node (bd);
- // Reset this with every iteration - it might be changed
- // when it comes around again.
- this->ctx_->scope (enclosing);
+// // Reset this with every iteration - it might be changed
+// // when it comes around again.
+// this->ctx_->scope (enclosing);
- this->elem_number_++;
+// this->elem_number_++;
- // Do any pre processing using the next item info.
- if (this->pre_process (bd) == -1)
- {
- ACE_ERROR_RETURN ((
- LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::visit_members - "
- "pre processing failed\n"
- ),
- -1
- );
- }
+// // Do any pre processing using the next item info.
+// if (this->pre_process (bd) == -1)
+// {
+// ACE_ERROR_RETURN ((
+// LM_ERROR,
+// "(%N:%l) be_visitor_typecode_defn::visit_members - "
+// "pre processing failed\n"
+// ),
+// -1
+// );
+// }
- // Send the visitor.
- if (bd == 0 || bd->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((
- LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::visit_members - "
- "codegen for scope failed\n"
- ),
- -1
- );
+// // Send the visitor.
+// if (bd == 0 || bd->accept (this) == -1)
+// {
+// ACE_ERROR_RETURN ((
+// LM_ERROR,
+// "(%N:%l) be_visitor_typecode_defn::visit_members - "
+// "codegen for scope failed\n"
+// ),
+// -1
+// );
- }
+// }
- // Do any post processing using this item info.
- if (this->post_process (bd) == -1)
- {
- ACE_ERROR_RETURN ((
- LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::visit_members - "
- "post processing failed\n"
- ),
- -1
- );
- }
- }
+// // Do any post processing using this item info.
+// if (this->post_process (bd) == -1)
+// {
+// ACE_ERROR_RETURN ((
+// LM_ERROR,
+// "(%N:%l) be_visitor_typecode_defn::visit_members - "
+// "post processing failed\n"
+// ),
+// -1
+// );
+// }
+// }
- return 0;
-}
+// return 0;
+// }
int
be_visitor_typecode_defn::visit_members (be_valuetype *node)
@@ -337,9 +337,9 @@ be_visitor_typecode_defn::visit_type (be_type *node)
case AST_Decl::NT_except:
*os << "CORBA::tk_except";
break;
- case AST_Decl::NT_interface:
- *os << "CORBA::tk_objref";
- break;
+// case AST_Decl::NT_interface:
+// *os << "CORBA::tk_objref";
+// break;
case AST_Decl::NT_valuetype:
*os << "CORBA::tk_value";
break;
@@ -410,7 +410,7 @@ be_visitor_typecode_defn::gen_typecode_ptr (be_type * node)
os << "::CORBA::TypeCode_ptr const _tc_"
<< node->local_name ()
<< " =" << be_idt_nl
- << "&_tc_TAO_tc_"
+ << "&_tao_tc_"
<< node->flat_name () << ";"
<< be_uidt;
@@ -548,7 +548,7 @@ be_visitor_typecode_defn::visit_exception (be_exception *node)
return ((this->computed_encap_len_ > 0) ? 0 : -1);
case TAO_CodeGen::TAO_TC_DEFN_SCOPE:
case TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN:
- return this->visit_members (node);
+// return this->visit_members (node);
default:
// error
break;
@@ -583,34 +583,34 @@ be_visitor_typecode_defn::visit_field (be_field *node)
-1);
}
-int
-be_visitor_typecode_defn::visit_interface (be_interface *node)
-{
- switch (this->ctx_->sub_state ())
- {
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE:
- return this->visit_type (node);
- case TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED:
- return this->gen_typecode (node);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION:
- return this->gen_encapsulation (node);
- case TAO_CodeGen::TAO_TC_DEFN_TC_SIZE:
- this->computed_tc_size_ = this->compute_tc_size (node);
- return ((this->computed_tc_size_ > 0) ? 0 : -1);
- case TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN:
- this->computed_encap_len_ = this->compute_encap_length (node);
- return ((this->computed_encap_len_ > 0) ? 0 : -1);
- default:
- // error
- break;
- }
+// int
+// be_visitor_typecode_defn::visit_interface (be_interface *node)
+// {
+// switch (this->ctx_->sub_state ())
+// {
+// case TAO_CodeGen::TAO_TC_DEFN_TYPECODE:
+// return this->visit_type (node);
+// case TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED:
+// return this->gen_typecode (node);
+// case TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION:
+// return this->gen_encapsulation (node);
+// case TAO_CodeGen::TAO_TC_DEFN_TC_SIZE:
+// this->computed_tc_size_ = this->compute_tc_size (node);
+// return ((this->computed_tc_size_ > 0) ? 0 : -1);
+// case TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN:
+// this->computed_encap_len_ = this->compute_encap_length (node);
+// return ((this->computed_encap_len_ > 0) ? 0 : -1);
+// default:
+// // error
+// break;
+// }
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("(%N:%l) be_visitor_typecode_defn::")
- ACE_TEXT ("visit - bad sub state ")
- ACE_TEXT ("in visitor context\n")),
- -1);
-}
+// ACE_ERROR_RETURN ((LM_ERROR,
+// ACE_TEXT ("(%N:%l) be_visitor_typecode_defn::")
+// ACE_TEXT ("visit - bad sub state ")
+// ACE_TEXT ("in visitor context\n")),
+// -1);
+// }
int
be_visitor_typecode_defn::visit_component (be_component *node)
@@ -735,7 +735,7 @@ be_visitor_typecode_defn::visit_structure (be_structure *node)
return ((this->computed_encap_len_ > 0) ? 0 : -1);
case TAO_CodeGen::TAO_TC_DEFN_SCOPE:
case TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN:
- return this->visit_members (node);
+// return this->visit_members (node);
default:
// error
break;
@@ -796,7 +796,7 @@ be_visitor_typecode_defn::visit_union (be_union *node)
return ((this->computed_encap_len_ > 0) ? 0 : -1);
case TAO_CodeGen::TAO_TC_DEFN_SCOPE:
case TAO_CodeGen::TAO_TC_DEFN_SCOPE_LEN:
- return this->visit_members (node);
+// return this->visit_members (node);
default:
// error
break;
@@ -1299,100 +1299,100 @@ be_visitor_typecode_defn::gen_encapsulation (be_field *node)
return 0;
}
-int
-be_visitor_typecode_defn::gen_typecode (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
+// int
+// be_visitor_typecode_defn::gen_typecode (be_interface *node)
+// {
+// TAO_OutStream *os = this->ctx_->stream (); // output stream
- os->indent (); // start from whatever indentation level we were at
+// os->indent (); // start from whatever indentation level we were at
- // check if we are repeated
- const be_visitor_typecode_defn::QNode *qnode =
- this->queue_lookup (this->tc_queue_, node);
+// // check if we are repeated
+// const be_visitor_typecode_defn::QNode *qnode =
+// this->queue_lookup (this->tc_queue_, node);
- if (qnode && be_global->opt_tc ())
- {
- // we are repeated, so we must generate an indirection here
- *os << "0xffffffff, // indirection" << be_nl;
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- // the offset must point to the tc_kind value of the first occurrence of
- // this type
- os->print ("0x%x, // negative offset (%ld)\n",
- (qnode->offset - this->tc_offset_),
- (qnode->offset - this->tc_offset_));
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
- }
- else
- {
- if (this->queue_insert (this->tc_queue_, node, this->tc_offset_) == 0)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_typecode_defn::"
- "visit_type - "
- "queue insert failed\n"),
- -1);
- }
+// if (qnode && be_global->opt_tc ())
+// {
+// // we are repeated, so we must generate an indirection here
+// *os << "0xffffffff, // indirection" << be_nl;
+// this->tc_offset_ += sizeof (ACE_CDR::ULong);
+// // the offset must point to the tc_kind value of the first occurrence of
+// // this type
+// os->print ("0x%x, // negative offset (%ld)\n",
+// (qnode->offset - this->tc_offset_),
+// (qnode->offset - this->tc_offset_));
+// this->tc_offset_ += sizeof (ACE_CDR::ULong);
+// }
+// else
+// {
+// if (this->queue_insert (this->tc_queue_, node, this->tc_offset_) == 0)
+// {
+// ACE_ERROR_RETURN ((LM_ERROR,
+// "(%N:%l) be_visitor_typecode_defn::"
+// "visit_type - "
+// "queue insert failed\n"),
+// -1);
+// }
- *os << "CORBA::tk_objref, // typecode kind" << be_nl;
- // size of the enum
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
+// *os << "CORBA::tk_objref, // typecode kind" << be_nl;
+// // size of the enum
+// this->tc_offset_ += sizeof (ACE_CDR::ULong);
- {
- Scoped_Compute_Queue_Guard guard (this);
+// {
+// Scoped_Compute_Queue_Guard guard (this);
- // emit the encapsulation length
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("(%N:%l) - be_visitor_typecode_defn")
- ACE_TEXT ("gen_typecode (interface) - ")
- ACE_TEXT ("Failed to get encap length\n")),
- -1);
- }
- }
+// // emit the encapsulation length
+// this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAP_LEN);
+// if (node->accept (this) == -1)
+// {
+// ACE_ERROR_RETURN ((LM_ERROR,
+// ACE_TEXT ("(%N:%l) - be_visitor_typecode_defn")
+// ACE_TEXT ("gen_typecode (interface) - ")
+// ACE_TEXT ("Failed to get encap length\n")),
+// -1);
+// }
+// }
- *os << this->computed_encap_len_ << ", // encapsulation length"
- << be_idt << "\n";
- // size of the encap length
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
+// *os << this->computed_encap_len_ << ", // encapsulation length"
+// << be_idt << "\n";
+// // size of the encap length
+// this->tc_offset_ += sizeof (ACE_CDR::ULong);
- // now emit the encapsulation
- this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
- if (node->accept (this) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("(%N:%l) be_visitor_typecode_defn")
- ACE_TEXT ("::gen_typecode (interface) - ")
- ACE_TEXT ("failed to generate encapsulation\n")),
- -1);
- }
- *os << be_uidt << "\n";
- }
- return 0;
-}
+// // now emit the encapsulation
+// this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_ENCAPSULATION);
+// if (node->accept (this) == -1)
+// {
+// ACE_ERROR_RETURN ((LM_ERROR,
+// ACE_TEXT ("(%N:%l) be_visitor_typecode_defn")
+// ACE_TEXT ("::gen_typecode (interface) - ")
+// ACE_TEXT ("failed to generate encapsulation\n")),
+// -1);
+// }
+// *os << be_uidt << "\n";
+// }
+// return 0;
+// }
-int
-be_visitor_typecode_defn::gen_encapsulation (be_interface *node)
-{
- TAO_OutStream *os = this->ctx_->stream (); // output stream
+// int
+// be_visitor_typecode_defn::gen_encapsulation (be_interface *node)
+// {
+// TAO_OutStream *os = this->ctx_->stream (); // output stream
- os->indent (); // start from whatever indentation level we were at
+// os->indent (); // start from whatever indentation level we were at
- *os << "TAO_ENCAP_BYTE_ORDER, // byte order" << be_nl;
- // size of the encapsulation byte order flag. Although it is 1 byte, the
- // aligned size is 4 bytes
- this->tc_offset_ += sizeof (ACE_CDR::ULong);
+// *os << "TAO_ENCAP_BYTE_ORDER, // byte order" << be_nl;
+// // size of the encapsulation byte order flag. Although it is 1 byte, the
+// // aligned size is 4 bytes
+// this->tc_offset_ += sizeof (ACE_CDR::ULong);
- // generate repoID.
- this->gen_repoID (node);
+// // generate repoID.
+// this->gen_repoID (node);
- // generate name.
- os->indent ();
- this->gen_name (node);
+// // generate name.
+// os->indent ();
+// this->gen_name (node);
- return 0;
-}
+// return 0;
+// }
int
be_visitor_typecode_defn::gen_typecode (be_interface_fwd *)
diff --git a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_cs.cpp b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_cs.cpp
index 2909830d971..647a18ab3c1 100644
--- a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_cs.cpp
@@ -125,7 +125,7 @@ be_visitor_typedef_cs::visit_typedef (be_typedef *node)
if (!node->imported () && be_global->tc_support ())
{
be_visitor_context ctx (*this->ctx_);
- ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE);
+ // ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE);
TAO::be_visitor_alias_typecode visitor (&ctx);
if (node->accept (&visitor) == -1)
diff --git a/TAO/TAO_IDL/be_include/be_visitor_typecode.h b/TAO/TAO_IDL/be_include/be_visitor_typecode.h
index e5a148d1bce..0864d86b7da 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_typecode.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_typecode.h
@@ -29,6 +29,8 @@
#include "be_visitor_typecode/typecode_defn.h"
#include "be_visitor_typecode/alias_typecode.h"
+#include "be_visitor_typecode/objref_typecode.h"
+#include "be_visitor_typecode/struct_typecode.h"
#endif /* TAO_BE_VISITOR_TYPECODE_H */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_typecode/objref_typecode.h b/TAO/TAO_IDL/be_include/be_visitor_typecode/objref_typecode.h
new file mode 100644
index 00000000000..332bdc73738
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_typecode/objref_typecode.h
@@ -0,0 +1,54 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file objref_typecode.h
+ *
+ * $Id$
+ *
+ * Object reference TypeCode generation visitor.
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_BE_VISITOR_OBJREF_TYPECODE_H
+#define TAO_BE_VISITOR_OBJREF_TYPECODE_H
+
+#include "ace/pre.h"
+
+namespace TAO
+{
+
+ /**
+ * @class be_visitor_objref_typecode
+ *
+ * @brief Object reference TypeCode generation visitor.
+ *
+ * Object reference TypeCode generation visitor.
+ */
+ class be_visitor_objref_typecode
+ : public be_visitor_typecode_defn
+ {
+ public:
+
+ /// Constructor.
+ be_visitor_objref_typecode (be_visitor_context * ctx);
+
+ /// Visit an object reference / interface.
+ /**
+ * @todo The legacy method name "@c visit_interface()" is redundant
+ * since it is obvious from the argument what kind of
+ * TypeCode is being visited. It will be changed once the
+ * rest of the legacy method names and their call sites are
+ * updated accordingly.
+ */
+ virtual int visit_interface (be_interface * node);
+
+ };
+
+}
+
+#include "ace/post.h"
+
+#endif /* TAO_BE_VISITOR_OBJREF_TYPECODE_H */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_typecode/struct_typecode.h b/TAO/TAO_IDL/be_include/be_visitor_typecode/struct_typecode.h
new file mode 100644
index 00000000000..0a350a14034
--- /dev/null
+++ b/TAO/TAO_IDL/be_include/be_visitor_typecode/struct_typecode.h
@@ -0,0 +1,59 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file struct_typecode.h
+ *
+ * $Id$
+ *
+ * Object reference TypeCode generation visitor.
+ *
+ * @author Ossama Othman <ossama@dre.vanderbilt.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_BE_VISITOR_STRUCT_TYPECODE_H
+#define TAO_BE_VISITOR_STRUCT_TYPECODE_H
+
+#include "ace/pre.h"
+
+namespace TAO
+{
+
+ /**
+ * @class be_visitor_struct_typecode
+ *
+ * @brief Structure TypeCode generation visitor.
+ *
+ * Structure TypeCode generation visitor.
+ */
+ class be_visitor_struct_typecode
+ : public be_visitor_typecode_defn
+ {
+ public:
+
+ /// Constructor.
+ be_visitor_struct_typecode (be_visitor_context * ctx);
+
+ /// Visit a structure.
+ /**
+ * @todo The legacy method name "@c visit_structure()" is
+ * redundant since it is obvious from the argument what kind
+ * of TypeCode is being visited. It will be changed once
+ * the rest of the legacy method names and their call sites
+ * are updated accordingly.
+ */
+ virtual int visit_structure (be_structure * node);
+
+ private:
+
+ /// Generate structure field related TypeCode code.
+ int visit_members (be_structure * node);
+
+ };
+
+}
+
+#include "ace/post.h"
+
+#endif /* TAO_BE_VISITOR_STRUCT_TYPECODE_H */
diff --git a/TAO/TAO_IDL/be_include/be_visitor_typecode/typecode_defn.h b/TAO/TAO_IDL/be_include/be_visitor_typecode/typecode_defn.h
index c3e0d9aa202..9b6cf948aed 100644
--- a/TAO/TAO_IDL/be_include/be_visitor_typecode/typecode_defn.h
+++ b/TAO/TAO_IDL/be_include/be_visitor_typecode/typecode_defn.h
@@ -49,7 +49,7 @@ public:
~be_visitor_typecode_defn (void);
// destructor
- virtual int visit_members (AST_Structure *node);
+ //virtual int visit_members (AST_Structure *node);
// for use with structs, exceptions, and unions.
virtual int visit_members (be_valuetype *node);
@@ -69,7 +69,7 @@ public:
virtual int visit_exception (be_exception *node);
// visit an enum
- virtual int visit_interface (be_interface *node);
+// virtual int visit_interface (be_interface *node);
// visit interface
virtual int visit_interface_fwd (be_interface_fwd *node);
@@ -127,7 +127,7 @@ public:
int gen_typecode (be_exception *node);
- int gen_typecode (be_interface *node);
+// int gen_typecode (be_interface *node);
int gen_typecode (be_interface_fwd *node);
@@ -139,7 +139,7 @@ public:
int gen_typecode (be_structure *node);
- int gen_typecode (be_typedef *node);
+// int gen_typecode (be_typedef *node);
int gen_typecode (be_union *node);
@@ -157,7 +157,7 @@ public:
int gen_encapsulation (be_field *node);
- int gen_encapsulation (be_interface *node);
+// int gen_encapsulation (be_interface *node);
int gen_encapsulation (be_interface_fwd *node);