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