TruthTableDiskManager Class Reference

Data persistace class for the truth tables. More...

#include <truthTableDiskManager.hpp>

Collaboration diagram for TruthTableDiskManager:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TruthTableDiskManager (TruthTableManager *controller)
 Constructor.
virtual ~TruthTableDiskManager ()
 Destructor.
bool saveTables (list< TruthTable * > tables, wxString fileName)
 Saves the table collection to a file.
bool openTables (wxString fileName)
 Opens a truth table file.

Private Member Functions

bool saveTableList (list< TruthTable * > tables)
 Saves a table list to the file.
bool saveTable (TruthTable *table)
 Saves a table to the file.
bool saveVector (vector< vector< bool > > booleans)
 Saves a boolean vector to the file.
bool readTable (wxString name, int inputs, int outputs, list< TruthTable * > *tableList, FlexLexer *lexer)
 Reads a truth table from a stream.
void returnTables (list< TruthTable * > *tableList)
 Returns the tables to the controller.

Private Attributes

TruthTableManagercontroller
 Truth table controller.
wxTextFile file
 Text file to be written/read.

Detailed Description

Data persistace class for the truth tables.

The data persistance class for the truth tables.

Author:
Bernat Rāfales Mulet <the_bell@users.sourceforge.net>
Version:
Revision
1.5

Definition at line 43 of file truthTableDiskManager.hpp.


Constructor & Destructor Documentation

TruthTableDiskManager::TruthTableDiskManager TruthTableManager controller  ) 
 

Constructor.

Parameters:
controller the truth table controller.

Definition at line 30 of file truthTableDiskManager.cpp.

References controller.

TruthTableDiskManager::~TruthTableDiskManager  )  [virtual]
 

Destructor.

Definition at line 37 of file truthTableDiskManager.cpp.


Member Function Documentation

bool TruthTableDiskManager::openTables wxString  fileName  ) 
 

Opens a truth table file.

Parameters:
fileName the file containing the truth tables.
Returns:
True iif the file was opened correctly.

Definition at line 138 of file truthTableDiskManager.cpp.

References IDENTIFIER, LOWER, NUMBER, readTable(), FlexLexer::switch_streams(), UPPER, yyFlexLexer, FlexLexer::yylex(), and FlexLexer::YYText().

Referenced by TruthTableManager::appendTables(), and TruthTableManager::openPFile().

Here is the call graph for this function:

bool TruthTableDiskManager::readTable wxString  name,
int  inputs,
int  outputs,
list< TruthTable * > *  tableList,
FlexLexer lexer
[private]
 

Reads a truth table from a stream.

Parameters:
name the table name.
inputs the table input number.
outputs the table output number.
tableList list of tables were the table read has to be appended.
lexer the input stream.
Returns:
True iif the table was read correctly.

Definition at line 225 of file truthTableDiskManager.cpp.

References NUMBER, FlexLexer::yylex(), and FlexLexer::YYText().

Referenced by openTables().

Here is the call graph for this function:

void TruthTableDiskManager::returnTables list< TruthTable * > *  tableList  )  [private]
 

Returns the tables to the controller.

Parameters:
tableList the list of tables to return.

Definition at line 274 of file truthTableDiskManager.cpp.

References controller, and TruthTableManager::newTable().

Here is the call graph for this function:

bool TruthTableDiskManager::saveTable TruthTable table  )  [private]
 

Saves a table to the file.

Parameters:
table table to be saved.
Returns:
True iif the table was saved correctly.

Definition at line 98 of file truthTableDiskManager.cpp.

References file, TruthTable::getInputs(), TruthTable::getName(), TruthTable::getOutputs(), TruthTable::getTable(), and saveVector().

Referenced by saveTableList().

Here is the call graph for this function:

bool TruthTableDiskManager::saveTableList list< TruthTable * >  tables  )  [private]
 

Saves a table list to the file.

Parameters:
tables the table list.
Returns:
True iif the table list was saved correctly.

Definition at line 78 of file truthTableDiskManager.cpp.

References file, and saveTable().

Referenced by saveTables().

Here is the call graph for this function:

bool TruthTableDiskManager::saveTables list< TruthTable * >  tables,
wxString  fileName
 

Saves the table collection to a file.

Parameters:
tables the table collection.
fileName the file name to be saved.
Returns:
True iif the tables were saved correctly.

Definition at line 48 of file truthTableDiskManager.cpp.

References file, and saveTableList().

Referenced by TruthTableManager::saveFile().

Here is the call graph for this function:

bool TruthTableDiskManager::saveVector vector< vector< bool > >  booleans  )  [private]
 

Saves a boolean vector to the file.

Parameters:
booleans the boolean vector to save.
Returns:
True iif the vector was saved correctly.

Definition at line 113 of file truthTableDiskManager.cpp.

References file.

Referenced by saveTable().


Member Data Documentation

TruthTableManager* TruthTableDiskManager::controller [private]
 

Truth table controller.

Definition at line 53 of file truthTableDiskManager.hpp.

Referenced by returnTables(), and TruthTableDiskManager().

wxTextFile TruthTableDiskManager::file [private]
 

Text file to be written/read.

Definition at line 55 of file truthTableDiskManager.hpp.

Referenced by saveTable(), saveTableList(), saveTables(), and saveVector().


The documentation for this class was generated from the following files:
Generated on Sat Sep 2 00:01:20 2006 for NanoComp by  doxygen 1.4.6