FDO API Reference Feature Data Objects

BinaryExpression.h

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

Comments or suggestions? Send us feedback.