muParser: muParserCallback.h Source File

- Main Page
- Namespaces
- Classes
- Files
- Examples

# muParserCallback.h

Go to the documentation of this file.

    00001 /*
    00002                  __________
    00003     _____   __ __\______   \_____  _______  ______  ____ _______
    00004    /     \ |  |  \|     ___/\__  \ \_  __ \/  ___/_/ __ \\_  __ \
    00005   |  Y Y  \|  |  /|    |     / __ \_|  | \/\___ \ \  ___/ |  | \/
    00006   |__|_|  /|____/ |____|    (____  /|__|  /____  > \___  >|__|
    00007         \/                       \/            \/      \/
    00008   Copyright (C) 2004-2008 Ingo Berg
    00009
    00010   Permission is hereby granted, free of charge, to any person obtaining a copy of this
    00011   software and associated documentation files (the "Software"), to deal in the Software
    00012   without restriction, including without limitation the rights to use, copy, modify,
    00013   merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
    00014   permit persons to whom the Software is furnished to do so, subject to the following conditions:
    00015
    00016   The above copyright notice and this permission notice shall be included in all copies or
    00017   substantial portions of the Software.
    00018
    00019   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
    00020   NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    00021   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
    00022   DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    00023   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    00024 */
    00025
    00026 #ifndef MU_PARSER_CALLBACK_H
    00027 #define MU_PARSER_CALLBACK_H
    00028
    00029 #include "muParserDef.h"
    00030
    00035 namespace mu
    00036 {
    00037
    00051 class ParserCallback
    00052 {
    00053 public:
    00054     ParserCallback(fun_type0 a_pFun, bool a_bAllowOpti);
    00055     ParserCallback(fun_type1 a_pFun, bool a_bAllowOpti, int a_iPrec = -1, ECmdCode a_iCode=cmFUNC);
    00056     ParserCallback(fun_type2 a_pFun, bool a_bAllowOpti, int a_iPrec = -1, ECmdCode a_iCode=cmFUNC);
    00057     ParserCallback(fun_type3 a_pFun, bool a_bAllowOpti);
    00058     ParserCallback(fun_type4 a_pFun, bool a_bAllowOpti);
    00059     ParserCallback(fun_type5 a_pFun, bool a_bAllowOpti);
    00060     ParserCallback(multfun_type a_pFun, bool a_bAllowOpti);
    00061     ParserCallback(strfun_type1 a_pFun, bool a_bAllowOpti);
    00062     ParserCallback(strfun_type2 a_pFun, bool a_bAllowOpti);
    00063     ParserCallback(strfun_type3 a_pFun, bool a_bAllowOpti);
    00064     ParserCallback();
    00065     ParserCallback(const ParserCallback &a_Fun);
    00066
    00067     ParserCallback* Clone() const;
    00068
    00069     bool  IsOptimizable() const;
    00070     void* GetAddr() const;
    00071     ECmdCode  GetCode() const;
    00072     ETypeCode GetType() const;
    00073     int GetPri()  const;
    00074     int GetArgc() const;
    00075
    00076 private:
    00077     void *m_pFun;
    00078
    00084     int   m_iArgc;
    00085     int   m_iPri;
    00086     ECmdCode  m_iCode;
    00087     ETypeCode m_iType;
    00088     bool  m_bAllowOpti;
    00089 };
    00090
    00091 //------------------------------------------------------------------------------
    00093 typedef std::map<string_type, ParserCallback> funmap_type;
    00094
    00095 } // namespace mu
    00096
    00097 #endif
    00098