diff options
Diffstat (limited to 'TAO/TAO_IDL/be')
-rw-r--r-- | TAO/TAO_IDL/be/be_decl.cpp | 20 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp | 1 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp | 16 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_eventtype_fwd.cpp | 1 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_eventtype_fwd/eventtype_fwd_ch.cpp | 24 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp | 4 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_sequence/buffer_type.cpp | 4 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp | 16 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp | 5 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp | 7 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp | 24 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_arglist_ch.cpp | 2 |
12 files changed, 115 insertions, 9 deletions
diff --git a/TAO/TAO_IDL/be/be_decl.cpp b/TAO/TAO_IDL/be/be_decl.cpp index 9ab1742ec1f..00fbf97a237 100644 --- a/TAO/TAO_IDL/be/be_decl.cpp +++ b/TAO/TAO_IDL/be/be_decl.cpp @@ -89,7 +89,8 @@ be_decl::be_decl (void) srv_outarg_tmpl_class_gen_ (I_FALSE), srv_outarg_pragma_inst_gen_ (I_FALSE), srv_retarg_tmpl_class_gen_ (I_FALSE), - srv_retarg_pragma_inst_gen_ (I_FALSE) + srv_retarg_pragma_inst_gen_ (I_FALSE), + ccm_pre_proc_gen_ (I_FALSE) { } @@ -136,7 +137,8 @@ be_decl::be_decl (AST_Decl::NodeType type, srv_outarg_tmpl_class_gen_ (I_FALSE), srv_outarg_pragma_inst_gen_ (I_FALSE), srv_retarg_tmpl_class_gen_ (I_FALSE), - srv_retarg_pragma_inst_gen_ (I_FALSE) + srv_retarg_pragma_inst_gen_ (I_FALSE), + ccm_pre_proc_gen_ (I_FALSE) { } @@ -561,6 +563,12 @@ be_decl::srv_inline_gen (void) return this->srv_inline_gen_; } +idl_bool +be_decl::ccm_pre_proc_gen (void) +{ + return this->ccm_pre_proc_gen_; +} + // Set the flag indicating that code generation is done. void be_decl::cli_hdr_gen (idl_bool val) @@ -785,6 +793,14 @@ be_decl::srv_inline_gen (idl_bool val) this->srv_inline_gen_ = val; } +void +be_decl::ccm_pre_proc_gen (idl_bool val) +{ + this->ccm_pre_proc_gen_ = val; +} + +//========================================== + int be_decl::accept (be_visitor *visitor) { diff --git a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp index b36616ef865..a397590dde8 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_cs.cpp @@ -258,6 +258,7 @@ be_visitor_array_cdr_op_cs::visit_predefined_type (be_predefined_type *node) { case AST_PredefinedType::PT_pseudo: case AST_PredefinedType::PT_object: + case AST_PredefinedType::PT_value: case AST_PredefinedType::PT_any: // Let the helper handle this. return this->visit_node (node); diff --git a/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp b/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp index 6a9959a5e23..666e3e0b896 100644 --- a/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp +++ b/TAO/TAO_IDL/be/be_visitor_ccm_pre_proc.cpp @@ -21,6 +21,7 @@ #include "be_typedef.h" #include "be_component.h" #include "be_eventtype.h" +#include "be_eventtype_fwd.h" #include "be_home.h" #include "be_extern.h" #include "ast_generator.h" @@ -250,6 +251,11 @@ be_visitor_ccm_pre_proc::visit_home (be_home *node) int be_visitor_ccm_pre_proc::visit_eventtype (be_eventtype *node) { + if (node->ccm_pre_proc_gen ()) + { + return 0; + } + if (this->create_event_consumer (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -259,9 +265,19 @@ be_visitor_ccm_pre_proc::visit_eventtype (be_eventtype *node) -1); } + node->ccm_pre_proc_gen (I_TRUE); return 0; } +int +be_visitor_ccm_pre_proc::visit_eventtype_fwd (be_eventtype_fwd *node) +{ + be_eventtype *fd = + be_eventtype::narrow_from_decl (node->full_definition ()); + + return this->visit_eventtype (fd); +} + // **************************************************************** int diff --git a/TAO/TAO_IDL/be/be_visitor_eventtype_fwd.cpp b/TAO/TAO_IDL/be/be_visitor_eventtype_fwd.cpp index 87ec46a6ac1..b68da9d5a75 100644 --- a/TAO/TAO_IDL/be/be_visitor_eventtype_fwd.cpp +++ b/TAO/TAO_IDL/be/be_visitor_eventtype_fwd.cpp @@ -23,6 +23,7 @@ #include "be_visitor_eventtype_fwd.h" #include "be_visitor_valuetype_fwd.h" #include "be_visitor_context.h" +#include "be_helper.h" #include "be_visitor_eventtype_fwd/eventtype_fwd_ch.cpp" #include "be_visitor_eventtype_fwd/any_op_ch.cpp" diff --git a/TAO/TAO_IDL/be/be_visitor_eventtype_fwd/eventtype_fwd_ch.cpp b/TAO/TAO_IDL/be/be_visitor_eventtype_fwd/eventtype_fwd_ch.cpp index c2f2954be89..7f0d8c8d21c 100644 --- a/TAO/TAO_IDL/be/be_visitor_eventtype_fwd/eventtype_fwd_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_eventtype_fwd/eventtype_fwd_ch.cpp @@ -36,6 +36,30 @@ be_visitor_eventtype_fwd_ch::~be_visitor_eventtype_fwd_ch (void) int be_visitor_eventtype_fwd_ch::visit_eventtype_fwd (be_eventtype_fwd *node) { + if (node->cli_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__; + + // All we do in this is generate a forward declaration of the + // corresponding consumer interface class. + *os << be_nl << be_nl << "class " << node->local_name () << "Consumer;"; + + // Generate the ifdefined macro for the _ptr type. + os->gen_ifdef_macro (node->flat_name (), "Consumer_ptr"); + + // Generate the _ptr typedef. + *os << be_nl << be_nl + << "typedef " << node->local_name () << "Consumer *" << node->local_name () + << "Consumer_ptr;"; + + os->gen_endif (); + be_visitor_context ctx (*this->ctx_); be_visitor_valuetype_fwd_ch visitor (&ctx); return visitor.visit_valuetype_fwd (node); diff --git a/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp b/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp index 1631fe636ee..8c3669fb306 100644 --- a/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_field/field_ch.cpp @@ -360,6 +360,10 @@ be_visitor_field_ch::visit_predefined_type (be_predefined_type *node) { *os << bt->name () << "_var"; } + else if (node->pt () == AST_PredefinedType::PT_value) + { + *os << bt->name () << " *"; + } else if (node->pt () == AST_PredefinedType::PT_pseudo) { // This was a typedefed array. diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/buffer_type.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/buffer_type.cpp index 40b3c54e310..4c02f8a5598 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/buffer_type.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/buffer_type.cpp @@ -76,6 +76,10 @@ be_visitor_sequence_buffer_type::visit_predefined_type (be_predefined_type *node { *os << node->name () << "_ptr"; } + else if (pt == AST_PredefinedType::PT_value) + { + *os << node->name () << " *"; + } else { *os << node->name (); diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp index 27628f760b1..664e9a660f5 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_cs.cpp @@ -549,16 +549,22 @@ be_visitor_union_branch_cdr_op_cs::visit_predefined_type (be_predefined_type *no } else if (pt == AST_PredefinedType::PT_pseudo) { - *os << "CORBA::TypeCode_var _tao_union_tmp;" << be_nl; - - //@@TODO - case for ValueBase. - - *os << "result = strm >> _tao_union_tmp.out ();" << be_nl << be_nl + *os << "CORBA::TypeCode_var _tao_union_tmp;" << be_nl + << "result = strm >> _tao_union_tmp.out ();" << be_nl << be_nl << "if (result)" << be_idt_nl << "{" << be_idt_nl << "_tao_union." << f->local_name () << " (_tao_union_tmp.in ());"; } + else if (pt == AST_PredefinedType::PT_value) + { + *os << "CORBA::ValueBase * _tao_union_tmp;" << be_nl + << "result = strm >> _tao_union_tmp;" << be_nl << be_nl + << "if (result)" << be_idt_nl + << "{" << be_idt_nl + << "_tao_union." << f->local_name () << " (_tao_union_tmp);"; + + } else if (pt == AST_PredefinedType::PT_char) { *os << "CORBA::Char _tao_union_tmp;" << be_nl diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp index 1040193d8c8..f6e11c113bb 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/private_ch.cpp @@ -359,6 +359,11 @@ be_visitor_union_branch_private_ch::visit_predefined_type ( *os << bt->nested_type_name (bu, "_ptr") << " " << ub->local_name () << "_;"; } + else if (node->pt () == AST_PredefinedType::PT_value) + { + *os << bt->nested_type_name (bu, " *") << " " << ub->local_name () + << "_;"; + } else if (node->pt () == AST_PredefinedType::PT_any) { // Cannot have an object inside of a union. In addition, an Any is a diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp index e37fbea8564..90397ea1bf9 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ch.cpp @@ -425,6 +425,13 @@ be_visitor_union_branch_public_ch::visit_predefined_type (be_predefined_type *no *os << bt->nested_type_name (bu, "_ptr") << " " << ub->local_name () << " (void) const;"; break; + case AST_PredefinedType::PT_value: + *os << be_nl << be_nl + << "void " << ub->local_name () << " (" + << bt->nested_type_name (bu, " *") << ");" << be_nl; + *os << bt->nested_type_name (bu, " *") << " " << ub->local_name () + << " (void) const;"; + break; case AST_PredefinedType::PT_any: *os << be_nl << be_nl << "void " << ub->local_name () << " (const " diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp index 77b30a7eec9..5b45fd9505d 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp @@ -701,6 +701,11 @@ be_visitor_union_branch_public_ci::visit_predefined_type ( << bt->name () << "_ptr"; } + else if (pt == AST_PredefinedType::PT_value) + { + *os << bt->name () + << " *"; + } else if (pt == AST_PredefinedType::PT_any) { *os << "const " @@ -755,6 +760,12 @@ be_visitor_union_branch_public_ci::visit_predefined_type ( << bt->name () << "::_duplicate (val);" << be_uidt_nl; break; + case AST_PredefinedType::PT_value: + *os << "CORBA::add_ref (val);" << be_nl + << "this->u_." << ub->local_name () + << "_ = val;" << be_uidt_nl; + + break; case AST_PredefinedType::PT_any: *os << "ACE_NEW (" << be_idt << be_idt_nl << "this->u_." << ub->local_name () @@ -803,6 +814,19 @@ be_visitor_union_branch_public_ci::visit_predefined_type ( *os << "}"; break; + case AST_PredefinedType::PT_value: + // Get method. + *os << "// Retrieve the member." << be_nl + << "ACE_INLINE" << be_nl + << bt->name () << " *" << be_nl + << bu->name () << "::" << ub->local_name () + << " (void) const" << be_nl + << "{" << be_idt_nl; + *os << "return this->u_." << ub->local_name () + << "_;" << be_uidt_nl; + *os << "}"; + + break; case AST_PredefinedType::PT_any: // Get method with read-only access. *os << "// Retrieve the member." << be_nl diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_arglist_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_arglist_ch.cpp index 419cd33e2a1..f26ebfbb386 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_arglist_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_init_arglist_ch.cpp @@ -155,8 +155,6 @@ be_visitor_valuetype_init_arglist_ch::gen_throw_spec (be_factory *node) *os << "," << be_nl; *os << excp->name (); - AST_Decl *d = ScopeAsDecl (excp->defined_in ()); - *os << d->repoID (); } } |