LayoutDiskManager Class Reference

Data persistance class for spaces. More...

#include <layoutDiskManager.hpp>

Collaboration diagram for LayoutDiskManager:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LayoutDiskManager (LayoutManager *controller)
 Constructor.
virtual ~LayoutDiskManager ()
 Destructor.
bool saveLayout (LayoutConfig *layoutConfig, wxString fileName)
 Saves a space into a file.
bool openLayout (wxString fileName)
 Opens a space file.

Private Member Functions

LayoutConfigreadLayout (int width, int height, FlexLexer *lexer)
 Reads a space from a lexer.
bool saveLayout (LayoutConfig *layoutConfig)
 Saves a space.
bool saveGrid (Grid grid)
 Saves a grid.
void returnLayout (LayoutConfig *layoutConfig)
 Returns a space to the controller.

Private Attributes

LayoutManagercontroller
 Space controller.
wxTextFile file
 File to be written/read.

Detailed Description

Data persistance class for spaces.

This class manages all the data persistance of space files.

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

Definition at line 41 of file layoutDiskManager.hpp.


Constructor & Destructor Documentation

LayoutDiskManager::LayoutDiskManager LayoutManager controller  ) 
 

Constructor.

Parameters:
controller the space controller.

Definition at line 29 of file layoutDiskManager.cpp.

References controller.

LayoutDiskManager::~LayoutDiskManager  )  [virtual]
 

Destructor.

Definition at line 36 of file layoutDiskManager.cpp.


Member Function Documentation

bool LayoutDiskManager::openLayout wxString  fileName  ) 
 

Opens a space file.

Parameters:
fileName the file to be opened.
Returns:
True iif the file was correctly opened.

Definition at line 178 of file layoutDiskManager.cpp.

References NUMBER, readLayout(), FlexLexer::switch_streams(), yyFlexLexer, FlexLexer::yylex(), and FlexLexer::YYText().

Referenced by LayoutManager::openPFile().

Here is the call graph for this function:

LayoutConfig * LayoutDiskManager::readLayout int  width,
int  height,
FlexLexer lexer
[private]
 

Reads a space from a lexer.

This method reads a width*height space from the lexer.

Parameters:
width expected width of the space to be read.
height expected height of the space to be read.
lexer lexer containing the stream where to read.
Returns:
The space read. NULL if the space couldn't be read.

Definition at line 245 of file layoutDiskManager.cpp.

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

Referenced by openLayout().

Here is the call graph for this function:

void LayoutDiskManager::returnLayout LayoutConfig layoutConfig  )  [private]
 

Returns a space to the controller.

Parameters:
layoutConfig the space to be added.

Definition at line 325 of file layoutDiskManager.cpp.

References controller, and LayoutManager::newLayout().

Here is the call graph for this function:

bool LayoutDiskManager::saveGrid Grid  grid  )  [private]
 

Saves a grid.

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

Definition at line 101 of file layoutDiskManager.cpp.

References CELL_SPACE, Grid::getHeight(), Grid::getWidth(), line, nDISABLED, nDONTCARE, nENABLED, nINPUT, nNOSPACE, and nOUTPUT.

Referenced by saveLayout().

Here is the call graph for this function:

bool LayoutDiskManager::saveLayout LayoutConfig layoutConfig  )  [private]
 

Saves a space.

The space is saved to the corresponding file previously opened.

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

Definition at line 79 of file layoutDiskManager.cpp.

References file, LayoutConfig::getGrid(), LayoutConfig::getHeight(), LayoutConfig::getWidth(), and saveGrid().

Here is the call graph for this function:

bool LayoutDiskManager::saveLayout LayoutConfig layoutConfig,
wxString  fileName
 

Saves a space into a file.

Parameters:
layoutConfig space to be saved.
fileName the file name where to save.
Returns:
True iif the space was correctly saved.

Definition at line 47 of file layoutDiskManager.cpp.

References file.

Referenced by LayoutManager::saveFile(), LayoutManager::saveFileAs(), and LayoutManager::saveFilename().


Member Data Documentation

LayoutManager* LayoutDiskManager::controller [private]
 

Space controller.

Definition at line 51 of file layoutDiskManager.hpp.

Referenced by LayoutDiskManager(), and returnLayout().

wxTextFile LayoutDiskManager::file [private]
 

File to be written/read.

Definition at line 53 of file layoutDiskManager.hpp.

Referenced by saveLayout().


The documentation for this class was generated from the following files:
Generated on Fri Sep 1 23:57:47 2006 for NanoComp by  doxygen 1.4.6