hash.h
c-plus-plus
#ifndef __HASH_CIRCULARINCLUDEPROTECTION
#define __HASH_CIRCULARINCLUDEPROTECTION
#include <cstdlib>
#include <iostream>
template<class T>
class HashEntry{
private:
HashEntry<T> * next;
T data;
public:
HashEntry(T data);
void SetNext(HashEntry<T>* next);
T& Data();
HashEntry<T>* Next();
};
template<class T,unsigned n>
class Hash {
protected:
long actLine;
long lines;
HashEntry<T> * act;
HashEntry<T> ** rows;
long inserted;
long notinserted;
public:
Hash();
~Hash();
virtual unsigned h(const T &obj) const=0;
Hash & operator << (const T &obj);
unsigned operator + () const;
unsigned operator - () const;
const T * najit(const T &);
bool prvni();
const T & aktual();
bool dalsi();
};
#endif //__HASH_CIRCULARINCLUDEPROTECTION
Neformátovaný
Přidáno: 11.12.2012
Expirace: Neuvedeno