FDO API Reference Feature Data Objects

DataValue.h

Go to the documentation of this file.
00001 #ifndef _DATAVALUE_H_
00002 #define _DATAVALUE_H_
00003 // 
00004 
00005 //
00006 // Copyright (C) 2004-2006  Autodesk, Inc.
00007 // 
00008 // This library is free software; you can redistribute it and/or
00009 // modify it under the terms of version 2.1 of the GNU Lesser
00010 // General Public License as published by the Free Software Foundation.
00011 // 
00012 // This library is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 // Lesser General Public License for more details.
00016 // 
00017 // You should have received a copy of the GNU Lesser General Public
00018 // License along with this library; if not, write to the Free Software
00019 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00020 //
00021 
00022 #ifdef _WIN32
00023 #pragma once
00024 #endif
00025 
00026 #include <FdoStd.h>
00027 #include <Fdo/Expression/LiteralValue.h>
00028 #include <Fdo/Schema/DataType.h>
00029 
00030 /// \brief
00031 /// The FdoDataValue class derives from FdoLiteralValue and represents a literal
00032 /// value such as a string or a number.
00033 class FdoDataValue : public FdoLiteralValue
00034 {
00035 protected:
00036 /// \cond DOXYGEN-IGNORE
00037     /// \brief
00038     ///  Constructs a default instance of an FdoDataValue with data type string and a
00039     /// value of null.
00040     /// 
00041     /// \return
00042     /// Returns nothing
00043     /// 
00044     FdoDataValue();
00045 /// \endcond
00046 
00047 public:
00048     /// \brief
00049     /// Constructs an instance of a null FdoDataValue using the specified arguments.
00050     /// 
00051     /// \param dataType 
00052     /// Input data type
00053     /// 
00054     /// \return
00055     /// Returns nothing
00056     /// 
00057     FDO_API static FdoDataValue* Create(FdoDataType dataType);
00058 
00059     /// \brief
00060     /// Constructs an instance of an FdoBooleanValue using the specified argument.
00061     /// 
00062     /// \param value 
00063     /// Input a Boolean value
00064     /// 
00065     /// \return
00066     /// Returns an FdoBooleanValue
00067     /// 
00068     FDO_API static FdoDataValue* Create(bool value);
00069 
00070     /// \brief
00071     /// Constructs an instance of an FdoByteValue using the specified argument.
00072     /// 
00073     /// \param value 
00074     /// Input a byte
00075     /// 
00076     /// \return
00077     /// Returns an FdoByteValue
00078     /// 
00079     FDO_API static FdoDataValue* Create(FdoByte value);
00080 
00081     /// \brief
00082     /// Constructs an instance of an FdoDateTimeValue using the specified argument.
00083     /// 
00084     /// \param value 
00085     /// Input a FdoDateTime
00086     /// 
00087     /// \return
00088     /// Returns an FdoDateTimeValue
00089     /// 
00090     FDO_API static FdoDataValue* Create(FdoDateTime value);
00091 
00092     /// \brief
00093     /// Constructs an instance of an FdoDecimalValue or FdoDoubleValue using 
00094     /// the specified arguments.
00095     /// 
00096     /// \param value 
00097     /// Input a double
00098     /// \param dataType 
00099     /// Input a data type
00100     /// 
00101     /// \return
00102     /// Returns an FdoDecimalValue or FdoDoubleValue
00103     /// 
00104     FDO_API static FdoDataValue* Create(double value, FdoDataType dataType);
00105 
00106     /// \brief
00107     /// Constructs an instance of an FdoInt16Value using the specified argument.
00108     /// 
00109     /// \param value 
00110     /// Input a 16 bit integer
00111     /// 
00112     /// \return
00113     /// Returns an FdoInt16Value
00114     /// 
00115     FDO_API static FdoDataValue* Create(FdoInt16 value);
00116 
00117     /// \brief
00118     /// Constructs an instance of an FdoInt32Value using the specified argument.
00119     /// 
00120     /// \param value 
00121     /// Input a 32 bit integer
00122     /// 
00123     /// \return
00124     /// Returns an FdoInt32Value
00125     /// 
00126     FDO_API static FdoDataValue* Create(FdoInt32 value);
00127 
00128     /// \brief
00129     /// Constructs an instance of an FdoInt64Value using the specified argument.
00130     /// 
00131     /// \param value 
00132     /// Input a 64 bit integer
00133     /// 
00134     /// \return
00135     /// Returns an FdoInt64Value
00136     /// 
00137     FDO_API static FdoDataValue* Create(FdoInt64 value);
00138 
00139     /// \brief
00140     /// Constructs an instance of an FdoSingleValue using the specified argument.
00141     /// 
00142     /// \param value 
00143     /// Input a single precision floating point value
00144     /// 
00145     /// \return
00146     /// Returns an FdoSingleValue
00147     /// 
00148     FDO_API static FdoDataValue* Create(float value);
00149 
00150     /// \brief
00151     /// Constructs an instance of an FdoStringValue using the specified argument.
00152     /// 
00153     /// \param value 
00154     /// Input a character string
00155     /// 
00156     /// \return
00157     /// Returns an FdoStringValue
00158     /// 
00159     FDO_API static FdoDataValue* Create(FdoString* value);
00160 
00161     /// \brief
00162     /// Constructs an instance of an FdoBLOBValue or FdoCLOBValue using the specified arguments.
00163     /// 
00164     /// \param value 
00165     /// Input a byte array
00166     /// \param length 
00167     /// Input the length of the byte array
00168     /// \param dataType 
00169     /// Input the type of value to create
00170     /// 
00171     /// \return
00172     /// Returns an FdoBLOBValue or an FdoCLOBValue
00173     /// 
00174     FDO_API static FdoDataValue* Create(FdoByte* value, FdoInt32 length, FdoDataType dataType);
00175 
00176     /// \brief
00177     /// Constructs an instance of an FdoBLOBValue or FdoCLOBValue using the specified arguments.
00178     /// 
00179     /// \param value 
00180     /// Input a byte array
00181     /// \param dataType 
00182     /// Input the type of value to create
00183     /// 
00184     /// \return
00185     /// Returns an FdoBLOBValue or an FdoCLOBValue
00186     /// 
00187     FDO_API static FdoDataValue* Create(FdoByteArray* value, FdoDataType dataType);
00188 
00189     /// \brief
00190     /// Gets the data type of the FdoDataValue.
00191     /// 
00192     /// \return
00193     /// Returns an FdoDataType
00194     /// 
00195     FDO_API virtual FdoDataType GetDataType() = 0;
00196 
00197     /// \brief
00198     /// Returns true if the FdoDataValue represents a null value.
00199     /// 
00200     /// \return
00201     /// Returns true if the FdoDataValue represents a null value
00202     /// 
00203     FDO_API virtual bool IsNull();
00204 
00205     /// \brief
00206     /// Sets the FdoDataValue to a null value of the specified type.
00207     /// 
00208     /// \return
00209     /// Returns nothing
00210     /// 
00211     FDO_API virtual void SetNull();
00212 
00213     static FdoDataValue* Create(FdoString* value, FdoDataType dataType);
00214 
00215     static FdoString* GetStringValue(FdoDataValue* dataValue);
00216 
00217 protected:
00218 /// \cond DOXYGEN-IGNORE
00219     bool        m_isNull;
00220 };
00221 /// \endcond
00222 
00223 /// \brief
00224 /// FdoDataValueP is a FdoPtr on FdoDataValue, provided for convenience.
00225 typedef FdoPtr<FdoDataValue> FdoDataValueP;
00226 
00227 #endif
00228 
00229 

Comments or suggestions? Send us feedback.