- Main Page
- Related Pages
- Modules
- Classes
- Files

# 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_MONTHSBETWEEN  L"MonthsBetween"  // Returns the number of months between two date expressions
    00059
    00060 //  - Mathematical Function Names
    00061 #define  FDO_FUNCTION_ABS        L"Abs"        // Returns the absolute value of a numeric expression
    00062 #define  FDO_FUNCTION_ACOS       L"Acos"       // Returns the arc cosine of a numeric expression
    00063 #define  FDO_FUNCTION_ASIN       L"Asin"       // Returns the arc sine of a numeric expression
    00064 #define  FDO_FUNCTION_ATAN       L"Atan"       // Returns the arc tangent of a numeric expression
    00065 #define  FDO_FUNCTION_ATAN2      L"Atan2"      // Returns the arc tangent calculated of two numeric expressions
    00066 #define  FDO_FUNCTION_COS        L"Cos"        // Returns the cosine of a numeric expression
    00067 #define  FDO_FUNCTION_EXP        L"Exp"        // Returns e raised to the power of a numeric expression
    00068 #define  FDO_FUNCTION_LN         L"Ln"         // Returns the natural logarithm of a numeric expression
    00069 #define  FDO_FUNCTION_LOG        L"Log"        // Returns the logarithm of a numeric expression calculated on a given
    00070                                                // base
    00071 #define  FDO_FUNCTION_MOD        L"Mod"        // Returns the remainder of a division of two numeric expressions
    00072 #define  FDO_FUNCTION_POWER      L"Power"      // Returns the result of one numeric expression raised to the power of
    00073                                                // of a second numeric expression
    00074 #define  FDO_FUNCTION_REMAINDER  L"Remainder"  // Returns the remainder of a division of two numeric expressions
    00075 #define  FDO_FUNCTION_SIN        L"Sin"        // Returns the sine of a numeric expression
    00076 #define  FDO_FUNCTION_SQRT       L"Sqrt"       // Returns the square root of a numeric expression
    00077 #define  FDO_FUNCTION_TAN        L"Tan"        // Returns the tangent of a numeric expression
    00078
    00079 //  - Numeric function names
    00080 #define  FDO_FUNCTION_CEIL   L"Ceil"    // Returns the smallest integer greater than or equal to the expression value
    00081 #define  FDO_FUNCTION_FLOOR  L"Floor"   // Returns the largest integer equal to or less than the expression value
    00082 #define  FDO_FUNCTION_ROUND  L"Round"   // Returns the rounded value of an expression
    00083 #define  FDO_FUNCTION_SIGN   L"Sign"    // Returns -1 if a numeric expression evaluates to a value less than 0, 0
    00084                                         // if the numeric expression evaluates to 0 and 1 if the numeric expression
    00085                                         // evaluates to a value greater than 0
    00086 #define  FDO_FUNCTION_TRUNC  L"Trunc"   // Truncates a numeric or date expression
    00087
    00088 //  - Strings function names
    00089 #define  FDO_FUNCTION_CONCAT     L"Concat"     // Returns the string concatenation of 2 expressions
    00090 #define  FDO_FUNCTION_INSTR      L"Instr"      // Returns the position of a substring in a string expression
    00091 #define  FDO_FUNCTION_LENGTH     L"Length"     // Returns the length of a string expression
    00092 #define  FDO_FUNCTION_LOWER      L"Lower"      // Returns strings with all lowercase letters
    00093 #define  FDO_FUNCTION_LPAD       L"Lpad"       // Pads a string expression to the left to defined length
    00094 #define  FDO_FUNCTION_LTRIM      L"Ltrim"      // Removes leading blanks from a string expression
    00095 #define  FDO_FUNCTION_RPAD       L"Rpad"       // Pads a string expression to the right to defined length
    00096 #define  FDO_FUNCTION_RTRIM      L"Rtrim"      // Removes trailing blanks from a string expression
    00097 #define  FDO_FUNCTION_SOUNDEX    L"Soundex"    // Returns the phonetic representation of a string expression
    00098 #define  FDO_FUNCTION_SUBSTR     L"Substr"     // Extracts a substring from a string expression
    00099 #define  FDO_FUNCTION_TRANSLATE  L"Translate"  // Replaces a set of letters in a string expression
    00100 #define  FDO_FUNCTION_TRIM       L"Trim"       // Removes leading and/or trailing blanks from a string expression
    00101 #define  FDO_FUNCTION_UPPER      L"Upper"      // Returns strings with all letters uppercase
    00102
    00103 //  - Geometry function names
    00104 #define  FDO_FUNCTION_AREA2D    L"Area2D"    // Returns the area of a geometry expression
    00105 #define  FDO_FUNCTION_LENGTH2D  L"Length2D"  // Returns the length of a geometry expression
    00106
    00107
    00108 /// \brief
    00109 /// The FdoIExpressionCapbilities interface declares the feature provider's level
    00110 /// of support for FdoExpression classes.
    00111 class FdoIExpressionCapabilities : public FdoIDisposable
    00112 {
    00113 protected:
    00114
    00115     /// \brief
    00116     /// Constructs and returns an FdoFunctionDefinitionCollection that contains a common list of
    00117     /// function definition. Providers can pick the function they support and add them to their supported
    00118     /// functions list. This method is internal to providers implementations.
    00119     ///
    00120     /// \return
    00121     /// Returns FdoFunctionDefinitionCollection
    00122     ///
    00123     FDO_API static FdoFunctionDefinitionCollection *GetWellKnownFunctions ();
    00124
    00125 public:
    00126     /// \brief
    00127     /// Returns an array of FdoExpressionType objects the feature provider supports.
    00128     ///
    00129     /// \param length
    00130     /// Input the number of expression types
    00131     ///
    00132     /// \return
    00133     /// Returns the list of expression types
    00134     ///
    00135     FDO_API virtual FdoExpressionType *GetExpressionTypes (FdoInt32& length) = 0;
    00136
    00137     /// \brief
    00138     /// Returns a collection of FdoFunctionDefinition objects the feature provider supports within expressions.
    00139     ///
    00140     /// \return
    00141     /// Returns the collection of function definitions
    00142     ///
    00143     FDO_API virtual FdoFunctionDefinitionCollection *GetFunctions () = 0;
    00144
    00145 };
    00146 #endif
    00147
    00148

Please send us your comment about this page