mynode.h

来自「支持简单的公式推导」· C头文件 代码 · 共 45 行

H
45
字号
#ifndef __UNKNOWNFACTOR_H__
#define __UNKNOWNFACTOR_H__

#include "tdafx.h"
#include "operand.h"



class Node : public Operand
{
public:
	                         
	Node(const string& name);
	Node(double c = 0);
	Node(const Operand& o);
	~Node();
	
    virtual bool operator<(const Node& in)const;

public:                     //inline
	
    
	virtual string GetExpression()const{return expression_;}
	double GetSingleValue()const{return value_;}
    double GetNodeValue()const{return value_;}
	virtual bool IsConst()const{return is_const_;}
    
private:
    const double value_;
	const string expression_;
	const bool is_const_;
	
    //void SetValue(double in){value_ = in; is_const_ = true;expression_.erase();}
    //不如认为Node是不能更改的 
	//唯有替换的方式实现间接修改!!!
	
};







#endif //__UNKNOWNFACTOR_H__

⌨️ 快捷键说明

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