FDO API Reference Feature Data Objects

FunctionDefinition.h

Go to the documentation of this file.
00001 #ifndef _FUNCTIONDEFINITION_H_
00002 #define _FUNCTIONDEFINITION_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/Schema/PropertyType.h>
00028 #include <Fdo/Connections/Capabilities/ArgumentDefinition.h>
00029 #include <Fdo/Connections/Capabilities/ReadOnlyArgumentDefinitionCollection.h>
00030 #include <Fdo/Connections/Capabilities/SignatureDefinition.h>
00031 
00032 /// \brief
00033 ///  The FdoFunctionDefinition class contains metadata that describes a function and its arguments.
00034 class FdoFunctionDefinition : public FdoIDisposable
00035 {
00036 protected:
00037 /// \cond DOXYGEN-IGNORE
00038     /// Constructs an instance of an FdoFunctionDefinition using the specified arguments.
00039     FdoFunctionDefinition (FdoString                       *name,
00040                            FdoString                       *description,
00041                            FdoDataType                     returnType,
00042                            FdoArgumentDefinitionCollection *arguments);
00043 
00044     /// Constructs an instance of an FdoFunctionDefinition using the specified arguments.
00045     FdoFunctionDefinition (FdoString                       *name,
00046                            FdoString                       *description,
00047                            FdoPropertyType                 returnPropertyType,
00048                            FdoDataType                     returnType,
00049                            FdoArgumentDefinitionCollection *arguments);
00050 
00051     /// Constructs an instance of an FdoFunctionDefinition using the specified arguments.
00052     // FdoFunctionDefinition (FdoSignatureDefinitionCollection *signatures);
00053     FdoFunctionDefinition (FdoString                        *name,
00054                            FdoString                        *description,
00055                            bool                             isAggregate,
00056                            FdoSignatureDefinitionCollection *signatures);
00057 
00058     /// Constructs an instance of an FdoFunctionDefinition using default values.
00059     FdoFunctionDefinition();
00060 
00061     virtual ~FdoFunctionDefinition();
00062 
00063     virtual void Dispose();
00064 /// \endcond
00065 
00066 public:
00067     /// \brief
00068     ///  Constructs an instance of an FdoFunctionDefinition using the specified arguments.
00069     /// 
00070     /// \param name 
00071     /// Input the name of the function.
00072     /// \param description 
00073     /// Input a brief description.
00074     /// \param returnType 
00075     /// Input the function return type
00076     /// \param arguments 
00077     /// Input the argument definition list
00078     /// 
00079     /// \return
00080     /// Returns FdoFunctionDefinition
00081     /// 
00082     FDO_API static FdoFunctionDefinition *Create (FdoString                       *name,
00083                                                   FdoString                       *description,
00084                                                   FdoDataType                     returnType,
00085                                                   FdoArgumentDefinitionCollection *arguments);
00086 
00087     /// \brief
00088     ///  Constructs an instance of an FdoFunctionDefinition using the specified arguments.
00089     /// 
00090     /// \param name 
00091     /// Input the name of the function.
00092     /// \param description 
00093     /// Input a brief description.
00094     /// \param returnProperty Type 
00095     /// Input the function return property type
00096     /// \param returnType 
00097     /// Input the function return data type (ignore it property type is not data)
00098     /// \param arguments 
00099     /// Input the argument definition list
00100     /// 
00101     /// \return
00102     /// Returns FdoFunctionDefinition
00103     /// 
00104     FDO_API static FdoFunctionDefinition *Create (FdoString                       *name,
00105                                                   FdoString                       *description,
00106                                                   FdoPropertyType                 returnPropertyType,
00107                                                   FdoDataType                     returnType,
00108                                                   FdoArgumentDefinitionCollection *arguments);
00109 
00110     /// \brief
00111     ///  Constructs an instance of an FdoFunctionDefinition using the specified arguments.
00112     /// 
00113     /// \param name 
00114     /// Input the name of the function.
00115     /// \param description 
00116     /// Input a brief description.
00117     /// \param isAggregate 
00118     /// Input a flag indicating whether or not this is an aggregate function.
00119     /// \param signatures 
00120     /// Input the list of possible function signatures
00121     /// 
00122     /// \return
00123     /// Returns FdoFunctionDefinition
00124     /// 
00125     FDO_API static FdoFunctionDefinition *Create (FdoString                        *name,
00126                                                   FdoString                        *description,
00127                                                   bool                             isAggregate,
00128                                                   FdoSignatureDefinitionCollection *signatures);
00129 
00130     /// \brief
00131     ///  Gets the name of the function.
00132     /// 
00133     /// \return
00134     /// Returns the name of the function
00135     /// 
00136     FDO_API FdoString *GetName();
00137     /// \brief
00138     ///  Gets a brief description of the function.
00139     /// 
00140     /// \return
00141     /// Returns the description of the function
00142     /// 
00143     FDO_API FdoString *GetDescription();
00144     /// \brief
00145     ///  Gets an array of FdoArgumentDefinition objects required for the function.
00146     /// 
00147     /// \param length 
00148     /// Output the number of argument definitions.
00149     /// 
00150     /// \return
00151     /// Returns the list of argument definitions
00152     /// 
00153     FDO_API FdoReadOnlyArgumentDefinitionCollection *GetArguments();
00154     /// \brief
00155     ///  Gets the FdoPropertyType of the function return value.
00156     /// 
00157     /// \return
00158     /// Returns the function return property type
00159     /// 
00160     FDO_API FdoPropertyType GetReturnPropertyType();
00161     /// \brief
00162     ///  Gets the FdoDataType of the function return value.
00163     ///  This is only valid if the function return property type is FdoPropertyType_DataProperty.
00164     /// 
00165     /// \return
00166     /// Returns the function return data type
00167     /// 
00168     FDO_API FdoDataType GetReturnType();
00169     /// \brief
00170     ///  Indicates that this object allows its name
00171     /// to change. This function is defined so that this class can 
00172     /// be a FdoNamedCollection element.
00173     /// 
00174     /// \return
00175     /// Returns false
00176     /// 
00177     FDO_API virtual FdoBoolean CanSetName()
00178     {
00179         return false;
00180     }
00181     ///
00182     /// \brief
00183     /// Gets an array of FdoSignatureDefinition objects that describe the different signatures
00184     /// supported by the function.
00185     ///
00186     FDO_API FdoReadOnlySignatureDefinitionCollection *GetSignatures();
00187     ///
00188     /// \brief
00189     /// Returns true if the function is an aggregate function and false if it is a simple function.
00190     FDO_API bool IsAggregate();
00191     ///
00192 
00193 protected:
00194     bool                                     m_isAggregate;
00195     wchar_t                                  *m_name;
00196     wchar_t                                  *m_description;
00197     FdoReadOnlySignatureDefinitionCollection *m_signatures;
00198 
00199 };
00200 #endif
00201 
00202 

Comments or suggestions? Send us feedback.