text cover

Data Abstraction and Problem Solving with C++

Walls and Mirrors

by Frank M. Carrano

Addison Wesley Logo

Board Class Reference

#include <Board.h>

List of all members.


Detailed Description

The Board class.

Definition at line 30 of file Board.h.

Public Member Functions

 Board ()
 ~Board ()
void clear ()
void display () const
void doEightQueens ()
int getNumQueens () const
const QueengetQueen (int index) const

Private Member Functions

bool isQueen (int inRow, int inCol) const
bool placeQueens (Queen *queenPtr)
void removeQueen ()
void setQueen (const Queen *queenPtr)

Private Attributes

vector< const Queen * > queens


Constructor & Destructor Documentation

Board::Board  ) 
 

Supplies the Queen class with a pointer to the board.

Board::~Board  ) 
 

Clears the board and removes pointer from queens.


Member Function Documentation

void Board::clear  ) 
 

Clears board.

void Board::display  )  const
 

Displays board.

void Board::doEightQueens  ) 
 

Initiates the Eight Queens problem.

int Board::getNumQueens  )  const
 

Returns:
The number of queens on the board.

const Queen* Board::getQueen int  index  )  const
 

Returns:
A pointer to the queen at the designated index.

bool Board::isQueen int  inRow,
int  inCol
const [private]
 

Determines whether there is a queen in position (inRow, inCol).

bool Board::placeQueens Queen queenPtr  )  [private]
 

Attempts to place queens on board starting with the designated queen.

Definition at line 16 of file placeQueens.cpp.

References BOARD_SIZE, and Queen::getCol().

void Board::removeQueen  )  [private]
 

Removes the last queen on the board, but does not delete it.

void Board::setQueen const Queen queenPtr  )  [private]
 

Places a queen on the board.


Member Data Documentation

vector<const Queen *> Board::queens [private]
 

Array of queens on the board.

Definition at line 70 of file Board.h.


The documentation for this class was generated from the following files:

Generated on Sun Aug 27 13:27:58 2006 for AWLogo by  doxygen 1.4.6