home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
oct93
/
graphics
/
graphtal.lha
/
Graphtal
/
Value.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-11-20
|
2KB
|
84 lines
/*
* Value.h - definition for value class, which stores real and string
* values.
*
* Copyright (C) 1992, Christoph Streit (streit@iam.unibe.ch)
* University of Berne, Switzerland
* Portions Copyright (C) 1990, Jonathan P. Leech
* All rights reserved.
*
* This software may be freely copied, modified, and redistributed
* provided that this copyright notice is preserved on all copies.
*
* You may not distribute this software, in whole or in part, as part of
* any commercial product without the express consent of the authors.
*
* There is no warranty or other guarantee of fitness of this software
* for any purpose. It is provided solely "as is".
*
*/
#ifndef Value_H
# define Value_H
#include <iostream.h>
#include "rcString.h"
#include "mathutilities.h"
//___________________________________________________________ Value
enum ValueType { REAL, STRING };
enum ArgumentType { RR, RS, SR, SS, UNKNOWN };
class Value
{
public:
Value();
Value(real);
Value(const char*);
Value(const rcString&);
Value(const Value&);
~Value();
const Value& operator=(const Value&);
operator real() const;
operator rcString() const;
int toReal(real&) const;
rcString toString() const;
Value operator-();
Value operator+(const Value&);
Value operator-(const Value&);
Value operator*(const Value&);
Value operator/(const Value&);
Value operator%(const Value&);
Value operator!();
Value operator&&(const Value&);
Value operator||(const Value&);
Value operator==(const Value&);
Value operator!=(const Value&);
Value operator< (const Value&);
Value operator<=(const Value&);
Value operator> (const Value&);
Value operator>=(const Value&);
friend ostream& operator<< (ostream&, const Value&);
private:
ValueType type;
union {
real realVal;
rcString* stringVal;
};
ArgumentType binary_type(const Value&);
};
typedef Value* ValuePtr;
#endif // Value_H