Main Page   Class Hierarchy   Compound List   File List   Compound Members  

Param.h

00001 /* -*- C++ -*- */
00002 
00003 /*
00004  * The Apache Software License, Version 1.1
00005  *
00006  *
00007  * Copyright (c) 2002 The Apache Software Foundation.  All rights
00008  * reserved.
00009  *
00010  * Redistribution and use in source and binary forms, with or without
00011  * modification, are permitted provided that the following conditions
00012  * are met:
00013  *
00014  * 1. Redistributions of source code must retain the above copyright
00015  *    notice, this list of conditions and the following disclaimer.
00016  *
00017  * 2. Redistributions in binary form must reproduce the above copyright
00018  *    notice, this list of conditions and the following disclaimer in
00019  *    the documentation and/or other materials provided with the
00020  *    distribution.
00021  *
00022  * 3. The end-user documentation included with the redistribution,
00023  *    if any, must include the following acknowledgment:
00024  *       "This product includes software developed by the
00025  *        Apache Software Foundation (http://www.apache.org/)."
00026  *    Alternately, this acknowledgment may appear in the software itself,
00027  *    if and wherever such third-party acknowledgments normally appear.
00028  *
00029  * 4. The names "SOAP" and "Apache Software Foundation" must
00030  *    not be used to endorse or promote products derived from this
00031  *    software without prior written permission. For written
00032  *    permission, please contact apache@apache.org.
00033  *
00034  * 5. Products derived from this software may not be called "Apache",
00035  *    nor may "Apache" appear in their name, without prior written
00036  *    permission of the Apache Software Foundation.
00037  *
00038  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
00039  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00040  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00041  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
00042  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00043  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00044  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
00045  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00046  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00047  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
00048  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00049  * SUCH DAMAGE.
00050  * ====================================================================
00051  *
00052  * This software consists of voluntary contributions made by many
00053  * individuals on behalf of the Apache Software Foundation.  For more
00054  * information on the Apache Software Foundation, please see
00055  * <http://www.apache.org/>.
00056  *
00057  */
00058 
00059 // Param.h: 
00060 //
00062 #ifdef WIN32
00063 #pragma warning (disable : 4786)
00064 #endif
00065 
00066 #if !defined(AFX_PARAM_H__351B13BB_5D03_40C5_93F5_56D17295A8BD__INCLUDED_)
00067 #define AFX_PARAM_H__351B13BB_5D03_40C5_93F5_56D17295A8BD__INCLUDED_
00068 
00069 #include "IParam.h"
00070 #include "BasicTypeSerializer.h"
00071 #include "AxisTime.h"
00072 
00073 #include <string>
00074 using namespace std;
00075 
00076 class ArrayBean;
00077 
00078 
00086 class Param : public IParam
00087 {
00088         friend class SoapDeSerializer;
00089         friend class SoapSerializer;
00090         friend class XMLStreamHandler;
00091 public:
00092         Param(){ m_Type = USER_TYPE;}; //if there is no attribute that says the type
00093 
00094     Param(time_t time);
00095     Param(struct tm timeStruct);
00096         Param(const Param& param);
00097         Param(const AxisChar* str, XSDTYPE type = XSD_STRING);
00098         Param(int nValue);
00099     Param(unsigned int unValue);   
00100     Param(short sValue);
00101     Param(unsigned short usValue);
00102     Param(char cValue);
00103     Param(unsigned char ucValue);
00104     Param(long lValue, XSDTYPE type=XSD_LONG);
00105     Param(unsigned long ulValue);
00106         Param(float fValue);
00107         Param(double dValue, XSDTYPE type=XSD_DOUBLE);
00108         virtual ~Param();
00109         void operator=(const Param &param);
00110 
00111 private:
00112         uParamValue m_Value;
00113         AxisString m_sValue; //value in case of XSD_STRING, XSD_HEXBINARY and XSD_BASE64BINARY
00114         AxisString m_sName; //Name of the parameter
00115         XSDTYPE m_Type; //Type of the parameter
00116 
00117 private:
00118         AxisString m_strPrefix; //needed in serialization only
00119         AxisString m_strUri; //needed in serialization only
00120 
00121 public: //Conversion functions
00122         const AxisString& GetTypeName();
00123         int SetValue(const AxisChar* sValue);
00124         int SetValue(XSDTYPE nType, uParamValue Value);
00125         XSDTYPE GetType() const;        
00126         int serialize(IWrapperSoapSerializer& pSZ);
00127 
00128         //Following functions are used by wrapper class methods making sure of the valid type.
00129         int GetInt(int* pValue);
00130     int GetUnsignedInt(unsigned int* pValue);    
00131     int GetShort(short* pValue);
00132     int GetUnsignedShort(unsigned short* pValue);
00133     int GetByte(char* pValue);
00134     int GetUnsignedByte(unsigned char* pValue);
00135     int GetLong(long* pValue);
00136     int GetInteger(long* pValue);
00137     int GetUnsignedLong(unsigned long* pValue);
00138         int GetFloat(float* pValue);
00139     int GetDouble(double* pValue);
00140     int GetDecimal(double* pValue);
00141     int GetAnyURI(const AxisChar** pValue);
00142     int GetQName(const AxisChar** pValue);
00143     int GetDateTime(struct tm* pValue);
00144     int GetDate(struct tm* pValue);
00145     int GetTime(struct tm* pValue);
00146     int GetDuration(long* pValue);
00147         int GetString(const AxisChar** pValue);
00148         int GetHexString(const AxisChar** pValue);
00149         int GetBase64String(const AxisChar** pValue);
00150         void setPrefix(const AxisChar* prefix);
00151         void setUri(const AxisChar* uri);
00152         int GetArraySize(int* pValue);
00153         int SetArrayElements(void* pElements);
00154         int SetArrayElements(void* pObject, AXIS_DESERIALIZE_FUNCT pDZFunct, AXIS_OBJECT_DELETE_FUNCT pDelFunct, AXIS_OBJECT_SIZE_FUNCT pSizeFunct);
00155         int SetUserType(void* pObject, AXIS_DESERIALIZE_FUNCT pDZFunct, AXIS_OBJECT_DELETE_FUNCT pDelFunct);
00156         void SetName(const AxisChar* sName);
00157         uParamValue GetValue(){ return m_Value;};
00158         int GetString(string* pValue);
00159     int GetAnyURI(string* pValue);
00160     int GetQName(string* pValue);
00161         int GetHexString(string* pValue);
00162         int GetBase64String(string* pValue);
00163 };
00164 
00165 #endif // !defined(AFX_PARAM_H__351B13BB_5D03_40C5_93F5_56D17295A8BD__INCLUDED_)

Generated on Wed Dec 24 18:04:58 2003 for axisc++ by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002