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













SourceForge.net Logo



Index

 

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 deep copy constructor and deep copy assignment.

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.

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.

 

Base class

AIndex<T, Vector<T>, HashFn>

 

 

Constructor Detail

 

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(pick_ Vector<T>& s)

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(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.

 

 

Public Member List

 

T 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& operator=(pick_ Vector<T>& x)

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

x

Source Vector.

 

 

Last edit by cbpporter on 01/29/2010. Do you want to contribute?. T++