diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 2004-12-29 19:29:27 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 2004-12-29 19:29:27 +0000 |
commit | ae4012b805ff947e3b9b6ebcab9c56ec505e8790 (patch) | |
tree | 94244be91735316af339b4c2a347f2e8e53c391f | |
parent | 0a7d4887d609fef999e43fa80fc4d6060a353ea5 (diff) | |
download | ATCD-ae4012b805ff947e3b9b6ebcab9c56ec505e8790.tar.gz |
*** empty log message ***
8 files changed, 358 insertions, 240 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode.cpp index 25fef2fdded..9f9b5559c89 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode.cpp @@ -47,6 +47,9 @@ #include "be_visitor_typecode/typecode_decl.cpp" #include "be_visitor_typecode/typecode_defn.cpp" +#include "be_visitor_typecode/alias_typecode.cpp" + + ACE_RCSID (be, be_visitor_typecode, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/alias_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/alias_typecode.cpp new file mode 100644 index 00000000000..558b3b3b219 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_typecode/alias_typecode.cpp @@ -0,0 +1,45 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file alias_typecode.cpp + * + * $Id$ + * + * Alias (typedef) TypeCode generation visitor. + * + * @author Ossama Othman <ossama@dre.vanderbilt.edu> + */ +//============================================================================= + + +TAO::be_visitor_alias_typecode::be_visitor_alias_typecode ( + be_visitor_context * ctx) + : be_visitor_typecode_defn (ctx) +{ +} + +int +TAO::be_visitor_alias_typecode::visit_typedef (be_typedef * node) +{ + be_type * const base = be_type::narrow_from_decl (node->base_type ()); + + 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::Alias<const char *," << 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 + << "&" << base->tc_name () << ");" << be_uidt_nl + << be_uidt_nl; + + return this->gen_typecode_ptr (node); +} diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp index b51004f3d57..ab3cab500b1 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_decl.cpp @@ -58,7 +58,7 @@ be_visitor_typecode_decl::visit_type (be_type *node) *os << "static "; } - *os << "::CORBA::TypeCode_ptr " + *os << "::CORBA::TypeCode_ptr const " << node->tc_name ()->last_component () << ";"; } @@ -66,7 +66,7 @@ be_visitor_typecode_decl::visit_type (be_type *node) { // We are in the ROOT scope. *os << "extern " << be_global->stub_export_macro () - << " ::CORBA::TypeCode_ptr " + << " ::CORBA::TypeCode_ptr const" << " " << node->tc_name ()->last_component () << ";"; } 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 a4abdb28140..61f334e6edf 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp @@ -355,9 +355,9 @@ be_visitor_typecode_defn::visit_type (be_type *node) case AST_Decl::NT_struct: *os << "CORBA::tk_struct"; break; - case AST_Decl::NT_typedef: - *os << "CORBA::tk_alias"; - break; +// case AST_Decl::NT_typedef: +// *os << "CORBA::tk_alias"; +// break; case AST_Decl::NT_union: *os << "CORBA::tk_union"; break; @@ -383,6 +383,14 @@ be_visitor_typecode_defn::visit_type (be_type *node) << "sizeof (" << node->name () << ")" << be_uidt_nl << ");" << be_uidt_nl << be_nl; + return this->gen_typecode_ptr (node); +} + +int +be_visitor_typecode_defn::gen_typecode_ptr (be_type * node) +{ + 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. @@ -399,12 +407,12 @@ be_visitor_typecode_defn::visit_type (be_type *node) -1); } - *os << "::CORBA::TypeCode_ptr _tc_" - << node->local_name () - << " =" << be_idt_nl - << "&_tc_TAO_tc_" - << node->flat_name () << ";" - << be_uidt; + os << "::CORBA::TypeCode_ptr const _tc_" + << node->local_name () + << " =" << be_idt_nl + << "&_tc_TAO_tc_" + << node->flat_name () << ";" + << be_uidt; if (this->gen_nested_namespace_end (module) == -1) { @@ -417,18 +425,18 @@ be_visitor_typecode_defn::visit_type (be_type *node) else { // outermost scope. - *os << "::CORBA::TypeCode_ptr "; + os << "::CORBA::TypeCode_ptr const "; // Tc name generation. - *os << node->tc_name (); + os << node->tc_name (); - *os << " =" << be_idt_nl - << "&_tc_TAO_tc_"; + os << " =" << be_idt_nl + << "&_tc_TAO_tc_"; // Flat name generation. - *os << node->flat_name (); + os << node->flat_name (); - *os << ";" << be_uidt; + os << ";" << be_uidt; } return 0; @@ -740,34 +748,34 @@ be_visitor_typecode_defn::visit_structure (be_structure *node) -1); } -int -be_visitor_typecode_defn::visit_typedef (be_typedef *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); -} +// int +// be_visitor_typecode_defn::visit_typedef (be_typedef *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); +// } int be_visitor_typecode_defn::visit_union (be_union *node) @@ -1797,119 +1805,119 @@ be_visitor_typecode_defn::gen_encapsulation (be_structure *node) return 0; } -int -be_visitor_typecode_defn::gen_typecode (be_typedef *node) -{ - TAO_OutStream *os = this->ctx_->stream (); // output stream - - 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); - - 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 - { - // Insert node into tc_queue_ in case the node is involved in - // some form of recursion. - 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_alias, // typecode kind for typedefs" << be_nl; - // size of the enum - this->tc_offset_ += sizeof (ACE_CDR::ULong); - - { - 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 (typedef) - ") - 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); - - // 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 (typedef) - ") - ACE_TEXT ("failed to generate encapsulation\n")), - -1); - } - - *os << be_uidt << "\n"; - } - return 0; -} - -int -be_visitor_typecode_defn::gen_encapsulation (be_typedef *node) -{ - TAO_OutStream *os = this->ctx_->stream (); // output stream - be_type *bt; // base type - - 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); - - // generate repoID - this->gen_repoID (node); - - // generate name - os->indent (); - this->gen_name (node); - - // generate typecode for the base type - bt = be_type::narrow_from_decl (node->base_type ()); - this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED); - - if (!bt || bt->accept (this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("(%N:%l) be_visitor_typecode_defn") - ACE_TEXT ("::gen_encapsulation (typedef) - ") - ACE_TEXT ("failed to generate typecode\n")), - -1); - } - - return 0; -} +// int +// be_visitor_typecode_defn::gen_typecode (be_typedef *node) +// { +// TAO_OutStream *os = this->ctx_->stream (); // output stream + +// 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); + +// 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 +// { +// // Insert node into tc_queue_ in case the node is involved in +// // some form of recursion. +// 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_alias, // typecode kind for typedefs" << be_nl; +// // size of the enum +// this->tc_offset_ += sizeof (ACE_CDR::ULong); + +// { +// 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 (typedef) - ") +// 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); + +// // 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 (typedef) - ") +// ACE_TEXT ("failed to generate encapsulation\n")), +// -1); +// } + +// *os << be_uidt << "\n"; +// } +// return 0; +// } + +// int +// be_visitor_typecode_defn::gen_encapsulation (be_typedef *node) +// { +// TAO_OutStream *os = this->ctx_->stream (); // output stream +// be_type *bt; // base type + +// 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); + +// // generate repoID +// this->gen_repoID (node); + +// // generate name +// os->indent (); +// this->gen_name (node); + +// // generate typecode for the base type +// bt = be_type::narrow_from_decl (node->base_type ()); +// this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE_NESTED); + +// if (!bt || bt->accept (this) == -1) +// { +// ACE_ERROR_RETURN ((LM_ERROR, +// ACE_TEXT ("(%N:%l) be_visitor_typecode_defn") +// ACE_TEXT ("::gen_encapsulation (typedef) - ") +// ACE_TEXT ("failed to generate typecode\n")), +// -1); +// } + +// return 0; +// } int be_visitor_typecode_defn::gen_typecode (be_union *node) @@ -3057,84 +3065,84 @@ be_visitor_typecode_defn::compute_encap_length (be_structure *node) } -ACE_CDR::Long -be_visitor_typecode_defn::compute_tc_size (be_typedef *node) -{ - // while computing the encapsulation length we must keep in mind the typecode - // that has gotten generated until this point. Hence, we must first check the - // "tc_queue" to ensure if are already there somewhere in a previous - // encapsulation in which case we must count only the bytes for the - // indirection. If we are not already generated, we must then check if we - // have already been counted in the current computation or not by checking - // for our presence in the compute queue. In both cases, we only include the - // 8 bytes in the computation - if (be_global->opt_tc () - && (this->queue_lookup (this->tc_queue_, node) - || this->queue_lookup (this->compute_queue_, node))) - { - this->computed_tc_size_ = 4 + 4; - } - else - { - if (this->queue_insert (this->compute_queue_, - node, - this->tc_offset_) - == 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_visitor_typecode_defn::" - "compute_tc_size (typedef) - " - "queue insert failed\n"), - -1); - } - - 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 ("::compute_tc_size (array) - ") - ACE_TEXT ("cannot compute encap len\n")), - -1); - } - - this->computed_tc_size_ = 4 + 4 + this->computed_encap_len_; - } - - return this->computed_tc_size_; -} - - -ACE_CDR::Long -be_visitor_typecode_defn::compute_encap_length (be_typedef *node) -{ - be_type *bt; // base type - ACE_CDR::Long encap_len = 4; // holds the byte order flag - - encap_len += - this->repoID_encap_len (node); // repoID - - // do the same thing for the local name - encap_len += - this->name_encap_len (node); - - // add the encapsulation length of our base type - bt = be_type::narrow_from_decl (node->base_type ()); - this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TC_SIZE); - if (!bt || bt->accept (this) == -1) - - { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("(%N:%l) be_visitor_typecode_defn") - ACE_TEXT ("::compute_encap_len (typedef) - ") - ACE_TEXT ("cannot compute tc size\n")), - -1); - } - - this->computed_encap_len_ = encap_len + this->computed_tc_size_; - return this->computed_encap_len_; -} +// ACE_CDR::Long +// be_visitor_typecode_defn::compute_tc_size (be_typedef *node) +// { +// // while computing the encapsulation length we must keep in mind the typecode +// // that has gotten generated until this point. Hence, we must first check the +// // "tc_queue" to ensure if are already there somewhere in a previous +// // encapsulation in which case we must count only the bytes for the +// // indirection. If we are not already generated, we must then check if we +// // have already been counted in the current computation or not by checking +// // for our presence in the compute queue. In both cases, we only include the +// // 8 bytes in the computation +// if (be_global->opt_tc () +// && (this->queue_lookup (this->tc_queue_, node) +// || this->queue_lookup (this->compute_queue_, node))) +// { +// this->computed_tc_size_ = 4 + 4; +// } +// else +// { +// if (this->queue_insert (this->compute_queue_, +// node, +// this->tc_offset_) +// == 0) +// { +// ACE_ERROR_RETURN ((LM_ERROR, +// "(%N:%l) be_visitor_typecode_defn::" +// "compute_tc_size (typedef) - " +// "queue insert failed\n"), +// -1); +// } + +// 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 ("::compute_tc_size (array) - ") +// ACE_TEXT ("cannot compute encap len\n")), +// -1); +// } + +// this->computed_tc_size_ = 4 + 4 + this->computed_encap_len_; +// } + +// return this->computed_tc_size_; +// } + + +// ACE_CDR::Long +// be_visitor_typecode_defn::compute_encap_length (be_typedef *node) +// { +// be_type *bt; // base type +// ACE_CDR::Long encap_len = 4; // holds the byte order flag + +// encap_len += +// this->repoID_encap_len (node); // repoID + +// // do the same thing for the local name +// encap_len += +// this->name_encap_len (node); + +// // add the encapsulation length of our base type +// bt = be_type::narrow_from_decl (node->base_type ()); +// this->ctx_->sub_state (TAO_CodeGen::TAO_TC_DEFN_TC_SIZE); +// if (!bt || bt->accept (this) == -1) + +// { +// ACE_ERROR_RETURN ((LM_ERROR, +// ACE_TEXT ("(%N:%l) be_visitor_typecode_defn") +// ACE_TEXT ("::compute_encap_len (typedef) - ") +// ACE_TEXT ("cannot compute tc size\n")), +// -1); +// } + +// this->computed_encap_len_ = encap_len + this->computed_tc_size_; +// return this->computed_encap_len_; +// } ACE_CDR::Long 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 5e1cef76908..2909830d971 100644 --- a/TAO/TAO_IDL/be/be_visitor_typedef/typedef_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typedef/typedef_cs.cpp @@ -126,7 +126,7 @@ be_visitor_typedef_cs::visit_typedef (be_typedef *node) { be_visitor_context ctx (*this->ctx_); ctx.sub_state (TAO_CodeGen::TAO_TC_DEFN_TYPECODE); - be_visitor_typecode_defn visitor (&ctx); + 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 1942889a4c8..e5a148d1bce 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_typecode.h +++ b/TAO/TAO_IDL/be_include/be_visitor_typecode.h @@ -28,5 +28,7 @@ #include "be_visitor_typecode/typecode_decl.h" #include "be_visitor_typecode/typecode_defn.h" +#include "be_visitor_typecode/alias_typecode.h" + #endif /* TAO_BE_VISITOR_TYPECODE_H */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_typecode/alias_typecode.h b/TAO/TAO_IDL/be_include/be_visitor_typecode/alias_typecode.h new file mode 100644 index 00000000000..66d182d648a --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_typecode/alias_typecode.h @@ -0,0 +1,54 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file alias_typecode.h + * + * $Id$ + * + * Alias (typedef) TypeCode generation visitor. + * + * @author Ossama Othman <ossama@dre.vanderbilt.edu> + */ +//============================================================================= + +#ifndef TAO_BE_VISITOR_ALIAS_TYPECODE_H +#define TAO_BE_VISITOR_ALIAS_TYPECODE_H + +#include "ace/pre.h" + +namespace TAO +{ + + /** + * @class be_visitor_alias_typecode + * + * @brief Alias (typedef) TypeCode generation visitor. + * + * Alias (typedef) TypeCode generation visitor. + */ + class be_visitor_alias_typecode + : public be_visitor_typecode_defn + { + public: + + /// Constructor. + be_visitor_alias_typecode (be_visitor_context * ctx); + + /// Visit a typedef. + /** + * @todo The legacy method name "@c visit_typedef()" 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_typedef (be_typedef * node); + + }; + +} + +#include "ace/post.h" + +#endif /* TAO_BE_VISITOR_ALIAS_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 31557af93d0..c3e0d9aa202 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 @@ -90,9 +90,6 @@ public: virtual int visit_structure (be_structure *node); // visit a structure - virtual int visit_typedef (be_typedef *node); - // visit a typedef - virtual int visit_union (be_union *node); // visit a union @@ -270,6 +267,15 @@ public: ACE_CDR::Long offset; }; +protected: + + /// Generate the TypeCode_ptr. + /** + * Generate actual TypeCode instance/definition, not the supporting + * code, e.g. "static CORBA::TypeCode_ptr const Foo_ptr = ...". + */ + int gen_typecode_ptr (be_type * node); + private: // |