I'm newbie in C++ programming and I want to declare a constructor from following code in my main however I'm completely confused about it. Here is the code:
#include <vector>
using namespace std;
template <typename HashedObj>
class HashTable
{
public:
explicit HashTable( const HashedObj & notFound, int size = 101 );
HashTable( const HashTable & rhs )
: ITEM_NOT_FOUND( rhs.ITEM_NOT_FOUND ),
array( rhs.array ), currentSize( rhs.currentSize ) { }
const HashedObj & find( const HashedObj & x ) const;
void makeEmpty( );
void insert( const HashedObj & x );
void remove( const HashedObj & x );
const HashTable & operator=( const HashTable & rhs );
enum EntryType { ACTIVE, EMPTY, DELETED };
private:
struct HashEntry
{
HashedObj element;
EntryType info;
HashEntry( const HashedObj & e = HashedObj( ), EntryType i = EMPTY )
: element( e ), info( i ) { }
};
vector<HashEntry> array;
int currentSize;
const HashedObj ITEM_NOT_FOUND;
bool isActive( int currentPos ) const;
int findPos( const HashedObj & x ) const;
void rehash( );
};
Thanks.