functionlist.h

来自「表达式计算expression evaluate expression eval」· C头文件 代码 · 共 60 行

H
60
字号
/******************************************************************************
文件名          :FunctionList.h
版本号          : 1.0
作者            : Amos Peng
生成日期        :2008-07-08
最近修改        :
功能描述        :自定义函数列表
函数列表        :

*******************************************************************************/
#ifndef _FUNCTIONLIST_H_
#define _FUNCTIONLIST_H_

// Includes
#include <string>
#include <vector>
#include <new>
#include "Except.h"
#include "Nodes.h"
#include "FunctionFactory.h"


// Part of expreval namespace
namespace ExprEval
{
    // Forward declarations
    class CFunctionNode;
    class CExpression;
            
    // Function list
    //--------------------------------------------------------------------------
    class CFunctionList
    {
        public:
            typedef ::std::vector<CFunctionFactory*>::size_type size_type;
                
            CFunctionList();
            ~CFunctionList();
        
            // Add a function factory to the list
            void Add(CFunctionFactory *factory);
        
            // Create a node for a function
            CFunctionNode *Create(const ::std::string &name, CExpression *expr);
        
            // Initialize default functions
            void AddDefaultFunctions();
        
            // Free items and clear memory
            void Clear();
    
        private:
            ::std::vector<CFunctionFactory*> m_functions;
    };
        
}

#endif // __EXPREVAL_FUNCLIST_H

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?