axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamej...@apache.org
Subject svn commit: r344052 - /webservices/axis/trunk/c/tests/auto_build/testcases/dynamic/Combo_TTest/IntArrayType.cpp
Date Mon, 14 Nov 2005 06:16:06 GMT
Author: jamejose
Date: Sun Nov 13 22:15:55 2005
New Revision: 344052

URL: http://svn.apache.org/viewcvs?rev=344052&view=rev
Log:
Updated the testcase with new Array APIs

Modified:
    webservices/axis/trunk/c/tests/auto_build/testcases/dynamic/Combo_TTest/IntArrayType.cpp

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/dynamic/Combo_TTest/IntArrayType.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/dynamic/Combo_TTest/IntArrayType.cpp?rev=344052&r1=344051&r2=344052&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/dynamic/Combo_TTest/IntArrayType.cpp
(original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/dynamic/Combo_TTest/IntArrayType.cpp
Sun Nov 13 22:15:55 2005
@@ -15,16 +15,31 @@
  * limitations under the License.
  *
  * This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
- * This file contains functions to manipulate complex type IntArrayType
+ * This file contains functions to manipulate complex type intArrayType
  */
 
 #include <axis/AxisWrapperAPI.hpp>
+#include <axis/Axis.hpp>
 
-#include "IntArrayType.hpp"
+#include "intArrayType.hpp"
+
+xsd__int_Array * intArrayType::getintItem()
+{
+	return intItem ; 
+}
+
+void intArrayType::setintItem(xsd__int_Array * pInValue)
+{
+	if(intItem == NULL)
+	{
+		intItem = new xsd__int_Array();
+	}
+	intItem->clone(*pInValue); 
+}
 /*
- * This static method serialize a IntArrayType type of object
+ * This static method serialize a intArrayType type of object
  */
-int Axis_Serialize_IntArrayType(IntArrayType* param, IWrapperSoapSerializer* pSZ, bool bArray
= false)
+int Axis_Serialize_intArrayType(intArrayType* param, IWrapperSoapSerializer* pSZ, bool bArray
= false)
 {
 	if ( param == NULL )
 	{
@@ -38,49 +53,56 @@
 	pSZ->serialize( ">", 0);
 
 	/* then serialize elements if any*/
-	pSZ->serializeBasicArray((Axis_Array*)(&param->intItem), Axis_URI_IntArrayType,XSD_INT,
"intItem");
+	pSZ->serializeBasicArray(param->intItem, Axis_URI_intArrayType,XSD_INT, "intItem");
 	return AXIS_SUCCESS;
 }
 
 /*
- * This static method deserialize a IntArrayType type of object
+ * This static method deserialize a intArrayType type of object
  */
-int Axis_DeSerialize_IntArrayType(IntArrayType* param, IWrapperSoapDeSerializer* pIWSDZ)
+int Axis_DeSerialize_intArrayType(intArrayType* param, IWrapperSoapDeSerializer* pIWSDZ)
 {
-	Axis_Array array;
+	Axis_Array * array;
 
 	array = pIWSDZ->getBasicArray(XSD_INT, "intItem",0);
-	param->intItem.m_Array = (xsd__int**)new xsd__int*[array.m_Size];
-	param->intItem.m_Size = array.m_Size;
+	if(param->intItem == NULL)
+	{
+		param->intItem = new xsd__int_Array();
+	}
+	param->intItem->clone( *array);
+	Axis::AxisDelete((void*) array, XSD_ARRAY);
 
-	memcpy( param->intItem.m_Array, array.m_Array, sizeof( xsd__int) * array.m_Size);
 	return pIWSDZ->getStatus();
 }
-void* Axis_Create_IntArrayType(IntArrayType* pObj, bool bArray = false, int nSize=0)
+void* Axis_Create_intArrayType(intArrayType* pObj, bool bArray = false, int nSize=0)
 {
 	if (bArray && (nSize > 0))
 	{
 		if (pObj)
 		{
-			IntArrayType* pNew = new IntArrayType[nSize];
-			memcpy(pNew, pObj, sizeof(IntArrayType)*nSize/2);
-			memset(pObj, 0, sizeof(IntArrayType)*nSize/2);
+			intArrayType* pNew = new intArrayType[nSize];
+			size_t i = nSize/2;
+			for (int ii=0; ii<i; ++ii)
+			{
+				pNew[ii] = pObj[ii];
+				pObj[ii].reset();
+			}
 			delete [] pObj;
 			return pNew;
 		}
 		else
 		{
-			return new IntArrayType[nSize];
+			return new intArrayType[nSize];
 		}
 	}
 	else
-		return new IntArrayType;
+		return new intArrayType;
 }
 
 /*
- * This static method delete a IntArrayType type of object
+ * This static method delete a intArrayType type of object
  */
-void Axis_Delete_IntArrayType(IntArrayType* param, bool bArray = false, int nSize=0)
+void Axis_Delete_intArrayType(intArrayType* param, bool bArray = false, int nSize=0)
 {
 	if (bArray)
 	{
@@ -92,22 +114,32 @@
 	}
 }
 /*
- * This static method gives the size of IntArrayType type of object
+ * This static method gives the size of intArrayType type of object
  */
-int Axis_GetSize_IntArrayType()
+int Axis_GetSize_intArrayType()
 {
-	return sizeof(IntArrayType);
+	return sizeof(intArrayType);
 }
 
-IntArrayType::IntArrayType()
+intArrayType::intArrayType()
+{
+	intItem = NULL;
+	reset();
+}
+
+void intArrayType::reset()
 {
 	/*do not allocate memory to any pointer members here
 	 because deserializer will allocate memory anyway. */
-	intItem.m_Array = 0;
-	intItem.m_Size = 0;
+	if ( intItem != NULL)
+	{
+		intItem->clear();
+	}
 }
 
-IntArrayType::~IntArrayType()
+intArrayType::~intArrayType()
 {
 	/*delete any pointer and array members here*/
+	if (intItem!= NULL)
+		delete intItem;
 }



Mime
View raw message