blob: 1e1eed46d885e32c3b0ccd0525bae091ed8395de [file] [log] [blame]
/*
* Copyright 2003-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* 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 Type
*/
#include <axis/AxisWrapperAPI.hpp>
#include <axis/Axis.hpp>
#include "Type.hpp"
xsd__int_Array * Type::getitem()
{
return item ;
}
void Type::setitem(xsd__int_Array * pInValue)
{
if(item == NULL)
{
item = new xsd__int_Array();
}
item->clone(*pInValue);
}
/*
* This static method serialize a Type type of object
*/
int Axis_Serialize_Type(Type* param, IWrapperSoapSerializer* pSZ, bool bArray = false)
{
if ( param == NULL )
{
/* TODO : may need to check nillable value - Now done*/
pSZ->serializeAsAttribute( "xsi:nil", 0, (void*)&(xsd_boolean_true), XSD_BOOLEAN);
pSZ->serialize( ">", NULL);
return AXIS_SUCCESS;
}
bool blnIsNewPrefix = false;
if (!bArray)
{
const AxisChar* sPrefix = pSZ->getNamespacePrefix(Axis_URI_Type, blnIsNewPrefix);
if (blnIsNewPrefix)
{
pSZ->serialize(" xmlns:", sPrefix, "=\"",
Axis_URI_Type, "\"", NULL );
}
}
/* first serialize attributes if any*/
pSZ->serialize( ">", 0);
/* then serialize elements if any*/
pSZ->serializeBasicArray(param->item, NULL,XSD_INT, "item");
if (!bArray && blnIsNewPrefix)
{
pSZ->removeNamespacePrefix(Axis_URI_Type);
}
return AXIS_SUCCESS;
}
/*
* This static method deserialize a Type type of object
*/
int Axis_DeSerialize_Type(Type* param, IWrapperSoapDeSerializer* pIWSDZ)
{
Axis_Array * array1 = pIWSDZ->getBasicArray(XSD_INT, "item",0);
if(param->item == NULL)
{
param->item = new xsd__int_Array();
}
param->item->clone( *array1);
Axis::AxisDelete((void*) array1, XSD_ARRAY);
return pIWSDZ->getStatus();
}
void* Axis_Create_Type(Type* pObj, bool bArray = false, int nSize=0)
{
if (bArray && (nSize > 0))
{
if (pObj)
{
Type* pNew = new Type[nSize];
size_t i = nSize/2;
for (int ii = 0; ii < (int) i; ++ii)
{
pNew[ii] = pObj[ii];
pObj[ii].reset();
}
delete [] pObj;
return pNew;
}
else
{
return new Type[nSize];
}
}
else
return new Type;
}
/*
* This static method delete a Type type of object
*/
void Axis_Delete_Type(Type* param, bool bArray = false, int nSize=0)
{
if (bArray)
{
delete [] param;
}
else
{
delete param;
}
}
/*
* This static method gives the size of Type type of object
*/
int Axis_GetSize_Type()
{
return sizeof(Type);
}
Type::Type()
{
item = new xsd__int_Array();
reset();
}
Type::Type(Type & original)
{
item = new xsd__int_Array(*original.item);
}
void Type::reset()
{
/*do not allocate memory to any pointer members here
because deserializer will allocate memory anyway. */
item->clear();
}
Type::~Type()
{
/*delete any pointer and array members here*/
if (item!= NULL)
{
delete item;
item = NULL;
}
}