summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-07-13 01:00:22 +0000
committerkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-07-13 01:00:22 +0000
commit45771cab1a9a945ce867abb3d76a986c1194dcf2 (patch)
treeb1991f208df2a5cdf994cb9032647e098c787814
parent83fbeee783d2dfa97f514d4205b7fbffba047029 (diff)
downloadATCD-45771cab1a9a945ce867abb3d76a986c1194dcf2.tar.gz
resolved attribute probs
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/interceptors_ss.cpp168
1 files changed, 162 insertions, 6 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ss.cpp
index d3c4200fb21..7fcca3fec88 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ss.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_ss.cpp
@@ -68,8 +68,60 @@ be_visitor_operation_interceptors_ss::visit_operation (be_operation *node)
// *os << parents_parent->full_name () << "::";
*os << "POA_" <<parent->full_name () << "::";
}
- *os << "TAO_ServerRequest_Info_"<<node->flat_name ()<< "::"
- << "TAO_ServerRequest_Info_"<< node->flat_name () << " (const char * operation," << be_nl
+ *os << "TAO_ServerRequest_Info_"<<node->flat_name ();
+ // We need the interface node in which this operation was defined. However,
+ // if this operation node was an attribute node in disguise, we get this
+ // information from the context and add a "_get"/"_set" to the flat
+ // name to get around the problem of overloaded methods which are
+ // generated for attributes.
+ if (this->ctx_->attribute ())
+ {
+ bt = be_type::narrow_from_decl (node->return_type ());
+ if (!bt)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_interceptors_ch::"
+ "visit_operation - "
+ "Bad return type\n"),
+ -1);
+ }
+
+ // grab the right visitor to generate the return type if its not
+ // void it means it is not the accessor.
+ if (!this->void_return_type (bt))
+ *os <<"_get";
+ else
+ *os <<"_set";
+ }
+
+ *os<< "::"
+ << "TAO_ServerRequest_Info_"<< node->flat_name ();
+ // We need the interface node in which this operation was defined. However,
+ // if this operation node was an attribute node in disguise, we get this
+ // information from the context and add a "_get"/"_set" to the flat
+ // name to get around the problem of overloaded methods which are
+ // generated for attributes.
+ if (this->ctx_->attribute ())
+ {
+ bt = be_type::narrow_from_decl (node->return_type ());
+ if (!bt)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_interceptors_ch::"
+ "visit_operation - "
+ "Bad return type\n"),
+ -1);
+ }
+
+ // grab the right visitor to generate the return type if its not
+ // void it means it is not the accessor.
+ if (!this->void_return_type (bt))
+ *os <<"_get";
+ else
+ *os <<"_set";
+ }
+
+ *os << " (const char * operation," << be_nl
<< "IOP::ServiceContextList &service_context_list";
if (node->argument_count () > 0)
@@ -133,7 +185,33 @@ be_visitor_operation_interceptors_ss::visit_operation (be_operation *node)
*os << "POA_" <<parent->full_name () << "::";
}
- *os << "TAO_ServerRequest_Info_"<<node->flat_name ()<< "::"
+ *os << "TAO_ServerRequest_Info_"<<node->flat_name ();
+ // We need the interface node in which this operation was defined. However,
+ // if this operation node was an attribute node in disguise, we get this
+ // information from the context and add a "_get"/"_set" to the flat
+ // name to get around the problem of overloaded methods which are
+ // generated for attributes.
+ if (this->ctx_->attribute ())
+ {
+ bt = be_type::narrow_from_decl (node->return_type ());
+ if (!bt)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_interceptors_ch::"
+ "visit_operation - "
+ "Bad return type\n"),
+ -1);
+ }
+
+ // grab the right visitor to generate the return type if its not
+ // void it means it is not the accessor.
+ if (!this->void_return_type (bt))
+ *os <<"_get";
+ else
+ *os <<"_set";
+ }
+
+ *os<< "::"
<< "arguments (CORBA::Environment &)"<< be_nl
<< "{" <<be_idt_nl
<<" // Generate the arg list on demand" << be_nl;
@@ -181,7 +259,33 @@ be_visitor_operation_interceptors_ss::visit_operation (be_operation *node)
*os << "POA_" << parent->full_name () << "::";
}
- *os << "TAO_ServerRequest_Info_"<<node->flat_name ()<< "::"
+ *os << "TAO_ServerRequest_Info_"<<node->flat_name ();
+ // We need the interface node in which this operation was defined. However,
+ // if this operation node was an attribute node in disguise, we get this
+ // information from the context and add a "_get"/"_set" to the flat
+ // name to get around the problem of overloaded methods which are
+ // generated for attributes.
+ if (this->ctx_->attribute ())
+ {
+ bt = be_type::narrow_from_decl (node->return_type ());
+ if (!bt)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_interceptors_ch::"
+ "visit_operation - "
+ "Bad return type\n"),
+ -1);
+ }
+
+ // grab the right visitor to generate the return type if its not
+ // void it means it is not the accessor.
+ if (!this->void_return_type (bt))
+ *os <<"_get";
+ else
+ *os <<"_set";
+ }
+
+ *os<< "::"
<< "exceptions (CORBA::Environment &)"<< be_nl
<< "{\n // Generate the exception list on demand" << be_nl;
if (!node->exceptions ())
@@ -224,7 +328,33 @@ be_visitor_operation_interceptors_ss::visit_operation (be_operation *node)
*os << "POA_" <<parent->full_name () << "::";
}
- *os << "TAO_ServerRequest_Info_"<<node->flat_name ()<< "::"
+ *os << "TAO_ServerRequest_Info_"<<node->flat_name ();
+ // We need the interface node in which this operation was defined. However,
+ // if this operation node was an attribute node in disguise, we get this
+ // information from the context and add a "_get"/"_set" to the flat
+ // name to get around the problem of overloaded methods which are
+ // generated for attributes.
+ if (this->ctx_->attribute ())
+ {
+ bt = be_type::narrow_from_decl (node->return_type ());
+ if (!bt)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_interceptors_ch::"
+ "visit_operation - "
+ "Bad return type\n"),
+ -1);
+ }
+
+ // grab the right visitor to generate the return type if its not
+ // void it means it is not the accessor.
+ if (!this->void_return_type (bt))
+ *os <<"_get";
+ else
+ *os <<"_set";
+ }
+
+ *os<< "::"
<< "result (CORBA::Environment &)"<< be_nl
<< "{\n // Generate the result on demand" << be_nl;
bt = be_type::narrow_from_decl (node->return_type ());
@@ -284,7 +414,33 @@ be_visitor_operation_interceptors_ss::visit_operation (be_operation *node)
*os << "POA_"<< parent->full_name () << "::";
}
- *os << "TAO_ServerRequest_Info_"<<node->flat_name ()<< "::"
+ *os << "TAO_ServerRequest_Info_"<<node->flat_name ();
+ // We need the interface node in which this operation was defined. However,
+ // if this operation node was an attribute node in disguise, we get this
+ // information from the context and add a "_get"/"_set" to the flat
+ // name to get around the problem of overloaded methods which are
+ // generated for attributes.
+ if (this->ctx_->attribute ())
+ {
+ bt = be_type::narrow_from_decl (node->return_type ());
+ if (!bt)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_visitor_interceptors_ch::"
+ "visit_operation - "
+ "Bad return type\n"),
+ -1);
+ }
+
+ // grab the right visitor to generate the return type if its not
+ // void it means it is not the accessor.
+ if (!this->void_return_type (bt))
+ *os <<"_get";
+ else
+ *os <<"_set";
+ }
+
+ *os<< "::"
<< "result (";
ctx = *this->ctx_;