OpendTect-6_4  6.4
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Math::Expression Class Referenceabstract

Parsed Math expression. More...

Public Types

enum  VarType { Variable, Constant, Recursive }
 

Public Member Functions

virtual double getValue () const =0
 
virtual int nrVariables () const
 
virtual const char * fullVariableExpression (int) const
 
virtual void setVariableValue (int, double)
 
int nrUniqueVarNames () const
 
const char * uniqueVarName (int idx) const
 
int indexOfUnVarName (const char *nm) const
 
int firstOccurVarName (const char *) const
 
VarType getType (int varidx) const
 
int getConstIdx (int varidx) const
 
bool isRecursive () const
 
virtual Expressionclone () const =0
 
virtual ~Expression ()
 
const char * type () const
 
void dump (BufferString &str) const
 

Protected Member Functions

 Expression (int nrinputs)
 
int nrInputs () const
 
bool setInput (int, Expression *)
 
void copyInput (Expression *target) const
 
void addIfOK (const char *)
 
void doDump (BufferString &, int nrtabs) const
 
virtual void dumpSpecifics (BufferString &, int nrtabs) const
 

Protected Attributes

ObjectSet< TypeSet< int > > variableobj_
 
ObjectSet< TypeSet< int > > variablenr_
 
ObjectSet< Expressioninputs_
 
BufferStringSet varnms_
 
bool isrecursive_
 

Friends

class ExpressionParser
 

Detailed Description

Parsed Math expression.

A Expression can be queried about its variables with getNrVariables(), and each variable's name can be queried with getVariableStr( int ).

When a calculations should be done, all variables must be set with setVariable( int, double ). Then, the calculation can be done with getValue().

Member Enumeration Documentation

Enumerator
Variable 
Constant 
Recursive 

Constructor & Destructor Documentation

virtual Math::Expression::~Expression ( )
virtual
Math::Expression::Expression ( int  nrinputs)
protected

Member Function Documentation

void Math::Expression::addIfOK ( const char *  )
protected
virtual Expression* Math::Expression::clone ( ) const
pure virtual
void Math::Expression::copyInput ( Expression target) const
protected
void Math::Expression::doDump ( BufferString ,
int  nrtabs 
) const
protected
void Math::Expression::dump ( BufferString str) const
inline
virtual void Math::Expression::dumpSpecifics ( BufferString ,
int  nrtabs 
) const
inlineprotectedvirtual
int Math::Expression::firstOccurVarName ( const char *  ) const
virtual const char* Math::Expression::fullVariableExpression ( int  ) const
virtual
int Math::Expression::getConstIdx ( int  varidx) const
VarType Math::Expression::getType ( int  varidx) const
virtual double Math::Expression::getValue ( ) const
pure virtual
int Math::Expression::indexOfUnVarName ( const char *  nm) const
inline
bool Math::Expression::isRecursive ( ) const
inline
int Math::Expression::nrInputs ( ) const
inlineprotected
int Math::Expression::nrUniqueVarNames ( ) const
inline
virtual int Math::Expression::nrVariables ( ) const
virtual
bool Math::Expression::setInput ( int  ,
Expression  
)
protected
virtual void Math::Expression::setVariableValue ( int  ,
double   
)
virtual
const char* Math::Expression::type ( ) const
const char* Math::Expression::uniqueVarName ( int  idx) const
inline

Friends And Related Function Documentation

friend class ExpressionParser
friend

Member Data Documentation

ObjectSet<Expression> Math::Expression::inputs_
protected
bool Math::Expression::isrecursive_
protected
ObjectSet<TypeSet<int> > Math::Expression::variablenr_
protected
ObjectSet<TypeSet<int> > Math::Expression::variableobj_
protected
BufferStringSet Math::Expression::varnms_
protected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019