Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Engine Class Reference

#include </home/clem/local/src/opie/noncore/tools/calc2/main/engine.h>

Collaboration diagram for Engine:

Collaboration graph
[legend]
List of all members.

Signals

void display (const QString &)
void display (double)
void setHexMode ()
void setBinMode ()
void setDecMode ()
void setOctMode ()

Public Member Functions

 Engine (QWidget *parent=0, const char *name=0)
 ~Engine ()
void immediateInstruction (Instruction *)
void pushInstruction (Instruction *)
void eval ()
void pushValue (char)
void del ()
void openBrace ()
void closeBrace ()
void softReset ()
void hardReset ()
void memSave ()
void memRecall ()
void memClear ()
void setRepresentation (Representation)
void decBraces (void)

Private Member Functions

void displayData (Data d)
void clearData (Data *d)
int calcBase ()
Data evalStack (Data, bool)

Private Attributes

Data num
Data mem
State state
QStack< Instructionstack
Representation currentRep
int braces
int decimalPlaces
QString displayString

Constructor & Destructor Documentation

Engine::Engine QWidget *  parent = 0,
const char *  name = 0
[inline]
 

Definition at line 41 of file engine.h.

References hardReset(), rDec, and setRepresentation().

Engine::~Engine  )  [inline]
 

Definition at line 46 of file engine.h.


Member Function Documentation

int Engine::calcBase  )  [private]
 

Definition at line 170 of file engine.cpp.

References currentRep, odebug, oendl, rBin, rDec, rHex, rOct, sError, and state.

Referenced by del(), displayData(), and pushValue().

void Engine::clearData Data d  )  [private]
 

Definition at line 217 of file engine.cpp.

References Data::dbl, Data::Fraction::denominator, Data::fraction, Data::i, and Data::Fraction::numerator.

Referenced by evalStack(), memClear(), setRepresentation(), and softReset().

void Engine::closeBrace  ) 
 

Definition at line 205 of file engine.cpp.

References braces, evalStack(), num, and TRUE.

void Engine::decBraces void   )  [inline]
 

Definition at line 87 of file engine.h.

References braces.

Referenced by iOpenBrace::eval().

void Engine::del  ) 
 

Definition at line 128 of file engine.cpp.

References calcBase(), currentRep, Data::dbl, display(), displayString, Data::i, QString::length(), num, odebug, oendl, rDouble, rFraction, sError, state, QString::toDouble(), QString::toInt(), and QString::truncate().

void Engine::display double   )  [signal]
 

void Engine::display const QString  )  [signal]
 

Referenced by del(), displayData(), and pushValue().

void Engine::displayData Data  d  )  [private]
 

Definition at line 153 of file engine.cpp.

References calcBase(), currentRep, Data::dbl, display(), displayString, Data::i, odebug, oendl, rDouble, rFraction, and QString::setNum().

Referenced by eval(), immediateInstruction(), memRecall(), and softReset().

void Engine::eval  ) 
 

Definition at line 63 of file engine.cpp.

References braces, displayData(), evalStack(), num, sError, sStart, and state.

Referenced by FormSimpleImpl::evalClicked().

Data Engine::evalStack Data  ,
bool 
[private]
 

Definition at line 33 of file engine.cpp.

References Instruction::acc, braces, clearData(), Data::dbl, Instruction::eval(), i, odebug, oendl, Instruction::precedence, sError, stack, and state.

Referenced by closeBrace(), and eval().

void Engine::hardReset  )  [inline]
 

Definition at line 64 of file engine.h.

References braces, memClear(), softReset(), and stack.

Referenced by FormSimpleImpl::CEClicked(), and Engine().

void Engine::immediateInstruction Instruction  ) 
 

Definition at line 74 of file engine.cpp.

References currentRep, displayData(), Instruction::eval(), num, sError, Instruction::setRep(), sStart, and state.

Referenced by FormBinaryImpl::LSHClicked(), FormBinaryImpl::NOTClicked(), and FormBinaryImpl::RSHClicked().

void Engine::memClear  )  [inline]
 

Definition at line 79 of file engine.h.

References clearData(), and mem.

Referenced by hardReset(), and FormSimpleImpl::MCClicked().

