summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-07-13 00:59:41 +0000
committerkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-07-13 00:59:41 +0000
commit83fbeee783d2dfa97f514d4205b7fbffba047029 (patch)
treed8098dcb9c0c13fe79cbd10179d76a84e72034ab
parent87c3c43551fd789614f3ea073ad44b4f434fc032 (diff)
downloadATCD-83fbeee783d2dfa97f514d4205b7fbffba047029.tar.gz
atribute porbs resolved
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/interceptors_cs.cpp168
1 files changed, 162 insertions, 6 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_cs.cpp
index 126a4ee1b8f..b61249dc02d 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/interceptors_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/interceptors_cs.cpp
@@ -68,8 +68,60 @@ be_visitor_operation_interceptors_cs::visit_operation (be_operation *node)
// *os << parents_parent->full_name () << "::";
*os << parent->full_name () << "::";
}
- *os << "TAO_ClientRequest_Info_"<<node->flat_name ()<< "::"
- << "TAO_ClientRequest_Info_"<< node->flat_name () << " (const char * operation," << be_nl
+ *os << "TAO_ClientRequest_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_ClientRequest_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," << be_nl
<< "CORBA::Object * target";
@@ -135,7 +187,33 @@ be_visitor_operation_interceptors_cs::visit_operation (be_operation *node)
}
// The interceptors cant modify "in" and "out" parameters.
- *os << "TAO_ClientRequest_Info_"<<node->flat_name ()<< "::"
+ *os << "TAO_ClientRequest_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;
@@ -183,7 +261,33 @@ be_visitor_operation_interceptors_cs::visit_operation (be_operation *node)
*os << parent->full_name () << "::";
}
- *os << "TAO_ClientRequest_Info_"<<node->flat_name ()<< "::"
+ *os << "TAO_ClientRequest_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
<< "{" << be_idt_nl
<<"// Generate the exception list on demand " << be_nl;
@@ -227,7 +331,33 @@ be_visitor_operation_interceptors_cs::visit_operation (be_operation *node)
*os << parent->full_name () << "::";
}
- *os << "TAO_ClientRequest_Info_"<<node->flat_name ()<< "::"
+ *os << "TAO_ClientRequest_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;
@@ -288,7 +418,33 @@ be_visitor_operation_interceptors_cs::visit_operation (be_operation *node)
*os << parent->full_name () << "::";
}
- *os << "TAO_ClientRequest_Info_"<<node->flat_name ()<< "::"
+ *os << "TAO_ClientRequest_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_;