#include <truthTable.hpp>
Public Member Functions | |
TruthTable (wxString name, int inputs, int outputs) | |
Constructor. | |
TruthTable () | |
Constructor. | |
virtual | ~TruthTable () |
Destructor. | |
vector< bool > | getOutput (vector< bool > input) |
Returns the outputs for a given input. | |
wxString | getOutput (wxString input) |
Returns the outputs of an input combination. | |
bool | getOutput (vector< bool > input, int output) |
Returns a concrete output of an input combination. | |
bool | getOutput (wxString input, int output) |
Returns a concrete output of an input combination. | |
wxString | getName () |
Returns the name of the table. | |
void | setOutput (vector< bool > input, vector< bool > output) |
Sets the output values for an input combination. | |
void | setOutput (wxString input, wxString output) |
Sets the output values for an input combination. | |
void | setName (wxString newName) |
Sets the name of the table. | |
void | setTable (vector< vector< bool > > table) |
Sets the table values. | |
int | getInputs () |
Returns the number of inputs of the table. | |
int | getOutputs () |
Returns the number of outputs of the table. | |
void | copyTable (TruthTable newTable) |
Copies the contents of a table. | |
vector< vector< bool > > | getTable () |
Returns the table. | |
Private Member Functions | |
int | getIndex (vector< bool >input) |
Maps an input combination to an index to access the table outputs. | |
int | getIndex (wxString input) |
Maps an input combination to an index to access the table outputs. | |
vector< bool > | stringToVector (wxString input) |
Converts a string to a vector. | |
wxString | vectorToString (vector< bool > input) |
Converts a vector to a string. | |
Private Attributes | |
wxString | name |
Truth table name. | |
int | inputs |
Truth table inputs. | |
int | outputs |
Truth table outputs. | |
vector< vector< bool > > | table |
This is a class representing a truth table.
Definition at line 36 of file truthTable.hpp.
|
Constructor.
Definition at line 31 of file truthTable.cpp. References table. |
|
Constructor. Builds an empty table. Definition at line 55 of file truthTable.cpp. |
|
Destructor.
Definition at line 63 of file truthTable.cpp. |
|
Copies the contents of a table.
Definition at line 270 of file truthTable.cpp. References getInputs(), getName(), getOutputs(), getTable(), inputs, name, outputs, and table. Referenced by TruthTableCanvas::setNewTable(). Here is the call graph for this function: ![]() |
|
Maps an input combination to an index to access the table outputs. It's a converter between decimal and binary sistems because this is the way the class it's implemented: the inputs are reproduced and the outputs are accessed using indexes.
Definition at line 198 of file truthTable.cpp. References getIndex(), and stringToVector(). Here is the call graph for this function: ![]() |
|
Maps an input combination to an index to access the table outputs. It's a converter between decimal and binary sistems because this is the way the class it's implemented: the inputs are reproduced and the outputs are accessed using indexes.
Definition at line 88 of file truthTable.cpp. Referenced by getIndex(), getOutput(), and setOutput(). |
|
Returns the number of inputs of the table.
Definition at line 120 of file truthTable.cpp. References inputs. Referenced by copyTable(), TruthTableCanvas::getInputsString(), TruthTableCanvas::getInputsVector(), TruthTableCanvas::getOutputs(), TruthTableCanvas::OnCellChanged(), TruthTableDiskManager::saveTable(), TruthTableCanvas::setNewTable(), and TruthTableCanvas::setTable(). |
|
Returns the name of the table.
Definition at line 283 of file truthTable.cpp. References name. Referenced by copyTable(), TruthTableManager::newTable(), SimulationManager::prepareSimulation(), and TruthTableDiskManager::saveTable(). |
|
Returns a concrete output of an input combination.
Definition at line 168 of file truthTable.cpp. References getOutput(), and stringToVector(). Here is the call graph for this function: ![]() |
|
Returns a concrete output of an input combination.
Definition at line 155 of file truthTable.cpp. References getOutput(). Here is the call graph for this function: ![]() |
|
Returns the outputs of an input combination.
Definition at line 141 of file truthTable.cpp. References getOutput(), stringToVector(), and vectorToString(). Here is the call graph for this function: ![]() |
|
Returns the outputs for a given input.
Definition at line 73 of file truthTable.cpp. References getIndex(), and table. Referenced by getOutput(), TruthTableCanvas::setTable(), and SimulationManager::verifyGrid(). Here is the call graph for this function: ![]() |
|
Returns the number of outputs of the table.
Definition at line 130 of file truthTable.cpp. References outputs. Referenced by copyTable(), TruthTableCanvas::getOutputs(), TruthTableDiskManager::saveTable(), and TruthTableCanvas::setNewTable(). |
|
Returns the table.
Definition at line 260 of file truthTable.cpp. References table. Referenced by copyTable(), and TruthTableDiskManager::saveTable(). |
|
Sets the name of the table.
Definition at line 293 of file truthTable.cpp. References name. |
|
Sets the output values for an input combination.
Definition at line 181 of file truthTable.cpp. References setOutput(), and stringToVector(). Here is the call graph for this function: ![]() |
|
Sets the output values for an input combination.
Definition at line 110 of file truthTable.cpp. References getIndex(), and table. Referenced by setOutput(). Here is the call graph for this function: ![]() |
|
Sets the table values.
Definition at line 303 of file truthTable.cpp. References table. |
|
Converts a string to a vector.
Definition at line 211 of file truthTable.cpp. Referenced by getIndex(), getOutput(), and setOutput(). |
|
Converts a vector to a string.
Definition at line 236 of file truthTable.cpp. Referenced by getOutput(). |
|
Truth table inputs.
Definition at line 60 of file truthTable.hpp. Referenced by copyTable(), getInputs(), and TruthTable(). |
|
Truth table name.
Definition at line 58 of file truthTable.hpp. Referenced by copyTable(), getName(), and setName(). |
|
Truth table outputs.
Definition at line 62 of file truthTable.hpp. Referenced by copyTable(), getOutputs(), and TruthTable(). |
|
Definition at line 63 of file truthTable.hpp. Referenced by copyTable(), getOutput(), getTable(), setOutput(), setTable(), and TruthTable(). |