Description:
This is a generic base class for binary readers and writers. It provides support for a one byte buffer for handling individual bit I/O. It also has a number of I/O exception classes embedded in it.
Embedded Classes:
Interpreter::Exception, Interpreter::IOException, Interpreter::EOFException, Interpreter::HardwareException
Data Fields | ||
protected | unsigned char | bit_buffer |
protected | int | n_bits_in_buffer |
protected | int | bytes_per_int |
protected | int | bits_per_int |
Constructors / Destructor | |
public | Interpreter() |
Methods | |||
public | virtual | int | leftOverBits() |
protected | virtual | void | checkStream(ios* stream, const string& context)Check an istream or ostream for errors and throw the appropriate exception if there was one. |
public | static | void | checkIEEE()Check if this machine uses the stardard 4 and 8 byte IEEE representation for floats and doubles, respectively. Throws a HardwareException if the machine is not compliant. |
public | static | double | powerOf2(int power)Calculates 2 to some power and returns the result as a double. The result should be exact if the machine represents powers of two exactly. In other words it does a string of multiplications and does not use the exp() function. |
public | static | int | logBase2(double value, double* remainder=NULL) |
Operators |