LayoutConfig Class Reference

Model class for space. More...

#include <layoutConfig.hpp>

Collaboration diagram for LayoutConfig:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LayoutConfig (int width, int height, int inputs, int outputs)
 Constructor.
virtual ~LayoutConfig ()
 Destructor.
bool cellChanged (int x, int y, bool assigningInput, bool assigningOuput, vector< coordinate > listInputs, vector< coordinate > listOutputs)
 Cell status change.
bool cellChanged (int x, int y, int status)
 Cell status change.
Grid getGrid ()
 Member accessor.
void setGrid (Grid newGrid)
int getWidth ()
 Member accessor.
int getHeight ()
 Member accessor.
int getInputs ()
 Member accessor.
int getOutputs ()
 Member accessor.
matrix getMatrix ()
 Member accessor.

Private Member Functions

bool findCoordinate (vector< coordinate > list, int x, int y)
 Coordinate finder.

Private Attributes

Grid grid
 The grid of the space.
int width
 Space width.
int height
 Space height.
int inputs
 Space inputs.
int outputs
 Space outputs.
int assignedInputs
 Space assigned inputs.
int assignedOutputs
 Space assigned outputs.

Detailed Description

Model class for space.

This class represents the model for an initial configuration. A grid and it's inputs and outputs.

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

Definition at line 42 of file layoutConfig.hpp.


Constructor & Destructor Documentation

LayoutConfig::LayoutConfig int  width,
int  height,
int  inputs,
int  outputs
 

Constructor.

Parameters:
width the space width.
height the space height.
inputs the space input number.
outputs the space output number.

Definition at line 31 of file layoutConfig.cpp.

References assignedInputs, and assignedOutputs.

LayoutConfig::~LayoutConfig  )  [virtual]
 

Destructor.

Definition at line 44 of file layoutConfig.cpp.


Member Function Documentation

bool LayoutConfig::cellChanged int  x,
int  y,
int  status
 

Cell status change.

The cell is changed to the given status directly.

Parameters:
x the x coordinate.
y te y coordinate.
status the new cell status.
Returns:
True iif the change was successful.

Definition at line 221 of file layoutConfig.cpp.

References assignedInputs, assignedOutputs, grid, nINPUT, and nOUTPUT.

bool LayoutConfig::cellChanged int  x,
int  y,
bool  assigningInput,
bool  assigningOutput,
vector< coordinate listInputs,
vector< coordinate listOutputs
 

Cell status change.

If all the inputs and outputs are already set we skip those states. It (de)assigns inputs and outputs if the assigning mode is on. If the cell is already assigned for another input/output does nothing. If the cell is already assigned for the current input it gets deassigned.

Parameters:
x x coordinate.
y y coordinate.
assigningInput true iif the assigning input mode is enabled.
assigningOutput true iif the assigning output mode is enabled.
listInputs coordinates of the assigned inputs.
listOutputs coordinates of the assigned outputs.
Returns:
True iif the change was successful.

Definition at line 64 of file layoutConfig.cpp.

References assignedInputs, assignedOutputs, findCoordinate(), grid, inputs, nDISABLED, nDONTCARE, nENABLED, nINPUT, nNOSPACE, nOUTPUT, and outputs.

Referenced by LayoutManager::cellChanged().

Here is the call graph for this function:

bool LayoutConfig::findCoordinate vector< coordinate list,
int  x,
int  y
[private]
 

Coordinate finder.

This method finds the given coordinate in a list. It's used to find assigned inputs and outputs.

Parameters:
list coordinate list to find in.
x x coordinate to be found.
y y coordinate to be found.

Definition at line 265 of file layoutConfig.cpp.

Referenced by cellChanged().

Grid LayoutConfig::getGrid  ) 
 

Member accessor.

Returns:
The grid of the space.

Definition at line 187 of file layoutConfig.cpp.

References grid.

Referenced by LayoutManager::newLayout(), SimulationManager::prepareSimulation(), LayoutDiskManager::saveLayout(), and LayoutManager::updateGrids().

int LayoutConfig::getHeight  ) 
 

Member accessor.

Returns:
The height of the space.

Definition at line 207 of file layoutConfig.cpp.

References height.

Referenced by LayoutDiskManager::saveLayout().

int LayoutConfig::getInputs  ) 
 

Member accessor.

Returns:
The input number of the space.

Definition at line 241 of file layoutConfig.cpp.

References inputs.

Referenced by LayoutManager::tablesChanged().

matrix LayoutConfig::getMatrix  ) 
 

Member accessor.

Returns:
the space grid in a matrix form.

Definition at line 282 of file layoutConfig.cpp.

References Grid::getCells(), and grid.

Referenced by SimulationManager::prepareSimulation(), and SimulationManager::simulateRow().

Here is the call graph for this function:

int LayoutConfig::getOutputs  ) 
 

Member accessor.

Returns:
The output number of the space.

Definition at line 251 of file layoutConfig.cpp.

References outputs.

Referenced by LayoutManager::tablesChanged().

int LayoutConfig::getWidth  ) 
 

Member accessor.

Returns:
The width of the space.

Definition at line 197 of file layoutConfig.cpp.

References width.

Referenced by LayoutDiskManager::saveLayout().

void LayoutConfig::setGrid Grid  newGrid  ) 
 


Member Data Documentation

int LayoutConfig::assignedInputs [private]
 

Space assigned inputs.

Definition at line 69 of file layoutConfig.hpp.

Referenced by cellChanged(), and LayoutConfig().

int LayoutConfig::assignedOutputs [private]
 

Space assigned outputs.

Definition at line 71 of file layoutConfig.hpp.

Referenced by cellChanged(), and LayoutConfig().

Grid LayoutConfig::grid [private]
 

The grid of the space.

Definition at line 59 of file layoutConfig.hpp.

Referenced by cellChanged(), getGrid(), and getMatrix().

int LayoutConfig::height [private]
 

Space height.

Definition at line 63 of file layoutConfig.hpp.

Referenced by getHeight().

int LayoutConfig::inputs [private]
 

Space inputs.

Definition at line 65 of file layoutConfig.hpp.

Referenced by cellChanged(), and getInputs().

int LayoutConfig::outputs [private]
 

Space outputs.

Definition at line 67 of file layoutConfig.hpp.

Referenced by cellChanged(), and getOutputs().

int LayoutConfig::width [private]
 

Space width.

Definition at line 61 of file layoutConfig.hpp.

Referenced by getWidth().


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