Alphabetic Class Index   |   Class Inheritance Tree Index   |   Tool Index

Class: Interpreter

This is a base class.

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
protectedunsigned charbit_buffer
protectedintn_bits_in_buffer
protectedintbytes_per_int
protectedintbits_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.
Throws: Interpreter::IOException
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.
Throws: Interpreter::HardwareException
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


Alphabetic Class Index   |   Class Inheritance Tree Index   |   Tool Index