NCBI C++ ToolKit
|
Search Toolkit Book for CVectorWrap
A vector or pointer based sequence wrapper. More...
#include <algo/blast/dbindex/dbindex.hpp>
Public Types | |
typedef const T * | const_iterator |
Iterator type pointing to const data. More... | |
Declarations forwarded from TVector. | |
typedef TVector::size_type | size_type |
typedef TVector::value_type | value_type |
typedef TVector::reference | reference |
typedef TVector::const_reference | const_reference |
Public Member Functions | |
CVectorWrap (size_type sz=0, T v=T()) | |
Object constructor. More... | |
void | SetPtr (T *base, size_type sz) |
Make the object hold an external sequence. More... | |
reference | operator[] (size_type n) |
Indexing operator. More... | |
const_reference | operator[] (size_type n) const |
Indexing operator. More... | |
void | resize (size_type n, T v=T()) |
Change the size of the sequence. More... | |
size_type | size () const |
Get the sequence size. More... | |
const_iterator | begin () const |
Get the start of the sequence. More... | |
const_iterator | end () const |
Get the end of the sequence. More... | |
Private Types | |
typedef std::vector< T > | TVector |
Sequence type being wrapped. More... | |
Private Attributes | |
T * | base_ |
Pointer to the first element of the sequence. More... | |
TVector | data_ |
std::vector object wrapped by this object. More... | |
bool | vec_ |
Flag indicating whether it is a wrapper or a holder of external sequence. More... | |
size_type | size_ |
Size of the external sequence. More... | |
A vector or pointer based sequence wrapper.
Serves as either a std::vector wrapper or holds a constant size sequence pointed to by an external pointer.
Definition at line 317 of file dbindex.hpp.
typedef const T* CVectorWrap< T >::const_iterator |
Iterator type pointing to const data.
Definition at line 332 of file dbindex.hpp.
typedef TVector::const_reference CVectorWrap< T >::const_reference |
Definition at line 328 of file dbindex.hpp.
typedef TVector::reference CVectorWrap< T >::reference |
Definition at line 327 of file dbindex.hpp.
typedef TVector::size_type CVectorWrap< T >::size_type |
Definition at line 325 of file dbindex.hpp.
|
private |
Sequence type being wrapped.
Definition at line 319 of file dbindex.hpp.
typedef TVector::value_type CVectorWrap< T >::value_type |
Definition at line 326 of file dbindex.hpp.
|
inline |
Object constructor.
Initializes the object as a std::vector wrapper.
sz | [I] initial size |
v | [I] initial element value |
Definition at line 339 of file dbindex.hpp.
|
inline |
Get the start of the sequence.
Definition at line 390 of file dbindex.hpp.
Referenced by CSubjectMap::getRCIdOffByLIdOff(), and CSubjectMap::MapSubjOff().
|
inline |
Get the end of the sequence.
Definition at line 395 of file dbindex.hpp.
|
inline |
Indexing operator.
n | [I] index |
Definition at line 358 of file dbindex.hpp.
|
inline |
Indexing operator.
n | [I] index |
Definition at line 365 of file dbindex.hpp.
|
inline |
Change the size of the sequence.
Only works when the object holds a std::vector.
n | [I] new sequence size |
v | [I] initial value for newly created elements |
Definition at line 373 of file dbindex.hpp.
|
inline |
Make the object hold an external sequence.
base | [I] pointer to the external sequence |
sz | [I] size of the external sequence |
Definition at line 347 of file dbindex.hpp.
Referenced by COffsetData< iterator_t >::COffsetData(), COffsetData_Base::COffsetData_Base(), CSubjectMap::CSubjectMap(), CSubjectMap::Load(), and CSubjectMap::SetSeqDataFromMap().
|
inline |
Get the sequence size.
Definition at line 384 of file dbindex.hpp.
Referenced by CSubjectMap::getChunkLength(), CSubjectMap::getCId(), CSubjectMap::getCIdByLRCId(), CSubjectMap::getNumChunks(), CSubjectMap::getNumSubjects(), CSubjectMap::getRCIdOffByLIdOff(), CSubjectMap::getSeqData(), CSubjectMap::getSOff(), CSubjectMap::getSRCId(), CSubjectMap::getSubjectLength(), CSubjectMap::Load(), CSubjectMap::MapSubject(), CSubjectMap::NumChunks(), and CSubjectMap::NumSubjects().
|
private |
Pointer to the first element of the sequence.
Definition at line 400 of file dbindex.hpp.
Referenced by CVectorWrap< TWord >::begin(), CVectorWrap< TWord >::CVectorWrap(), CVectorWrap< TWord >::end(), CVectorWrap< TWord >::operator[](), CVectorWrap< TWord >::resize(), and CVectorWrap< TWord >::SetPtr().
|
private |
std::vector object wrapped by this object.
Definition at line 401 of file dbindex.hpp.
Referenced by CVectorWrap< TWord >::CVectorWrap(), CVectorWrap< TWord >::end(), CVectorWrap< TWord >::resize(), and CVectorWrap< TWord >::size().
|
private |
Size of the external sequence.
Definition at line 403 of file dbindex.hpp.
Referenced by CVectorWrap< TWord >::end(), CVectorWrap< TWord >::SetPtr(), and CVectorWrap< TWord >::size().
|
private |
Flag indicating whether it is a wrapper or a holder of external sequence.
Definition at line 402 of file dbindex.hpp.
Referenced by CVectorWrap< TWord >::end(), CVectorWrap< TWord >::resize(), CVectorWrap< TWord >::SetPtr(), and CVectorWrap< TWord >::size().