void Engine::memRecall  )  [inline]
 

Definition at line 74 of file engine.h.

References displayData(), mem, num, sStart, and state.

Referenced by FormSimpleImpl::MRClicked().

void Engine::memSave  )  [inline]
 

Definition at line 71 of file engine.h.

References mem, and num.

Referenced by FormSimpleImpl::MPlusClicked().

void Engine::openBrace  ) 
 

Definition at line 201 of file engine.cpp.

References pushInstruction().

void Engine::pushInstruction Instruction  ) 
 

Definition at line 84 of file engine.cpp.

References Instruction::acc, currentRep, num, sError, Instruction::setRep(), sStart, stack, and state.

Referenced by FormSimpleImpl::addClicked(), FormBinaryImpl::ANDClicked(), FormSimpleImpl::divClicked(), FormSimpleImpl::mulClicked(), openBrace(), FormBinaryImpl::ORClicked(), FormSimpleImpl::subClicked(), and FormBinaryImpl::XORClicked().

void Engine::pushValue char   ) 
 

Definition at line 94 of file engine.cpp.

References QString::append(), calcBase(), currentRep, Data::dbl, display(), displayString, FALSE, Data::i, num, odebug, oendl, rDouble, rFraction, sAppend, sError, softReset(), sStart, state, QString::toDouble(), QString::toInt(), and QString::truncate().

Referenced by FormSimpleImpl::decimalClicked(), FormBinaryImpl::val0Clicked(), FormSimpleImpl::val0Clicked(), FormBinaryImpl::val1Clicked(), FormSimpleImpl::val1Clicked(), FormSimpleImpl::val2Clicked(), FormSimpleImpl::val3Clicked(), FormSimpleImpl::val4Clicked(), FormSimpleImpl::val5Clicked(), FormSimpleImpl::val6Clicked(), FormSimpleImpl::val7Clicked(), FormSimpleImpl::val8Clicked(), and FormSimpleImpl::val9Clicked().

void Engine::setBinMode  )  [signal]
 

void Engine::setDecMode  )  [signal]
 

void Engine::setHexMode  )  [signal]
 

void Engine::setOctMode  )  [signal]
 

void Engine::setRepresentation Representation   ) 
 

Definition at line 210 of file engine.cpp.

References clearData(), currentRep, mem, num, sStart, and state.

Referenced by Engine(), FormBinaryImpl::FormBinaryImpl(), and FormSimpleImpl::FormSimpleImpl().

void Engine::softReset  )  [inline]
 

Definition at line 58 of file engine.h.

References clearData(), decimalPlaces, displayData(), num, sStart, and state.

Referenced by hardReset(), and pushValue().


Member Data Documentation

int Engine::braces [private]
 

Definition at line 98 of file engine.h.

Referenced by closeBrace(), decBraces(), eval(), evalStack(), and hardReset().

Representation Engine::currentRep [private]
 

Definition at line 97 of file engine.h.

Referenced by calcBase(), del(), displayData(), immediateInstruction(), pushInstruction(), pushValue(), and setRepresentation().

int Engine::decimalPlaces [private]
 

Definition at line 98 of file engine.h.

Referenced by softReset().

QString Engine::displayString [private]
 

Definition at line 99 of file engine.h.

Referenced by del(), displayData(), and pushValue().

Data Engine::mem [private]
 

Definition at line 94 of file engine.h.

Referenced by memClear(), memRecall(), memSave(), and setRepresentation().

Data Engine::num [private]
 

Definition at line 94 of file engine.h.

Referenced by closeBrace(), del(), eval(), immediateInstruction(), memRecall(), memSave(), pushInstruction(), pushValue(), setRepresentation(), and softReset().

QStack< Instruction > Engine::stack [private]
 

Definition at line 96 of file engine.h.

Referenced by evalStack(), hardReset(), and pushInstruction().

State Engine::state [private]
 

Definition at line 95 of file engine.h.

Referenced by calcBase(), del(), eval(), evalStack(), immediateInstruction(), memRecall(), pushInstruction(), pushValue(), setRepresentation(), and softReset().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:32:04 2005 for OPIE by  doxygen 1.4.2