Canola  0.8.D001
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions
calculator_test Class Reference

#include <test.h>

Inheritance diagram for calculator_test:
calculator

List of all members.

Public Member Functions

virtual ~calculator_test ()
void on_error_v (const char *fmt, va_list ap)
void run (void)

Static Public Member Functions

static pointer create (void)

Protected Member Functions

void derived_print (const display &value)
void derived_feed (void)
void derived_off (void)
void derived_update_display (const display &value)
void clock_tick_start_running (void)
void printer_timer_start_running (void)
void on_opcode (opcode_t op, const location::pointer &where)

Private Member Functions

 calculator_test ()
 calculator_test (const calculator_test &rhs)
calculator_testoperator= (const calculator_test &rhs)

Detailed Description

The calculator_test class is used to represent a kind of calculator than can be used for automatic tests.

Definition at line 27 of file test.h.


Constructor & Destructor Documentation

The destructor.

Definition at line 28 of file test.cc.

The default constructor. It is private on purpose, use the create class method instead.

Definition at line 33 of file test.cc.

The copy constructor. Do not use.

Parameters:
rhsThe right hand side of the initialization.

Member Function Documentation

void calculator_test::clock_tick_start_running ( void  ) [protected, virtual]

The clock_tick_start_running method is called by the calculator to inform the derived class that it should kick off a clock tick idle handler. This will happen when opcode_extended_start is seen, for example. Derived classes should not assume when clocks stop and start, instend they will be explicitly informed via this method.

Implements calculator.

Definition at line 344 of file test.cc.

The create class method is used to create new dynamically allocated instance of this class.

Definition at line 39 of file test.cc.

void calculator_test::derived_feed ( void  ) [protected, virtual]

The derived_feed method is used to implement the FD opcode, in the cases where it is valid.

Implements calculator.

Definition at line 300 of file test.cc.

void calculator_test::derived_off ( void  ) [protected, virtual]

The derived_off method is used to implement the OFF key.

Implements calculator.

Definition at line 331 of file test.cc.

void calculator_test::derived_print ( const display value) [protected, virtual]

The derived_print method is used to implement the PRINT opcode, in the cases where it is valid.

Parameters:
valueThe value to be printed.
Note:
FIXME: this will not serve, once we start printing program listings.

Implements calculator.

Definition at line 46 of file test.cc.

void calculator_test::derived_update_display ( const display value) [protected, virtual]

The derived_update_display method is used when interpreting opcodes to indicate that the display needs to be updated to track the calculator's internal state.

Parameters:
valueThe value to be displayed by the calculator display.

Implements calculator.

Definition at line 338 of file test.cc.

void calculator_test::on_error_v ( const char *  fmt,
va_list  ap 
) [virtual]

Implements calculator.

Definition at line 307 of file test.cc.

void calculator_test::on_opcode ( opcode_t  op,
const location::pointer where 
) [protected, virtual]

The on_opcode method is used to process a key that corresponds to an opcode. This is most of the keys on the keyboard, but none of the controls above the keys.

The actual interpretation of the key depends on several different state paramaters withing the calculator, including: operation mode (LRN, OPE, etc) whether there is a tilde key pending, etc.

Parameters:
opThe opcode to be processed
whereThe source code location of the opcode (or NULL if not available)

Reimplemented from calculator.

Definition at line 356 of file test.cc.

calculator_test& calculator_test::operator= ( const calculator_test rhs) [private]

The assignment operator. Do not use.

Parameters:
rhsThe right hand side of the assignment.
void calculator_test::printer_timer_start_running ( void  ) [protected, virtual]

The printer_timer_start_running method is called by the calculator to inform the derived class that it should kick off a printer delay 420ms timer. This will happen when opcode_print or opcode_feed opcode is seen. Derived classes should not assume when printer delays stop and start, instend they will be explicitly informed via this method.

Implements calculator.

Definition at line 350 of file test.cc.

void calculator_test::run ( void  ) [virtual]

The run method is used to run the calculator, from interactive input, via the GUI, or equivalent.

Implements calculator.

Definition at line 315 of file test.cc.


The documentation for this class was generated from the following files: