bcParserCPP 2.8
Math Parser for C++
Public Types | Public Member Functions
CNode< _ValueT > Class Template Reference

Generic node, base class for all nodes. More...

Inheritance diagram for CNode< _ValueT >:
CBasicNode< _ValueT > CNParamNode< _CharT, _ValueT > COneParamNode< _CharT, _ValueT > CTwoParamNode< _CharT, _ValueT > CUnknownVarNode< _CharT, _ValueT > CVarNode< _ValueT >

List of all members.

Public Types

enum  NODE_TYPE {
  BASIC, VARIABLE, ONEPARAM, TWOPARAM,
  NPARAM
}
 Node types. More...

Public Member Functions

virtual ~CNode ()
 Virtual destructor.
virtual _ValueT GetValue ()=0
 Return the value that this node evaluates to.
virtual BOOL IsUsed (void *Addr)=0
 Returns true if the variable or function whose address is given as a parameter used in this expression tree.
virtual void Optimize ()=0
 Optimize evaluates constant values at compile time.
virtual NODE_TYPE GetType ()=0
 Home made RTTI replacement.

Detailed Description

template<typename _ValueT>
class CNode< _ValueT >

Generic node, base class for all nodes.

Expression given by the user as a string is parsed and then is represented by a tree of CNode objects.


Member Enumeration Documentation

template<typename _ValueT >
enum CNode::NODE_TYPE

Node types.

Not to require RTTI.


Member Function Documentation

template<typename _ValueT >
virtual _ValueT CNode< _ValueT >::GetValue ( ) [pure virtual]

Return the value that this node evaluates to.

This method will typically trigger a cascade of GetValue() calls in the expression tree that it represents and it will return the resulting value.

Implemented in CBasicNode< _ValueT >, COneParamNode< _CharT, _ValueT >, CTwoParamNode< _CharT, _ValueT >, CNParamNode< _CharT, _ValueT >, CVarNode< _ValueT >, and CUnknownVarNode< _CharT, _ValueT >.

template<typename _ValueT >
virtual BOOL CNode< _ValueT >::IsUsed ( void *  Addr) [pure virtual]

Returns true if the variable or function whose address is given as a parameter used in this expression tree.

Returns false if it is not found.

Implemented in CBasicNode< _ValueT >, COneParamNode< _CharT, _ValueT >, CTwoParamNode< _CharT, _ValueT >, CNParamNode< _CharT, _ValueT >, CVarNode< _ValueT >, and CUnknownVarNode< _CharT, _ValueT >.

 All Classes Functions Variables Typedefs Enumerations