class UniqueVector
Declaration
template <class T>
class UniqueVector { /* full declaration omitted */ };
Description
UniqueVector - This class produces a sequential ID number (base 1) for each unique entry that is added. T is the type of entries in the vector. This class should have an implementation of operator== and of operator < . Entries can be fetched using operator[] with the entry ID.
Declared at: llvm/include/llvm/ADT/UniqueVector.h:24
Templates
- T
Method Overview
- public llvm::UniqueVector::iterator begin()
- public llvm::UniqueVector::const_iterator begin() const
- public bool empty() const
- public llvm::UniqueVector::iterator end()
- public llvm::UniqueVector::const_iterator end() const
- public unsigned int idFor(const T & Entry) const
- public unsigned int insert(const T & Entry)
- public void reset()
- public size_t size() const
Methods
¶llvm::UniqueVector::iterator begin()
llvm::UniqueVector::iterator begin()
Description
Return an iterator to the start of the vector.
Declared at: llvm/include/llvm/ADT/UniqueVector.h:75
¶llvm::UniqueVector::const_iterator begin() const
llvm::UniqueVector::const_iterator begin() const
Description
Return an iterator to the start of the vector.
Declared at: llvm/include/llvm/ADT/UniqueVector.h:78
¶bool empty() const
bool empty() const
Description
empty - Returns true if the vector is empty.
Declared at: llvm/include/llvm/ADT/UniqueVector.h:90
¶llvm::UniqueVector::iterator end()
llvm::UniqueVector::iterator end()
Description
Return an iterator to the end of the vector.
Declared at: llvm/include/llvm/ADT/UniqueVector.h:81
¶llvm::UniqueVector::const_iterator end() const
llvm::UniqueVector::const_iterator end() const
Description
Return an iterator to the end of the vector.
Declared at: llvm/include/llvm/ADT/UniqueVector.h:84
¶unsigned int idFor(const T& Entry) const
unsigned int idFor(const T& Entry) const
Description
idFor - return the ID for an existing entry. Returns 0 if the entry is not found.
Declared at: llvm/include/llvm/ADT/UniqueVector.h:57
Parameters
- const T& Entry
¶unsigned int insert(const T& Entry)
unsigned int insert(const T& Entry)
Description
insert - Append entry to the vector if it doesn't already exist. Returns the entry's index + 1 to be used as a unique ID.
Declared at: llvm/include/llvm/ADT/UniqueVector.h:40
Parameters
- const T& Entry
¶void reset()
void reset()
Description
reset - Clears all the entries.
Declared at: llvm/include/llvm/ADT/UniqueVector.h:93
¶size_t size() const
size_t size() const
Description
size - Returns the number of entries in the vector.
Declared at: llvm/include/llvm/ADT/UniqueVector.h:87