awips2/nativeLib/rary.ohd.ofs/inc/ConstExpr.h
root 7dbd17a5aa Initial revision of AWIPS2 11.9.0-7p5
Former-commit-id: 133dc97f67 [formerly a02aeb236c] [formerly 9f19e3f712] [formerly 133dc97f67 [formerly a02aeb236c] [formerly 9f19e3f712] [formerly 06a8b51d6d [formerly 9f19e3f712 [formerly 64fa9254b946eae7e61bbc3f513b7c3696c4f54f]]]]
Former-commit-id: 06a8b51d6d
Former-commit-id: 9bb8decbcf [formerly 8e80217e59] [formerly 377dcd10b9 [formerly 3360eb6c5f]]
Former-commit-id: 377dcd10b9
Former-commit-id: e2ecdcfe33
2012-01-06 08:55:05 -06:00

53 lines
1.8 KiB
C++

//------------------------------------------------------------------------------
// ConstExpr - base class for rules expressions.
//------------------------------------------------------------------------------
// Copyright: See the COPYRIGHT file.
//------------------------------------------------------------------------------
// Notes: (1)This class basically defines an interface for expressions.
//------------------------------------------------------------------------------
// History:
//
// 15 Jan 1998 Matthew J. Rutherford, Riverside Technology, inc
// Created initial version.
// 20 Feb 1998 MJR Added the verify function.
// 05 May 1998 MJR Added the copy() function.
//------------------------------------------------------------------------------
#ifndef ConstExpr_INCLUDED
#define ConstExpr_INCLUDED
#include "Expression.h"
class ConstExpr : public Expression
{
public:
ConstExpr( char* ); // Create a constant expression.
~ConstExpr(); // Destroy a constant expression.
Expression* copy(); // Copy the expression.
virtual double evaluate( ); // This will evaluate the expression.
// The integer will receive a flag that
// tells what the returned string
// contains (ie. BOOLEAN, VALUE,
// VARIABLE) so that the calling
// function can use this information
// to make some decision.
char* toString(); // Prints the constant as a string.
virtual int verify(); // Verifies that the constants do
// evalutate.
private:
void initialize(); // Initializes private data members.
char _constant[MAXC]; // String to hold constant or
// variable name.
double *_value; // The actual value of the constant.
int _is_local_value, // Flag to tell if the value in
// _value is allocated locally.
_is_verified; // Flag that gets set when an expression
// evaluates successfully.
};
#endif