FDO API Reference Feature Data Objects

Filter.h

Go to the documentation of this file.
00001 #ifndef _FILTER_H_
00002 #define _FILTER_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/Filter/BinaryLogicalOperations.h>
00028 #include <Fdo/Commands/IdentifierCollection.h>
00029 
00030 class FdoIFilterProcessor;
00031 
00032 /// \brief
00033 /// The FdoFilter abstract class is a base class for condition and operator classes
00034 /// that can occur in a filter expression tree. The FdoFilter class contains
00035 /// operations for converting between the text and expression tree representation
00036 /// of a filter.
00037 class FdoFilter : public FdoIDisposable
00038 {
00039 protected:
00040 /// \cond DOXYGEN-IGNORE
00041     FdoFilter();
00042     virtual ~FdoFilter();
00043 /// \endcond
00044 
00045 public:
00046     /// \brief
00047     /// Static operation that parses the well defined text representation and
00048     /// returns a Filter instance.
00049     /// 
00050     /// \param filterText 
00051     /// Input well defined text string
00052     /// 
00053     /// \return
00054     /// Returns root node of parse tree
00055     /// 
00056     FDO_API static FdoFilter* Parse(FdoString* filterText);
00057 
00058     /// \brief
00059     /// Abstract operation that takes an FdoIFilterProcessor as an argument.
00060     /// Concrete filter subclasses must override this method and pass themselves
00061     /// as an argument to the appropriate filter processor operation.
00062     /// 
00063     /// \param p 
00064     /// Input filter processor
00065     /// 
00066     /// \return
00067     /// Returns nothing
00068     /// 
00069     FDO_API virtual void Process(FdoIFilterProcessor* p) = 0;
00070 
00071     /// \brief
00072     /// Converts the filter expression to its well
00073     /// defined text representation.
00074     /// 
00075     /// \return
00076     /// Returns well defined text string
00077     /// 
00078     FDO_API FdoString* ToString();
00079 
00080 /// \cond DOXYGEN-IGNORE
00081     /// \brief
00082     /// This is an internal method. It returns the well defined text representation of the filter. 
00083     /// 
00084     /// \param pIdCol 
00085     /// A identifier collection that contains all the computed identifier used by the filter
00086     /// 
00087     /// \return
00088     /// Returns the well defined text string
00089     /// 
00090     virtual FdoString* ToStringInternal( FdoIdentifierCollection *pIdCol ) = 0;
00091 /// \endcond
00092 
00093     /// \brief
00094     /// Static operation that combines two filters using the specified binary
00095     /// logical operation.
00096     /// 
00097     /// \param lhs 
00098     /// Input left hand expression as filter expression
00099     /// \param operation 
00100     /// Input binary logical operation
00101     /// \param rhs 
00102     /// Input right hand expression as filter expression
00103     /// 
00104     /// \return
00105     /// Returns new filter node
00106     /// 
00107     FDO_API static FdoFilter* Combine(FdoFilter* lhs, FdoBinaryLogicalOperations operation, FdoFilter* rhs);
00108 
00109     /// \brief
00110     /// Static operation that combines two filters using the specified binary
00111     /// logical operation.
00112     /// 
00113     /// \param lhs 
00114     /// Input left hand expression as well defined text string
00115     /// \param operation 
00116     /// Input binary logical operation
00117     /// \param rhs 
00118     /// Input right hand expression as filter expression
00119     /// 
00120     /// \return
00121     /// Returns new filter node
00122     /// 
00123     FDO_API static FdoFilter* Combine(FdoString* lhs, FdoBinaryLogicalOperations operation, FdoFilter* rhs);
00124 
00125     /// \brief
00126     /// Static operation that combines two filters using the specified binary
00127     /// logical operation.
00128     /// 
00129     /// \param lhs 
00130     /// Input left hand expression as filter expression
00131     /// \param operation 
00132     /// Input binary logical operation
00133     /// \param rhs 
00134     /// Input right hand expression as well defined text string
00135     /// 
00136     /// \return
00137     /// Returns new filter node
00138     /// 
00139     FDO_API static FdoFilter* Combine(FdoFilter* lhs, FdoBinaryLogicalOperations operation, FdoString* rhs);
00140 
00141     /// \brief
00142     /// Static operation that combines two filters using the specified binary
00143     /// logical operation.
00144     /// 
00145     /// \param lhs 
00146     /// Input left hand expression as well defined text string
00147     /// \param operation 
00148     /// Input binary logical operation
00149     /// \param rhs 
00150     /// Input right hand expression as well defined text string
00151     /// 
00152     /// \return
00153     /// Returns new filter node
00154     /// 
00155     FDO_API static FdoFilter* Combine(FdoString* lhs, FdoBinaryLogicalOperations operation, FdoString* rhs);
00156 
00157 protected:
00158 /// \cond DOXYGEN-IGNORE
00159     wchar_t*    m_toString;
00160 /// \endcond
00161 };
00162 #endif
00163 
00164 

Comments or suggestions? Send us feedback.