30 | | The top level requirements is to distinguish table and view based classes. However, there is no difference in functionality or behaviour between table and view based classes, for the schema designers it is important to know a type of the underlying datastore object. |
| 30 | AGGREGATE:: |
| 31 | ''Avg'', ''Max'', ''Min'', ''Sum'' |
| 32 | |
| 33 | CONVERSION:: |
| 34 | ''ToDate'', ''ToDouble'', ''ToFloat'', ''ToInt32'', ''ToInt64'' |
| 35 | |
| 36 | DATE:: |
| 37 | ''AddMonths'', ''CurrentDate'', ''ToString'' |
| 38 | |
| 39 | MATH:: |
| 40 | ''Asin'', ''Atan'', ''Cos'', ''Exp'', ''Ln'', ''Log'', ''Sqrt'' |
| 41 | |
| 42 | NUMERIC:: |
| 43 | ''Ceil'', ''Floor'', ''Round'', ''Sign'' |
| 44 | |
| 45 | STRING:: |
| 46 | ''Concat'', ''Instr'', ''Lower'', ''Lpad'', ''Ltrim'', ''Upper'' |
| 47 | |
| 48 | The function class will be set via the currently available interfaces (''create'' method). To allow this the interfaces will be enhanced with an optional function class parameter which will be set to the default value. |
34 | | class FdoClassDefinition : public FdoSchemaElement |
| 55 | enum FdoFunctionClass { |
| 56 | FdoFunctionClass_Aggregate, |
| 57 | FdoFunctionClass_Conversion, |
| 58 | FdoFunctionClass_Date, |
| 59 | FdoFunctionClass_Math, |
| 60 | FdoFunctionClass_Numeric, |
| 61 | FdoFunctionClass_String, |
| 62 | FdoFunctionClass_Unknown |
| 63 | } // enum FdoFunctionClass |
| 64 | }}} |
| 65 | |
| 66 | The following shows the required changes to the class ''FdoFunctionDefinition''. Note that the listing only shows the modified or added specifications. |
| 67 | |
| 68 | {{{ |
| 69 | |
| 70 | class FdoFunctionDefinition : public FdoIDisposable |
37 | | private: |
| 73 | protected: |
| 74 | FdoFunctionDefinition (FdoString *name, |
| 75 | FdoString *description, |
| 76 | FdoDataType returnType, |
| 77 | FdoArgumentDefinitionCollection *arguments, |
| 78 | FdoFunctionClass functionClass); |
| 79 | |
| 80 | FdoFunctionDefinition (FdoString *name, |
| 81 | FdoString *description, |
| 82 | FdoPropertyType returnPropertyType, |
| 83 | FdoDataType returnType, |
| 84 | FdoArgumentDefinitionCollection *arguments, |
| 85 | FdoFunctionClass functionClass); |
| 86 | |
| 87 | FdoFunctionDefinition (FdoString *name, |
| 88 | FdoString *description, |
| 89 | bool isAggregate, |
| 90 | FdoSignatureDefinitionCollection *signatures, |
| 91 | FdoFunctionClass functionClass); |
50 | | /// \brief |
51 | | /// Sets the value of mIsViewBased. It is true if a class is based on view; otherwise is false. |
52 | | /// |
53 | | /// \return |
54 | | /// Returns nothing |
55 | | /// |
56 | | FDO_API void SetIsViewBased( bool value ); |
| 104 | /// Various public Constructors |
| 105 | |
| 106 | FDO_API static FdoFunctionDefinition *Create (FdoString *name, |
| 107 | FdoString *description, |
| 108 | FdoDataType returnType, |
| 109 | FdoArgumentDefinitionCollection *arguments, |
| 110 | FdoFunctionClass functionClass = FdoFunctionClass_Unknown); |
| 111 | |
| 112 | FDO_API static FdoFunctionDefinition *Create (FdoString *name, |
| 113 | FdoString *description, |
| 114 | FdoPropertyType returnPropertyType, |
| 115 | FdoDataType returnType, |
| 116 | FdoArgumentDefinitionCollection *arguments, |
| 117 | FdoFunctionClass functionClass = FdoFunctionClass_Unknown); |
| 118 | |
| 119 | FDO_API static FdoFunctionDefinition *Create (FdoString *name, |
| 120 | FdoString *description, |
| 121 | bool isAggregate, |
| 122 | FdoSignatureDefinitionCollection *signatures, |
| 123 | FdoFunctionClass functionClass = FdoFunctionClass_Unknown); |
| 124 | ... |
| 125 | |
| 126 | protected: |
| 127 | ... |
| 128 | FdoFunctionClass m_functionClass; |
| 129 | ... |
| 130 | |