17 |
* Free Software Foundation, Inc., * |
* Free Software Foundation, Inc., * |
18 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
19 |
***************************************************************************/ |
***************************************************************************/ |
20 |
#ifndef SOLUTIONHASH_H |
#ifndef CONTAINERHASH_H |
21 |
#define SOLUTIONHASH_H |
#define CONTAINERHASH_H |
22 |
|
|
23 |
#include "solutioncontainer.h" |
#include "solutioncontainer.h" |
24 |
#include "solution.h" |
#include "solution.h" |
29 |
/** |
/** |
30 |
@author Torben Nielsen |
@author Torben Nielsen |
31 |
*/ |
*/ |
32 |
class SolutionHash : public SolutionContainer |
class ContainerHash : public SolutionContainer |
33 |
{ |
{ |
34 |
private: |
private: |
35 |
static const int max_size = 256; |
static const int max_size = 256; |
36 |
typedef std::list<Solution>::iterator ListIt; |
typedef std::list<Solution*>::iterator ListIt; |
37 |
typedef std::list<Solution> SolList; |
typedef std::list<Solution*> SolList; |
38 |
|
|
39 |
SolList* solutions[max_size]; |
SolList* solutions[max_size]; |
40 |
|
|
44 |
int m_size; |
int m_size; |
45 |
|
|
46 |
public: |
public: |
47 |
SolutionHash(GUIUpdate* update); |
ContainerHash(GUIUpdate* update); |
48 |
|
|
49 |
~SolutionHash(); |
~ContainerHash(); |
50 |
void uniqueSolutions(); |
void uniqueSolutions(); |
51 |
int numSolutions(); |
int numSolutions(); |
52 |
int totalSolutions(); |
int totalSolutions(); |
53 |
|
|
54 |
Solution solution(int index); |
Solution* solution(int index); |
55 |
void addSolution(Solution sol); |
void addSolution(Solution* sol); |
56 |
}; |
}; |
57 |
|
|
58 |
#endif |
#endif |