[
https://issues.apache.org/jira/browse/AXISCPP-1028?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
nadir amra closed AXISCPP-1028.
-------------------------------
Resolution: Fixed
Fix Version/s: current (nightly)
Work done and test bucket run. Now you will get setters with two flags: deep
and makeCopy. For example:
void setoptionalAttribute(xsd__byte* InValue, bool deep=true, bool
makeCopy=true);
In the generated code for the setter, we now generate, as an example:
if (deep && makeCopy)
{
optionalAttribute = new xsd__byte();
*optionalAttribute = *pInValue;
}
else
optionalAttribute = pInValue;
and in the deserializer code, we have:
xsd__byte * pValue0 = pIWSDZ->getAttributeAsByte("optionalAttribute",
0);
param->setoptionalAttribute(pValue0, true, false);
with no deletes.
> More efficient use of memory resources
> --------------------------------------
>
> Key: AXISCPP-1028
> URL: https://issues.apache.org/jira/browse/AXISCPP-1028
> Project: Axis-C++
> Issue Type: Improvement
> Components: Client - Deserialization
> Reporter: nadir amra
> Assigned To: nadir amra
> Fix For: current (nightly)
>
>
> When deserializing simple types, and the type is a pointer type, the code
> generator generates code as follows:
> param->setrequiredAttribute (pValue0);
> Axis::AxisDelete( (void *) pValue0, XSD_STRING);
> That is, we use the setter method which makes a copy of the string, and then
> delete the string. It would be more efficient to store the deserialized
> value in the class without making a copy and performing a delete.
> To achieve this goal, need to enhance setter methods so that not only is a
> flag indicating whether a deep copy is to be performed is generated, but
> another flag indicating whether a copy is to be performed. By default, the
> makeCopy flag will be true and thus will provide the same semantics as the
> code is today. However, the code generator can then make use of this flag so
> that it can call the setter method with deep copy set to true and makeCopy
> flag set to false - implying that the value being passed in should be stored
> in the class as-is, but because deep flag is set to true, it will be owned by
> the object.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]