xapian-core  1.4.26
Classes | Public Types | Public Member Functions | List of all members
Xapian::SmallVector< T > Class Template Reference

Vector of Xapian PIMPL objects. More...

#include <smallvector.h>

+ Inheritance diagram for Xapian::SmallVector< T >:
+ Collaboration diagram for Xapian::SmallVector< T >:

Classes

class  const_iterator
 

Public Types

typedef std::size_t size_type
 

Public Member Functions

 SmallVector ()
 
 SmallVector (size_type n)
 
 ~SmallVector ()
 
const_iterator begin () const
 
const_iterator end () const
 
size_type size () const
 
size_type capacity () const
 
bool empty () const
 
void clear ()
 
void reserve (size_type n)
 
void push_back (const T &elt)
 
operator[] (size_type idx) const
 

Additional Inherited Members

- Private Member Functions inherited from Xapian::SmallVector_
 SmallVector_ ()
 
void do_reserve (std::size_t n)
 
- Private Attributes inherited from Xapian::SmallVector_
std::size_t c
 
void * p [2]
 

Detailed Description

template<typename T>
class Xapian::SmallVector< T >

Vector of Xapian PIMPL objects.

A notable feature is that if the vector holds <= 2 objects, there's no extra storage - the two internal pointers are held in the two pointers which otherwise point to the first and just after the last element.

This means that for the fairly common cases of pair-wise Query operators and Database objects with one or two subdatabases, we use less space than std::vector<Xapian::Foo> would.

Definition at line 55 of file smallvector.h.

Member Typedef Documentation

◆ size_type

template<typename T>
typedef std::size_t Xapian::SmallVector< T >::size_type

Definition at line 57 of file smallvector.h.

Constructor & Destructor Documentation

◆ SmallVector() [1/2]

template<typename T>
Xapian::SmallVector< T >::SmallVector ( )
inline

Definition at line 86 of file smallvector.h.

◆ SmallVector() [2/2]

template<typename T>
Xapian::SmallVector< T >::SmallVector ( size_type  n)
inlineexplicit

Definition at line 89 of file smallvector.h.

◆ ~SmallVector()

template<typename T>
Xapian::SmallVector< T >::~SmallVector ( )
inline

Definition at line 93 of file smallvector.h.

Member Function Documentation

◆ begin()

template<typename T>
const_iterator Xapian::SmallVector< T >::begin ( ) const
inline

Definition at line 97 of file smallvector.h.

◆ capacity()

template<typename T>
size_type Xapian::SmallVector< T >::capacity ( ) const
inline

Definition at line 114 of file smallvector.h.

◆ clear()

template<typename T>
void Xapian::SmallVector< T >::clear ( )
inline

Definition at line 122 of file smallvector.h.

◆ empty()

template<typename T>
bool Xapian::SmallVector< T >::empty ( ) const
inline

Definition at line 118 of file smallvector.h.

◆ end()

template<typename T>
const_iterator Xapian::SmallVector< T >::end ( ) const
inline

Definition at line 103 of file smallvector.h.

◆ operator[]()

template<typename T>
T Xapian::SmallVector< T >::operator[] ( size_type  idx) const
inline

Definition at line 158 of file smallvector.h.

◆ push_back()

template<typename T>
void Xapian::SmallVector< T >::push_back ( const T &  elt)
inline

Definition at line 140 of file smallvector.h.

◆ reserve()

template<typename T>
void Xapian::SmallVector< T >::reserve ( size_type  n)
inline

Definition at line 133 of file smallvector.h.

◆ size()

template<typename T>
size_type Xapian::SmallVector< T >::size ( ) const
inline

Definition at line 109 of file smallvector.h.


The documentation for this class was generated from the following file: