📄 valuelist.h
字号:
/******************************************************************************
文件名 :ValueList.h
版本号 : 1.0
作者 : Amos Peng
生成日期 :2008-07-08
最近修改 :
功能描述 :
函数列表 :
*******************************************************************************/
#ifndef _VALUELIST_H_
#define _VALUELIST_H_
// Includes
#include <string>
#include <vector>
#include <new>
#include <memory>
#include "Defines.h"
#include "ValueListItem.h"
#include "Except.h"
// Part of expreval namespace
namespace ExprEval
{
// Value list
//--------------------------------------------------------------------------
class CValueList
{
public:
typedef ::std::vector<CValueListItem*>::size_type size_type;
CValueList();
~CValueList();
// Add variable or constant to the list
void Add(const ::std::string &name, double def = 0.0, bool constant = false);
// Add an external variable or constant to the list
void AddAddress(const ::std::string &name, double *ptr, double def = 0.0, bool constant = false);
// Get the address of a variable or constant, internal or external
double *GetAddress(const ::std::string &name) const;
// Is the value constant
bool IsConstant(const ::std::string &name) const;
// Enumerate values
size_type Count() const;
void Item(size_type pos, ::std::string *name = 0, double *value = 0) const;
// Initialize some default values (math constants)
void AddDefaultValues();
// Reset items to default values (constants are not changed)
void Reset();
// Free items and clear memory
void Clear();
private:
::std::vector<CValueListItem*> m_values;
};
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -