00001 #ifndef _INT64VALUE_H_ 00002 #define _INT64VALUE_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 FdoInt64Value class derives from FdoDataValue and represents a 64-bit signed integer value. 00032 class FdoInt64Value : public FdoDataValue 00033 { 00034 /// \cond DOXYGEN-IGNORE 00035 friend class FdoByteValue; 00036 friend class FdoInt16Value; 00037 friend class FdoInt32Value; 00038 friend class FdoStringValue; 00039 friend class FdoDataValue; 00040 protected: 00041 /// \brief 00042 /// Constructs a default instance of an FdoInt64Value with a 00043 /// value of null. 00044 /// \return 00045 /// Returns nothing 00046 /// 00047 FdoInt64Value(); 00048 00049 /// \brief 00050 /// Constructs a default instance of an FdoInt64Value using the specified arguments. 00051 /// \param value 00052 /// Input a 64 bit integer 00053 /// 00054 /// \return 00055 /// Returns nothing 00056 /// 00057 FdoInt64Value(FdoInt64 value); 00058 00059 /// \brief 00060 /// Default destructor for FdoInt64Value. 00061 virtual ~FdoInt64Value(); 00062 00063 virtual void Dispose(); 00064 /// \endcond 00065 00066 public: 00067 00068 /// \brief 00069 /// Constructs a default instance of an FdoInt64Value with a value of null. 00070 /// 00071 /// \return 00072 /// Returns the created FdoInt64Value 00073 /// 00074 FDO_API static FdoInt64Value* Create(); 00075 00076 /// \brief 00077 /// Constructs a default instance of an FdoInt64Value using the specified arguments. 00078 /// 00079 /// \param value 00080 /// Input a 64 bit integer 00081 /// 00082 /// \return 00083 /// Returns the created FdoInt64Value 00084 /// 00085 FDO_API static FdoInt64Value* Create(FdoInt64 value); 00086 00087 /// \brief 00088 /// Gets the data type of the FdoInt64Value. 00089 /// 00090 /// \return 00091 /// Returns an FdoDataType 00092 /// 00093 FDO_API FdoDataType GetDataType(); 00094 00095 /// \brief 00096 /// Gets the FdoInt64Value. 00097 /// 00098 /// \return 00099 /// Returns a 64 bit integer 00100 /// 00101 FDO_API FdoInt64 GetInt64(); 00102 00103 /// \brief 00104 /// Sets the FdoInt64Value. 00105 /// 00106 /// \param value 00107 /// Input a 64 bit integer 00108 /// 00109 /// \return 00110 /// Returns nothing 00111 /// 00112 FDO_API void SetInt64(FdoInt64 value); 00113 00114 /// \brief 00115 /// Overrides FdoExpression.Process to pass the FdoInt64Value to the appropriate 00116 /// expression processor operation. 00117 /// 00118 /// \param p 00119 /// Input an FdoIExpressionProcessor 00120 /// 00121 /// \return 00122 /// Returns nothing 00123 /// 00124 FDO_API void Process(FdoIExpressionProcessor* p); 00125 00126 /// \brief 00127 /// Returns the well defined text representation of this expression. 00128 /// 00129 /// \return 00130 /// Returns a character string 00131 /// 00132 FDO_API FdoString* ToString(); 00133 00134 /// \brief 00135 /// A cast operator to get the integer value. 00136 /// 00137 /// \return 00138 /// Returns a 64 bit integer 00139 /// 00140 FDO_API operator FdoInt64() 00141 { 00142 return m_data; 00143 } 00144 00145 /// \cond DOXYGEN-IGNORE 00146 protected: 00147 /// \brief 00148 /// Constructs an instance of an FdoInt64Value from another FdoDataValue. 00149 /// 00150 /// \param src 00151 /// Input the other FdoDataValue. Must be of one of the following types: 00152 /// FdoDataType_Boolean 00153 /// FdoDataType_Byte 00154 /// FdoDataType_Decimal 00155 /// FdoDataType_Double 00156 /// FdoDataType_Int16 00157 /// FdoDataType_Int32 00158 /// FdoDataType_Int64 00159 /// FdoDataType_Single 00160 /// FdoDataType_String 00161 /// - value must be numeric. 00162 /// 00163 /// In all other cases, the src type is considered incompatible with this type. 00164 /// \param nullIfIncompatible 00165 /// Input will determine what to do if the source value cannot be converted to 00166 /// this type: 00167 /// true - return NULL. 00168 /// false - throw an exception 00169 /// 00170 /// \param shift 00171 /// Input determines whether non integer values can be converted: 00172 /// true - convert values by rounding them. 00173 /// false - behaviour depends on nullIfIncompatible: 00174 /// true - return NULL. 00175 /// false - throw an exception 00176 /// \param truncate 00177 /// Input determines what to do if source value is outside the FdoInt64 range 00178 // ( FdoInt64Min to FdoInt64Max): 00179 /// true - convert values less than FdoInt64Min to FdoInt64Min, convert values greater than FdoInt64Max to FdoInt64Max 00180 /// false - behaviour depends on nullIfIncompatible: 00181 /// true - return NULL. 00182 /// false - throw an exception 00183 /// \return 00184 /// Returns an FdoInt64Value, whose value is converted from the src value. 00185 /// If src is an FdoBooleanValue: 00186 /// false is converted to 0 00187 /// true is converted to 1 00188 /// 00189 static FdoInt64Value* Create( 00190 FdoDataValue* src, 00191 FdoBoolean nullIfIncompatible = false, 00192 FdoBoolean shift = true, 00193 FdoBoolean truncate = false 00194 ); 00195 00196 // See FdoDataValue::DoCompare() 00197 virtual FdoCompareType DoCompare( FdoDataValue* other ); 00198 00199 FdoInt64 m_data; 00200 /// \endcond 00201 }; 00202 #endif 00203 00204