- Main Page
- Related Pages
- Modules
- Classes
- Files

# ComputedIdentifier.h

Go to the documentation of this file.

    00001 #ifndef _COMPUTEDIDENTIFIER_H_
    00002 #define _COMPUTEDIDENTIFIER_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/Identifier.h>
    00028
    00029 /// \brief
    00030 /// The FdoComputedIdentifier class derives from FdoIdentifier and represents an expression
    00031 /// with alias. The name or alias must be a simple name and should not be scoped or contain the
    00032 /// the schema name. The FdoComputedIdentifier can be used to provide an alias to an expression. For
    00033 /// example the expression Length*NumLanes can be refered to as MaxTraficCapacity. In this case, a
    00034 /// computed identifier can be created as:
    00035 /// \code
    00036 ///     FdoComputedIdentifier::Create(L"MaxTraficCapacity",
    00037 ///        FdoBinaryExpression::Create( FdoIdentifier(L"Length"),
    00038 ///                                     FdoBinaryOperations_Multiply,
    00039 ///                                     FdoIdentifier(L"NumLanes")
    00040 ///         );
    00041 ///     );
    00042 /// \endcode
    00043 /// \note
    00044 /// For clarity, the example omits the release code needed to free the various created objects.
    00045 ///
    00046 class FdoComputedIdentifier : public FdoIdentifier
    00047 {
    00048 /// \cond DOXYGEN-IGNORE
    00049 protected:
    00050     /// Constructs a default instance of an identifier.
    00051     FdoComputedIdentifier();
    00052
    00053     /// Constructs an instance of a computed identifier using the specified arguments.
    00054     FdoComputedIdentifier(FdoString* name, FdoExpression* expression);
    00055
    00056     /// Default destructor for identifier.
    00057     virtual ~FdoComputedIdentifier();
    00058
    00059     virtual void Dispose();
    00060 /// \endcond
    00061
    00062 public:
    00063     /// \brief
    00064     /// Constructs a default instance of an identifier.
    00065     ///
    00066     /// \return
    00067     /// Returns the FdoComputedIdentifier
    00068     ///
    00069     FDO_API static FdoComputedIdentifier* Create();
    00070
    00071     /// \brief
    00072     /// Constructs an instance of an identifier using the specified arguments.
    00073     ///
    00074     /// \param name
    00075     /// Input the computed identifier name
    00076     /// \param expression
    00077     /// Input the fdo expression
    00078     ///
    00079     /// \return
    00080     /// Returns the FdoComputedIdentifier
    00081     ///
    00082     FDO_API static FdoComputedIdentifier* Create(FdoString* name, FdoExpression* expression);
    00083
    00084     /// \brief
    00085     /// Gets the full text of the identifier.
    00086     ///
    00087     /// \return
    00088     /// Returns the identifier text
    00089     ///
    00090     FDO_API FdoExpression* GetExpression();
    00091
    00092     /// \brief
    00093     /// Sets the full text of the identifier.
    00094     ///
    00095     /// \param value
    00096     /// Input identifier text
    00097     ///
    00098     /// \return
    00099     /// Returns nothing
    00100     ///
    00101     FDO_API void SetExpression(FdoExpression* value);
    00102
    00103     /// \brief
    00104     /// Overrides FdoExpression.Process to pass the FdoComputedIdentifier to the appropriate
    00105     /// expression processor operation.
    00106     ///
    00107     /// \param p
    00108     /// Input expression processor interface
    00109     ///
    00110     /// \return
    00111     /// Returns nothing
    00112     ///
    00113     FDO_API void Process(FdoIExpressionProcessor* p);
    00114
    00115     /// \brief
    00116     /// Returns the well defined text representation of this expression.
    00117     ///
    00118     /// \return
    00119     /// Returns the well defined text string
    00120     ///
    00121     FDO_API FdoString* ToString();
    00122
    00123     /// \brief
    00124     /// This is an internal method. It returns the well defined text representation of the expression.
    00125     ///
    00126     /// \param pIdCol
    00127     /// A identifier collection that contains all the computed identifier used by the filter
    00128     ///
    00129     /// \return
    00130     /// Returns the well defined text string
    00131     ///
    00132     virtual FdoString* ToStringInternal( FdoIdentifierCollection *pIdCol );
    00133
    00134 private:
    00135     FdoExpression*    m_Expression;
    00136 };
    00137 #endif
    00138
    00139

Please send us your comment about this page