summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL
diff options
context:
space:
mode:
authorgokhale <asgokhale@users.noreply.github.com>1998-03-14 22:44:47 +0000
committergokhale <asgokhale@users.noreply.github.com>1998-03-14 22:44:47 +0000
commitdca5f6d4bb5208144ed92041f6e427716da00781 (patch)
tree96b613eb105b1f2399bbfa3753f5c6edf4400dae /TAO/TAO_IDL
parent99bebd734ad3471165081a63028a2361ea01b4b1 (diff)
downloadATCD-dca5f6d4bb5208144ed92041f6e427716da00781.tar.gz
*** empty log message ***
Diffstat (limited to 'TAO/TAO_IDL')
-rw-r--r--TAO/TAO_IDL/be/be_visitor_args.cpp225
-rw-r--r--TAO/TAO_IDL/be/be_visitor_enum.cpp4
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation.cpp26
-rw-r--r--TAO/TAO_IDL/be/be_visitor_union_branch.cpp72
4 files changed, 322 insertions, 5 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_args.cpp b/TAO/TAO_IDL/be/be_visitor_args.cpp
index 919bdea6dde..c5d9b6e82d0 100644
--- a/TAO/TAO_IDL/be/be_visitor_args.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_args.cpp
@@ -2213,3 +2213,228 @@ int be_visitor_args_post_upcall_ss::visit_typedef (be_typedef *node)
this->ctx_->alias (node);
return node->primitive_base_type ()->accept (this);
}
+
+#if 0
+// ************************************************************************
+// visitor for doing any post-processing after the upcall is made
+// ************************************************************************
+
+be_visitor_args_post_marshal_ss::be_visitor_args_post_marshal_ss (be_visitor_context *ctx)
+ : be_visitor_args (ctx)
+{
+}
+
+be_visitor_args_post_marshal_ss::~be_visitor_args_post_marshal_ss (void)
+{
+}
+
+int be_visitor_args_post_marshal_ss::visit_argument (be_argument *node)
+{
+ TAO_OutStream *os = this->ctx_->stream (); // get output stream
+ this->ctx_->node (node); // save the argument node
+
+ // retrieve the type
+ be_type *bt = be_type::narrow_from_decl (node->field_type ());
+ if (!bt)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "be_visitor_args_post_marshal_ss::"
+ "visit_argument - "
+ "Bad argument type\n"),
+ -1);
+ }
+
+ // Different types have different mappings when used as in/out or
+ // inout parameters. Let this visitor deal with the type
+
+ if (bt->accept (this) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "be_visitor_args_post_marshal_ss::"
+ "visit_argument - "
+ "cannot accept visitor\n"),
+ -1);
+ }
+
+ return 0;
+}
+
+int be_visitor_args_post_marshal_ss::visit_array (be_array *node)
+{
+ TAO_OutStream *os = this->ctx_->stream (); // get output stream
+
+ switch (this->direction ())
+ {
+ case AST_Argument::dir_IN:
+ break;
+ case AST_Argument::dir_INOUT:
+ break;
+ case AST_Argument::dir_OUT:
+ break;
+ }
+ return 0;
+}
+
+int be_visitor_args_post_marshal_ss::visit_enum (be_enum *node)
+{
+ TAO_OutStream *os = this->ctx_->stream (); // get output stream
+
+ switch (this->direction ())
+ {
+ case AST_Argument::dir_IN:
+ break;
+ case AST_Argument::dir_INOUT:
+ break;
+ case AST_Argument::dir_OUT:
+ break;
+ }
+ return 0;
+}
+
+int be_visitor_args_post_marshal_ss::visit_interface (be_interface *node)
+{
+ TAO_OutStream *os = this->ctx_->stream (); // get output stream
+
+ switch (this->direction ())
+ {
+ case AST_Argument::dir_IN:
+ break;
+ case AST_Argument::dir_INOUT: // inout
+ break;
+ case AST_Argument::dir_OUT:
+ break;
+ }
+ return 0;
+}
+
+int be_visitor_args_post_marshal_ss::visit_interface_fwd (be_interface_fwd *node)
+{
+ TAO_OutStream *os = this->ctx_->stream (); // get output stream
+
+ switch (this->direction ())
+ {
+ case AST_Argument::dir_IN:
+ break;
+ case AST_Argument::dir_INOUT: // inout
+ break;
+ case AST_Argument::dir_OUT:
+ break;
+ }
+ return 0;
+}
+
+int be_visitor_args_post_marshal_ss::visit_predefined_type (be_predefined_type *node)
+{
+ TAO_OutStream *os = this->ctx_->stream (); // get output stream
+
+ // check if the type is an any
+ if (node->pt () == AST_PredefinedType::PT_any)
+ {
+ switch (this->direction ())
+ {
+ case AST_Argument::dir_IN:
+ break;
+ case AST_Argument::dir_INOUT:
+ break;
+ case AST_Argument::dir_OUT:
+ break;
+ } // end switch direction
+ } // end of if
+ else if (node->pt () == AST_PredefinedType::PT_pseudo) // e.g., CORBA::Object
+ {
+ switch (this->direction ())
+ {
+ case AST_Argument::dir_IN:
+ break;
+ case AST_Argument::dir_INOUT:
+ break;
+ case AST_Argument::dir_OUT:
+ break;
+ } // end switch direction
+ } // end else if
+ else // simple predefined types
+ {
+ switch (this->direction ())
+ {
+ case AST_Argument::dir_IN:
+ break;
+ case AST_Argument::dir_INOUT:
+ break;
+ case AST_Argument::dir_OUT:
+ break;
+ } // end switch direction
+ } // end of else
+
+ return 0;
+}
+
+int be_visitor_args_post_marshal_ss::visit_sequence (be_sequence *node)
+{
+ TAO_OutStream *os = this->ctx_->stream (); // get the stream
+
+ switch (this->direction ())
+ {
+ case AST_Argument::dir_IN:
+ break;
+ case AST_Argument::dir_INOUT:
+ break;
+ case AST_Argument::dir_OUT:
+ break;
+ }
+ return 0;
+}
+
+int be_visitor_args_post_marshal_ss::visit_string (be_string *)
+{
+ TAO_OutStream *os = this->ctx_->stream (); // get the stream
+
+ switch (this->direction ())
+ {
+ case AST_Argument::dir_IN:
+ break;
+ case AST_Argument::dir_INOUT:
+ break;
+ case AST_Argument::dir_OUT:
+ break;
+ }
+ return 0;
+}
+
+int be_visitor_args_post_marshal_ss::visit_structure (be_structure *node)
+{
+ TAO_OutStream *os = this->ctx_->stream (); // get the stream
+
+ switch (this->direction ())
+ {
+ case AST_Argument::dir_IN:
+ break;
+ case AST_Argument::dir_INOUT:
+ break;
+ case AST_Argument::dir_OUT:
+ break;
+ }
+ return 0;
+}
+
+int be_visitor_args_post_marshal_ss::visit_union (be_union *node)
+{
+ TAO_OutStream *os = this->ctx_->stream (); // get the stream
+
+ switch (this->direction ())
+ {
+ case AST_Argument::dir_IN:
+ break;
+ case AST_Argument::dir_INOUT:
+ break;
+ case AST_Argument::dir_OUT:
+ break;
+ }
+ return 0;
+}
+
+int be_visitor_args_post_marshal_ss::visit_typedef (be_typedef *node)
+{
+ this->ctx_->alias (node);
+ return node->primitive_base_type ()->accept (this);
+}
+#endif
diff --git a/TAO/TAO_IDL/be/be_visitor_enum.cpp b/TAO/TAO_IDL/be/be_visitor_enum.cpp
index bb8dfad02e1..a6980d5306d 100644
--- a/TAO/TAO_IDL/be/be_visitor_enum.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_enum.cpp
@@ -45,7 +45,7 @@ be_visitor_enum_ch::visit_enum (be_enum *node)
TAO_OutStream *os = this->ctx_->stream ();
this->ctx_->comma (1); // comma to be generated by the scope visitor
- if (!node->cli_hdr_gen ())
+ if (!node->cli_hdr_gen () && !node->imported ())
{
os->indent (); // start from whatever indentation level we were at
*os << "enum " << node->local_name () << be_nl;
@@ -127,7 +127,7 @@ be_visitor_enum_cs::visit_enum (be_enum *node)
{
TAO_OutStream *os = this->ctx_->stream ();
- if (!node->cli_hdr_gen ())
+ if (!node->cli_stub_gen () && !node->imported ())
{
// generate the typecode information here
os->indent (); // start from current indentation level
diff --git a/TAO/TAO_IDL/be/be_visitor_operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation.cpp
index 0fdded98746..a80b9a9f40e 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation.cpp
@@ -221,7 +221,17 @@ be_visitor_operation_cs::visit_operation (be_operation *node)
*os << node->flatname ()
<< "_calldata = " << be_nl
<< "{"
- << "\"" << node->local_name () << "\", ";
+ << "\"";
+ // check if we are an attribute node in disguise
+ if (this->ctx_->attribute ())
+ {
+ // now check if we are a "get" or "set" operation
+ if (node->nmembers () == 1) // set
+ *os << "_set_";
+ else
+ *os << "_get_";
+ }
+ *os << node->local_name () << "\", ";
// are we oneway or two operation?
if (node->flags () == AST_Operation::OP_oneway)
@@ -716,7 +726,7 @@ be_visitor_operation_ss::visit_operation (be_operation *node)
if (this->visit_scope (node) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_cs::"
+ "(%N:%l) be_visitor_operation_ss::"
"visit_operation - "
"visit scope failed\n"),
-1);
@@ -740,7 +750,17 @@ be_visitor_operation_ss::visit_operation (be_operation *node)
*os << node->flatname ()
<< "_calldata = " << be_nl
<< "{"
- << "\"" << node->local_name () << "\", ";
+ << "\"";
+ // check if we are an attribute node in disguise
+ if (this->ctx_->attribute ())
+ {
+ // now check if we are a "get" or "set" operation
+ if (node->nmembers () == 1) // set
+ *os << "_set_";
+ else
+ *os << "_get_";
+ }
+ *os << node->local_name () << "\", ";
// are we oneway or two operation?
if (node->flags () == AST_Operation::OP_oneway)
diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch.cpp
index cd4d79b7981..dca199bb2d8 100644
--- a/TAO/TAO_IDL/be/be_visitor_union_branch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_union_branch.cpp
@@ -1418,6 +1418,78 @@ be_visitor_union_branch_public_ci::visit_predefined_type (be_predefined_type *no
int
be_visitor_union_branch_public_ci::visit_sequence (be_sequence *node)
{
+ TAO_OutStream *os; // output stream
+ be_union_branch *ub =
+ this->ctx_->be_node_as_union_branch (); // get union branch
+ be_union *bu =
+ this->ctx_->be_scope_as_union (); // get the enclosing union backend
+ be_type *bt;
+
+ // check if we are visiting this node via a visit to a typedef node
+ if (this->ctx_->alias ())
+ bt = this->ctx_->alias ();
+ else
+ bt = node;
+
+ if (!ub || !bu)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_union_branch_public_ci::"
+ "visit_sequence - "
+ "bad context information\n"
+ ), -1);
+ }
+ os = this->ctx_->stream ();
+
+ // (1) set from a const
+ *os << "// accessor to set the member" << be_nl
+ << "ACE_INLINE void" << be_nl
+ << bu->name () << "::" << ub->local_name ()
+ << " (const " << bt->name () << " &val)" << be_nl
+ << "{" << be_idt_nl;
+
+ // set the discriminant to the appropriate label
+ if (ub->label ()->label_kind () == AST_UnionLabel::UL_label)
+ {
+ // valid label
+ *os << "// set the discriminant val" << be_nl;
+ // check if the case label is a symbol or a literal
+ if (ub->label ()->label_val ()->ec () == AST_Expression::EC_symbol)
+ {
+ *os << "this->disc_ = " << ub->label ()->label_val ()->n ()
+ << ";" << be_nl;
+ }
+ else
+ {
+ *os << "this->disc_ = " << ub->label ()->label_val () << ";"
+ << be_nl;
+ }
+ *os << "// set the value" << be_nl
+ << "*this->" << ub->local_name () << "_ = val;" << be_uidt_nl;
+ }
+ else
+ {
+ // default label
+ // XXXASG - TODO
+ }
+ *os << "}" << be_nl;
+
+ // readonly get method
+ *os << "// readonly get method " << be_nl
+ << "ACE_INLINE const " << bt->name () << " &" << be_nl
+ << bu->name () << "::" << ub->local_name () << " (void) const" << be_nl
+ << "{" << be_idt_nl
+ << "return *this->" << ub->local_name () << "_;" << be_uidt_nl
+ << "}" << be_nl;
+
+ // read/write get method
+ *os << "// read/write get method " << be_nl
+ << "ACE_INLINE " << bt->name () << " &" << be_nl
+ << bu->name () << "::" << ub->local_name () << " (void)" << be_nl
+ << "{" << be_idt_nl
+ << "return *this->" << ub->local_name () << "_;" << be_uidt_nl
+ << "}\n\n";
+
return 0;
}