xapian-core  2.0.0
Classes | Public Types | Public Member Functions | Private Types | 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 Types inherited from Xapian::SmallVectorI< T::Internal >
typedef std::size_t size_type
 
typedef T::Internal *const * const_iterator
 

Public Member Functions

 SmallVector ()
 
 SmallVector (size_type n)
 
const_iterator begin () const
 
const_iterator end () const
 
void push_back (const T &elt)
 
operator[] (size_type idx) const
 
front () const
 
back () const
 
void push_back (TI *elt)
 
- Public Member Functions inherited from Xapian::SmallVectorI< T::Internal >
 SmallVectorI ()
 
 SmallVectorI (size_type n)
 
 SmallVectorI (SmallVectorI &&o) noexcept
 
 ~SmallVectorI ()
 
const_iterator begin () const
 
const_iterator end () const
 
void clear ()
 
void push_back (T::Internal *elt)
 
T::Internal * operator[] (size_type idx) const
 
T::Internal * front () const
 
T::Internal * back () const
 
- Public Member Functions inherited from Xapian::SmallVector_
 SmallVector_ ()
 
 SmallVector_ (const SmallVector_ &)=delete
 
void operator= (const SmallVector_ &)=delete
 
 SmallVector_ (SmallVector_ &&o) noexcept
 
 SmallVector_ (std::size_t n)
 
std::size_t size () const
 
std::size_t capacity () const
 
bool empty () const
 
void reserve (std::size_t n)
 

Private Types

typedef SmallVectorI< typename T::Internal > super
 

Additional Inherited Members

- Protected Member Functions inherited from Xapian::SmallVector_
void do_free ()
 
void do_reserve (std::size_t n)
 
void do_clear ()
 
bool is_external () const
 Return true if storage is external to the object. More...
 
void *const * do_begin () const
 
void *const * do_end () const
 
void do_push_back (void *elt)
 

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 578 of file smallvector.h.

Member Typedef Documentation

◆ size_type

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

Definition at line 582 of file smallvector.h.

◆ super

template<typename T >
typedef SmallVectorI<typename T::Internal> Xapian::SmallVector< T >::super
private

Definition at line 579 of file smallvector.h.

Constructor & Destructor Documentation

◆ SmallVector() [1/2]

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

Definition at line 617 of file smallvector.h.

◆ SmallVector() [2/2]

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

Definition at line 620 of file smallvector.h.

Member Function Documentation

◆ back()

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

Definition at line 644 of file smallvector.h.

References Xapian::SmallVector< T >::end().

◆ begin()

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

◆ end()

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

◆ front()

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

Definition at line 640 of file smallvector.h.

References Xapian::SmallVector< T >::begin().

◆ operator[]()

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

Definition at line 636 of file smallvector.h.

References Xapian::SmallVector< T >::begin().

◆ push_back() [1/2]

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

◆ push_back() [2/2]

template<typename T >
void Xapian::SmallVectorI< TI >::push_back
inline

Definition at line 545 of file smallvector.h.

Referenced by Xapian::SmallVector< T >::push_back().


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