FDO API Reference | Feature Data Objects |
00001 #ifndef _DOUBLEVALUE_H_ 00002 #define _DOUBLEVALUE_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/DataValue.h> 00028 #include <Fdo/Schema/DataType.h> 00029 00030 /// \brief 00031 /// The FdoDoubleValue class derives from FdoDataValue and represents a double-precision floating point number. 00032 class FdoDoubleValue : public FdoDataValue 00033 { 00034 /// \cond DOXYGEN-IGNORE 00035 friend class FdoByteValue; 00036 friend class FdoInt16Value; 00037 friend class FdoInt32Value; 00038 friend class FdoInt64Value; 00039 friend class FdoSingleValue; 00040 protected: 00041 /// \brief 00042 /// Constructs a default instance of an FdoDoubleValue with a 00043 /// value of null. 00044 /// 00045 /// \return 00046 /// Returns nothing 00047 /// 00048 FdoDoubleValue(); 00049 00050 /// \brief 00051 /// Constructs a default instance of an FdoDoubleValue using the 00052 /// specified arguments. 00053 /// 00054 /// \param value 00055 /// Input a double 00056 /// 00057 /// \return 00058 /// Returns nothing 00059 /// 00060 FdoDoubleValue(double value); 00061 00062 /// \brief 00063 /// Default destructor for FdoDoubleValue. 00064 /// 00065 /// \return 00066 /// Returns nothing 00067 /// 00068 virtual ~FdoDoubleValue(); 00069 00070 virtual void Dispose(); 00071 /// \endcond 00072 00073 public: 00074 00075 /// \brief 00076 /// Constructs a default instance of an FdoDoubleValue with a value of null. 00077 /// 00078 /// \return 00079 /// Returns the created FdoDoubleValue 00080 /// 00081 FDO_API static FdoDoubleValue* Create(); 00082 00083 /// \brief 00084 /// Constructs a default instance of an FdoDoubleValue using the specified arguments. 00085 /// 00086 /// \param value 00087 /// Input a double 00088 /// 00089 /// \return 00090 /// Returns the created FdoDoubleValue 00091 /// 00092 FDO_API static FdoDoubleValue* Create(double value); 00093 00094 /// \brief 00095 /// Gets the data type of the FdoDoubleValue. 00096 /// 00097 /// \return 00098 /// Returns an FdoDataType 00099 /// 00100 FDO_API FdoDataType GetDataType(); 00101 00102 /// \brief 00103 /// Gets the double value. 00104 /// 00105 /// \return 00106 /// Returns a double 00107 /// 00108 FDO_API double GetDouble(); 00109 00110 /// \brief 00111 /// Sets the double value as a double precision floating point number. 00112 /// 00113 /// \param value 00114 /// Input a double 00115 /// 00116 /// \return 00117 /// Returns nothing 00118 /// 00119 FDO_API void SetDouble(double value); 00120 00121 /// \brief 00122 /// Overrides FdoExpression.Process to pass the FdoDoubleValue to the appropriate 00123 /// expression processor operation. 00124 /// 00125 /// \param p 00126 /// Input an FdoIExpressionProcessor 00127 /// 00128 /// \return 00129 /// Returns nothing 00130 /// 00131 FDO_API void Process(FdoIExpressionProcessor* p); 00132 00133 /// \brief 00134 /// Returns the well defined text representation of this expression. 00135 /// 00136 /// \return 00137 /// Returns a character string 00138 /// 00139 FDO_API FdoString* ToString(); 00140 00141 /// \brief 00142 /// A cast operator to get the double value. 00143 /// 00144 /// \return 00145 /// Returns a double 00146 /// 00147 FDO_API operator double() 00148 { 00149 return m_data; 00150 } 00151 00152 /// \cond DOXYGEN-IGNORE 00153 protected: 00154 /// \brief 00155 /// Constructs an instance of an FdoDoubleValue from another FdoDataValue. 00156 /// 00157 /// \param src 00158 /// Input the other FdoDataValue. Must be of one of the following types: 00159 /// FdoDataType_Byte 00160 /// FdoDataType_Decimal 00161 /// FdoDataType_Double 00162 /// FdoDataType_Int16 00163 /// FdoDataType_Int32 00164 /// FdoDataType_Int64 00165 /// FdoDataType_Single 00166 /// \param truncate 00167 /// Input in the future, will determine what to do if source value does not fit in the double 00168 /// number range: 00169 /// true - truncate the value to fit. 00170 /// false - throw an exception 00171 /// \param nullIfIncompatible 00172 /// Input in the future, will determine what to do if source value type is not compatible with the 00173 /// FDO double type: 00174 /// true - return NULL. 00175 /// false - throw an exception 00176 /// 00177 /// \return 00178 /// Returns an FdoDoubleValue 00179 /// 00180 static FdoDoubleValue* Create( 00181 FdoDataValue* src, 00182 FdoBoolean truncate = false, 00183 FdoBoolean nullIfIncompatible = false 00184 ); 00185 00186 // See FdoDataValue::DoCompare() 00187 virtual FdoCompareType DoCompare( FdoDataValue* other ); 00188 00189 double m_data; 00190 /// \endcond 00191 }; 00192 #endif 00193 00194
Comments or suggestions? Send us feedback. |