Overview
Examples
Screenshots
Comparisons
Applications
Download
Manual
Status & Roadmap
FAQ
Authors & License
Forums
Wiki
Funding Ultimate++
Search on this site









SourceForge.net Logo



Index

template <class T, class HashFn = StdHash<T> >

 

template <class T, class HashFn = StdHash<T> >  class Index : private MoveableAndDeepCopyOption< Index<T, HashFn > >, public AIndex<T, Vector<T>, HashFn

 

T    Type of elements stored in Index. T is required to be moveable and must have either deep copy constructor, pick constructor or default constructor.

HashFn    Hashing class. Must have unsigned operator()(const T& x) method defined, returning hash value for elements. Defaults to StdHash<T> which requires unsigned GetHashValue(const T&) function returning hash value of elements to be defined.

Base class

AIndex<T, Vector<T>, HashFn>

 

Vector flavor of index. Inherits most of its functionality from AIndex and adds only members specific for its flavor.

Like any other NTL container, Index is a moveable type with pick and optional deep copy transfer semantics. Calling methods of picked Index is logic error with exception of

void operator=(pick_ Index& v) (defined by composition)

void operator<<=(const AIndex& v) (defined in AIndex)

void Clear()

bool IsPicked() const

Optional deep copy operator is inherited from AIndex class. Pick operator is implicitly defined by composition.

Members

 

Pop()

Drops last element of the Index and returns its value.

Requires T to have deep copy constructor.

Return value

Value of the dropped element.

 

Index()

Constructs empty Index.

 

Index(pick_ Index& s)

Pick constructor. Transfers source Index in low constant time, but destroys it by picking.

s

Source Index.

 

Index& operator=(pick_ Vector<T>& x)

Pick operator. Transfers source Vector to Index in low constant time, but destroys it by picking.

x

Source Vector.

 

Index(const Index& s, int)

Optional deep copy constructor.

Requires T to have deep copy constructor or optional deep copy constructor.

s

Source Index.

 

Index(pick_ Vector<T>& s)

Pick-constructs Index from Vector. Transfers source container in low constant time, but destroys it by picking.

s

Source Vector.

 

Index(const Vector<T>& s, int)

Deep-copy constructs Index from Vector.

Requires T to have deep copy constructor or optional deep copy constructor.

s

Source Vector.