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" |
25 |
|
|
26 |
#include <list> |
#include <list> |
27 |
|
#include <boost/shared_ptr.hpp> |
28 |
|
|
29 |
|
|
30 |
|
|
31 |
/** |
/** |
32 |
@author Torben Nielsen |
@author Torben Nielsen |
33 |
*/ |
*/ |
34 |
class SolutionHash : public SolutionContainer |
class ContainerHash : public SolutionContainer |
35 |
{ |
{ |
36 |
private: |
private: |
37 |
static const int max_size = 256; |
static const int max_size = 256; |
38 |
typedef std::list<Solution>::iterator ListIt; |
typedef std::list< boost::shared_ptr<Solution> >::iterator ListIt; |
39 |
typedef std::list<Solution> SolList; |
typedef std::list< boost::shared_ptr<Solution> > SolList; |
40 |
|
|
41 |
SolList* solutions[max_size]; |
SolList* solutions[max_size]; |
42 |
|
|
46 |
int m_size; |
int m_size; |
47 |
|
|
48 |
public: |
public: |
49 |
SolutionHash(GUIUpdate* update); |
ContainerHash(GUIUpdate* update); |
50 |
|
|
51 |
~SolutionHash(); |
~ContainerHash(); |
52 |
void uniqueSolutions(); |
void uniqueSolutions(); |
53 |
int numSolutions(); |
int numSolutions(); |
54 |
int totalSolutions(); |
int totalSolutions(); |
55 |
|
|
56 |
Solution solution(int index); |
Solution* solution(int index); |
57 |
void addSolution(Solution sol); |
void addSolution(Solution* sol); |
58 |
}; |
}; |
59 |
|
|
60 |
#endif |
#endif |