blob: 83fb1891a47df9de61d77c474d37e3db6a7cd91a [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 FirstLevelElemType
*/
/* #include <C:\AxisCpp\axis-c-1.5.0-Win32-bin18-02\include\axis\AxisWrapperAPI.hpp> */
#include <axis/AxisWrapperAPI.hpp>
#include "FirstLevelElemType.hpp"
extern int Axis_DeSerialize_SecondLevelElemType(SecondLevelElemType* param, IWrapperSoapDeSerializer* pDZ);
extern void* Axis_Create_SecondLevelElemType(SecondLevelElemType* pObj, bool bArray = false, int nSize=0);
extern void Axis_Delete_SecondLevelElemType(SecondLevelElemType* param, bool bArray = false, int nSize=0);
extern int Axis_Serialize_SecondLevelElemType(SecondLevelElemType* param, IWrapperSoapSerializer* pSZ, bool bArray = false);
extern int Axis_GetSize_SecondLevelElemType();
/*
* This static method serialize a FirstLevelElemType type of object
*/
int Axis_Serialize_FirstLevelElemType(FirstLevelElemType* 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;
}
/* first serialize attributes if any*/
pSZ->serialize( ">", 0);
/* then serialize elements if any*/
// Additional code to find is reference is pointer or pointer to a pointer
pSZ->serializeCmplxArray((Axis_Array*)(&param->SecondLevelElem),
(void*) Axis_Serialize_SecondLevelElemType,
(void*) Axis_Delete_SecondLevelElemType,
(void*) Axis_GetSize_SecondLevelElemType,
"SecondLevelElem", Axis_URI_SecondLevelElemType);
// End
return AXIS_SUCCESS;
}
/*
* This static method deserialize a FirstLevelElemType type of object
*/
int Axis_DeSerialize_FirstLevelElemType(FirstLevelElemType* param, IWrapperSoapDeSerializer* pIWSDZ)
{
Axis_Array array;
array = pIWSDZ->getCmplxArray((void*)Axis_DeSerialize_SecondLevelElemType,
(void*)Axis_Create_SecondLevelElemType,
(void*)Axis_Delete_SecondLevelElemType,
(void*)Axis_GetSize_SecondLevelElemType,
"SecondLevelElem", Axis_URI_SecondLevelElemType);
// Additional code to find is reference is pointer or pointer to a pointer
param->SecondLevelElem = (SecondLevelElemType_Array&)array;
// End
return pIWSDZ->getStatus();
}
void* Axis_Create_FirstLevelElemType(FirstLevelElemType* pObj, bool bArray = false, int nSize=0)
{
if (bArray && (nSize > 0))
{
if (pObj)
{
FirstLevelElemType* pNew = new FirstLevelElemType[nSize];
memcpy(pNew, pObj, sizeof(FirstLevelElemType)*nSize/2);
memset(pObj, 0, sizeof(FirstLevelElemType)*nSize/2);
delete [] pObj;
return pNew;
}
else
{
return new FirstLevelElemType[nSize];
}
}
else
return new FirstLevelElemType;
}
/*
* This static method delete a FirstLevelElemType type of object
*/
void Axis_Delete_FirstLevelElemType(FirstLevelElemType* param, bool bArray = false, int nSize=0)
{
if (bArray)
{
delete [] param;
}
else
{
delete param;
}
}
/*
* This static method gives the size of FirstLevelElemType type of object
*/
int Axis_GetSize_FirstLevelElemType()
{
return sizeof(FirstLevelElemType);
}
FirstLevelElemType::FirstLevelElemType()
{
/*do not allocate memory to any pointer members here
because deserializer will allocate memory anyway. */
SecondLevelElem.m_Array = 0;
SecondLevelElem.m_Size = 0;
}
FirstLevelElemType::~FirstLevelElemType()
{
/*delete any pointer and array members here*/
delete [] ((SecondLevelElemType*)SecondLevelElem.m_Array);
}