• Main Page
  • Modules
  • Classes
  • Files
  • File List
  • File Members

IExpressionCapabilities.h

Go to the documentation of this file.
00001 #ifndef _IEXPRESSIONCAPABILITIES_H_
00002 #define _IEXPRESSIONCAPABILITIES_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/ExpressionType.h>
00028 #include <Fdo/Connections/Capabilities/FunctionDefinitionCollection.h>
00029 
00030 // Expression Function Name Specifications
00031 //  - Aggregates Function Names
00032 #define  FDO_FUNCTION_AVG             L"Avg"             // Returns the average value of an expression
00033 #define  FDO_FUNCTION_COUNT           L"Count"           // Returns the number of objects in the query
00034 #define  FDO_FUNCTION_MAX             L"Max"             // Returns the maximum value of an expression
00035 #define  FDO_FUNCTION_MEDIAN          L"Median"          // Returns the middle value or an interpolated value that
00036                                                          // would be the middle value once the values are sorted of
00037                                                          // an expression
00038 #define  FDO_FUNCTION_MIN             L"Min"             // Returns the minimum value of an expression
00039 #define  FDO_FUNCTION_SPATIALEXTENTS  L"SpatialExtents"  // Returns the minimum bounding rectangle of a geometry
00040                                                          // expression
00041 #define  FDO_FUNCTION_STDDEV          L"Stddev"          // Returns the standard deviation of an expression
00042 #define  FDO_FUNCTION_SUM             L"Sum"             // Returns the sum of values of an expression
00043 
00044 //  - Conversion Function Names
00045 #define  FDO_FUNCTION_NULLVALUE  L"NullValue"  // Evaluates two expressions and returns the first one if it does not
00046                                                // evaluate to NULL, the second otherwise
00047 #define  FDO_FUNCTION_TODATE     L"ToDate"     // Converts a string to a date
00048 #define  FDO_FUNCTION_TODOUBLE   L"ToDouble"   // Converts a numeric or string expression to a double
00049 #define  FDO_FUNCTION_TOFLOAT    L"ToFloat"    // Converts a numeric or string expression to a float
00050 #define  FDO_FUNCTION_TOINT32    L"ToInt32"    // Converts a numeric or string expression to an int32
00051 #define  FDO_FUNCTION_TOINT64    L"ToInt64"    // Converts a numeric or string expression to an int64
00052 #define  FDO_FUNCTION_TOSTRING   L"ToString"   // Converts a numeric or date expression to a string
00053 
00054 //  - Date Function Names
00055 #define  FDO_FUNCTION_ADDMONTHS       L"AddMonths"       // Adds a specified number of months to a date expression
00056 #define  FDO_FUNCTION_CURRENTDATE     L"CurrentDate"     // Returns the current date
00057 #define  FDO_FUNCTION_EXTRACT         L"Extract"         // Extracts a specified portion of a date
00058 #define  FDO_FUNCTION_EXTRACTTODOUBLE L"ExtractToDouble" // Extracts a specified portion of a date to a double
00059 #define  FDO_FUNCTION_EXTRACTTOINT    L"ExtractToInt"    // Extracts a specified portion of a date to an integer
00060 #define  FDO_FUNCTION_MONTHSBETWEEN   L"MonthsBetween"   // Returns the number of months between two date expressions
00061 
00062 //  - Mathematical Function Names
00063 #define  FDO_FUNCTION_ABS        L"Abs"        // Returns the absolute value of a numeric expression
00064 #define  FDO_FUNCTION_ACOS       L"Acos"       // Returns the arc cosine of a numeric expression
00065 #define  FDO_FUNCTION_ASIN       L"Asin"       // Returns the arc sine of a numeric expression
00066 #define  FDO_FUNCTION_ATAN       L"Atan"       // Returns the arc tangent of a numeric expression
00067 #define  FDO_FUNCTION_ATAN2      L"Atan2"      // Returns the arc tangent calculated of two numeric expressions
00068 #define  FDO_FUNCTION_COS        L"Cos"        // Returns the cosine of a numeric expression
00069 #define  FDO_FUNCTION_EXP        L"Exp"        // Returns e raised to the power of a numeric expression
00070 #define  FDO_FUNCTION_LN         L"Ln"         // Returns the natural logarithm of a numeric expression
00071 #define  FDO_FUNCTION_LOG        L"Log"        // Returns the logarithm of a numeric expression calculated on a given
00072                                                // base
00073 #define  FDO_FUNCTION_MOD        L"Mod"        // Returns the remainder of a division of two numeric expressions
00074 #define  FDO_FUNCTION_POWER      L"Power"      // Returns the result of one numeric expression raised to the power of
00075                                                // of a second numeric expression
00076 #define  FDO_FUNCTION_REMAINDER  L"Remainder"  // Returns the remainder of a division of two numeric expressions
00077 #define  FDO_FUNCTION_SIN        L"Sin"        // Returns the sine of a numeric expression
00078 #define  FDO_FUNCTION_SQRT       L"Sqrt"       // Returns the square root of a numeric expression
00079 #define  FDO_FUNCTION_TAN        L"Tan"        // Returns the tangent of a numeric expression
00080 
00081 //  - Numeric function names
00082 #define  FDO_FUNCTION_CEIL   L"Ceil"    // Returns the smallest integer greater than or equal to the expression value
00083 #define  FDO_FUNCTION_FLOOR  L"Floor"   // Returns the largest integer equal to or less than the expression value
00084 #define  FDO_FUNCTION_ROUND  L"Round"   // Returns the rounded value of an expression
00085 #define  FDO_FUNCTION_SIGN   L"Sign"    // Returns -1 if a numeric expression evaluates to a value less than 0, 0
00086                                         // if the numeric expression evaluates to 0 and 1 if the numeric expression
00087                                         // evaluates to a value greater than 0
00088 #define  FDO_FUNCTION_TRUNC  L"Trunc"   // Truncates a numeric or date expression
00089 
00090 //  - Strings function names
00091 #define  FDO_FUNCTION_CONCAT     L"Concat"     // Returns the string concatenation of 2 expressions
00092 #define  FDO_FUNCTION_INSTR      L"Instr"      // Returns the position of a substring in a string expression
00093 #define  FDO_FUNCTION_LENGTH     L"Length"     // Returns the length of a string expression
00094 #define  FDO_FUNCTION_LOWER      L"Lower"      // Returns strings with all lowercase letters
00095 #define  FDO_FUNCTION_LPAD       L"Lpad"       // Pads a string expression to the left to defined length
00096 #define  FDO_FUNCTION_LTRIM      L"Ltrim"      // Removes leading blanks from a string expression
00097 #define  FDO_FUNCTION_RPAD       L"Rpad"       // Pads a string expression to the right to defined length
00098 #define  FDO_FUNCTION_RTRIM      L"Rtrim"      // Removes trailing blanks from a string expression
00099 #define  FDO_FUNCTION_SOUNDEX    L"Soundex"    // Returns the phonetic representation of a string expression
00100 #define  FDO_FUNCTION_SUBSTR     L"Substr"     // Extracts a substring from a string expression
00101 #define  FDO_FUNCTION_TRANSLATE  L"Translate"  // Replaces a set of letters in a string expression
00102 #define  FDO_FUNCTION_TRIM       L"Trim"       // Removes leading and/or trailing blanks from a string expression
00103 #define  FDO_FUNCTION_UPPER      L"Upper"      // Returns strings with all letters uppercase
00104 
00105 //  - Geometry function names
00106 #define  FDO_FUNCTION_AREA2D    L"Area2D"    // Returns the area of a geometry expression
00107 #define  FDO_FUNCTION_LENGTH2D  L"Length2D"  // Returns the length of a geometry expression
00108 #define  FDO_FUNCTION_X         L"X"  // Returns the X coordinate of a point geometry
00109 #define  FDO_FUNCTION_Y         L"Y"  // Returns the Y coordinate of a point geometry
00110 #define  FDO_FUNCTION_Z         L"Z"  // Returns the Z coordinate of a point geometry
00111 #define  FDO_FUNCTION_M         L"M"  // Returns the M coordinate of a point geometry
00112 
00113 /// \brief
00114 /// The FdoIExpressionCapbilities interface declares the feature provider's level
00115 /// of support for FdoExpression classes.
00116 class FdoIExpressionCapabilities : public FdoIDisposable
00117 {
00118 protected:
00119 
00120     /// \brief
00121     /// Constructs and returns an FdoFunctionDefinitionCollection that contains a common list of
00122     /// function definition. Providers can pick the function they support and add them to their supported
00123     /// functions list. This method is internal to providers implementations.
00124     /// 
00125     /// \return
00126     /// Returns FdoFunctionDefinitionCollection
00127     /// 
00128     FDO_API static FdoFunctionDefinitionCollection *GetWellKnownFunctions ();
00129 
00130 public:
00131     /// \brief
00132     /// Returns an array of FdoExpressionType objects the feature provider supports.
00133     /// 
00134     /// \param length 
00135     /// Input the number of expression types
00136     /// 
00137     /// \return
00138     /// Returns the list of expression types
00139     /// 
00140     FDO_API virtual FdoExpressionType *GetExpressionTypes (FdoInt32& length) = 0;
00141 
00142     /// \brief
00143     /// Returns a collection of FdoFunctionDefinition objects the feature provider supports within expressions.
00144     /// 
00145     /// \return
00146     /// Returns the collection of function definitions
00147     /// 
00148     FDO_API virtual FdoFunctionDefinitionCollection *GetFunctions () = 0;
00149 
00150 };
00151 #endif
00152 
00153 
Please send us your comment about this page