FDO API Reference Feature Data Objects

ComparisonCondition.h

Go to the documentation of this file.
00001 #ifndef _COMPARISONCONDITION_H_
00002 #define _COMPARISONCONDITION_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/ComparisonOperations.h>
00028 #include <Fdo/Expression/Expression.h>
00029 #include <Fdo/Filter/SearchCondition.h>
00030 
00031 /// \brief
00032 /// The FdoComparisonCondition class derives from FdoSearchCondition and can be used
00033 /// to test the equality of two expressions.
00034 class FdoComparisonCondition : public FdoSearchCondition
00035 {
00036 protected:
00037 /// \cond DOXYGEN-IGNORE
00038     /// Constructs a default instance of an FdoComparisonCondition.
00039     FdoComparisonCondition();
00040 
00041     /// Constructs an instance of an FdoComparisonCondition using the specified
00042     /// arguments.
00043     FdoComparisonCondition(FdoExpression* leftExpression, FdoComparisonOperations operation, FdoExpression* rightExpression);
00044 
00045     virtual ~FdoComparisonCondition();
00046 
00047     virtual void Dispose();
00048 /// \endcond
00049 
00050 public:
00051 
00052     /// \brief
00053     /// Constructs a default instance of an FdoComparisonCondition.
00054     /// 
00055     /// \return
00056     /// Returns FdoComparisonCondition
00057     /// 
00058     FDO_API static FdoComparisonCondition* Create();
00059 
00060     /// \brief
00061     /// Constructs an instance of a ComparisonCondition using the specified arguments.
00062     /// 
00063     /// \param leftExpression 
00064     /// Input the expression that defines the left side of the comparison
00065     /// \param operation 
00066     /// Input the operation to be used to compare the two expressions
00067     /// \param rightExpression 
00068     /// Input the expression that defines the right side of the comparison
00069     /// 
00070     /// \return
00071     /// Returns FdoComparisonCondition
00072     /// 
00073     FDO_API static FdoComparisonCondition* Create(FdoExpression* leftExpression, FdoComparisonOperations operation, FdoExpression* rightExpression);
00074 
00075     /// \brief
00076     /// Gets the operation to be used to compare the two expressions.
00077     /// 
00078     /// \return
00079     /// Returns the operation to be used to compare the two expressions
00080     /// 
00081     FDO_API FdoComparisonOperations GetOperation();
00082 
00083     /// \brief
00084     /// Sets the operation to be used to compare the two expressions.
00085     /// 
00086     /// \param operation 
00087     /// Input the operation to be used to compare the two expressions
00088     /// 
00089     /// \return
00090     /// Returns nothing
00091     /// 
00092     FDO_API void SetOperation(FdoComparisonOperations operation);
00093 
00094     /// \brief
00095     /// Gets the expression that defines the left side of the comparison.
00096     /// 
00097     /// \return
00098     /// Returns the expression that defines the left side of the comparison
00099     /// 
00100     FDO_API FdoExpression* GetLeftExpression();
00101 
00102     /// \brief
00103     /// Sets the expression that defines the left side of the comparison.
00104     /// 
00105     /// \param value 
00106     /// Input the expression that defines the left side of the comparison
00107     /// 
00108     /// \return
00109     /// Returns nothing
00110     /// 
00111     FDO_API void SetLeftExpression(FdoExpression* value);
00112 
00113     /// \brief
00114     /// Gets the expression that defines the right side of the comparison.
00115     /// 
00116     /// \return
00117     /// Returns the expression that defines the right side of the comparison
00118     /// 
00119     FDO_API FdoExpression* GetRightExpression();
00120 
00121     /// \brief
00122     /// Sets the expression that defines the right side of the comparison.
00123     /// 
00124     /// \param value 
00125     /// Input the expression that defines the right side of the comparison
00126     /// 
00127     /// \return
00128     /// Returns nothing
00129     /// 
00130     FDO_API void SetRightExpression(FdoExpression* value);
00131 
00132     /// \brief
00133     /// Overrides FdoFilter.Process to pass the FdoComparisonCondition to the
00134     /// appropriate filter processor operation.
00135     /// 
00136     /// \param p 
00137     /// Input filter processor
00138     /// 
00139     /// \return
00140     /// Returns nothing
00141     /// 
00142     FDO_API void Process(FdoIFilterProcessor* p);
00143 
00144 /// \cond DOXYGEN-IGNORE
00145     /// \brief
00146     /// This is an internal method. It returns the well defined text representation of the filter. 
00147     /// 
00148     /// \param pIdCol 
00149     /// A identifier collection that contains all the computed identifier used by the filter
00150     /// 
00151     /// \return
00152     /// Returns the well defined text string
00153     /// 
00154     FdoString* ToStringInternal( FdoIdentifierCollection *pIdCol );
00155 /// \endcond
00156 
00157 private:
00158     FdoExpression*          m_leftExpression;
00159     FdoExpression*          m_rightExpression;
00160     FdoComparisonOperations m_operation;
00161 };
00162 #endif
00163 
00164 

Comments or suggestions? Send us feedback.