xapian-core  2.0.0
Public Types | Public Member Functions | List of all members
Xapian::SmallVectorI< TI > Class Template Reference

Vector of Xapian PIMPL internal objects. More...

#include <smallvector.h>

+ Inheritance diagram for Xapian::SmallVectorI< TI >:
+ Collaboration diagram for Xapian::SmallVectorI< TI >:

Public Types

typedef std::size_t size_type
 
typedef TI *const * const_iterator
 

Public Member Functions

 SmallVectorI ()
 
 SmallVectorI (size_type n)
 
 SmallVectorI (SmallVectorI &&o) noexcept
 
 ~SmallVectorI ()
 
const_iterator begin () const
 
const_iterator end () const
 
void clear ()
 
void push_back (TI *elt)
 
TI * operator[] (size_type idx) const
 
TI * front () const
 
TI * 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)
 

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 TI>
class Xapian::SmallVectorI< TI >

Vector of Xapian PIMPL internal 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::Internal*> would.

Definition at line 511 of file smallvector.h.

Member Typedef Documentation

◆ const_iterator

template<typename TI >
typedef TI* const* Xapian::SmallVectorI< TI >::const_iterator

Definition at line 515 of file smallvector.h.

◆ size_type

template<typename TI >
typedef std::size_t Xapian::SmallVectorI< TI >::size_type

Definition at line 513 of file smallvector.h.

Constructor & Destructor Documentation

◆ SmallVectorI() [1/3]

template<typename TI >
Xapian::SmallVectorI< TI >::SmallVectorI ( )
inline

Definition at line 518 of file smallvector.h.

◆ SmallVectorI() [2/3]

template<typename TI >
Xapian::SmallVectorI< TI >::SmallVectorI ( size_type  n)
inlineexplicit

Definition at line 521 of file smallvector.h.

◆ SmallVectorI() [3/3]

template<typename TI >
Xapian::SmallVectorI< TI >::SmallVectorI ( SmallVectorI< TI > &&  o)
inlinenoexcept

Definition at line 523 of file smallvector.h.

◆ ~SmallVectorI()

template<typename TI >
Xapian::SmallVectorI< TI >::~SmallVectorI ( )
inline

Definition at line 525 of file smallvector.h.

References Xapian::SmallVectorI< TI >::clear().

Member Function Documentation

◆ back()

template<typename TI >
TI* Xapian::SmallVectorI< TI >::back ( ) const
inline

Definition at line 561 of file smallvector.h.

References Xapian::SmallVectorI< TI >::end().

◆ begin()

template<typename TI >
const_iterator Xapian::SmallVectorI< TI >::begin ( ) const
inline

◆ clear()

template<typename TI >
void Xapian::SmallVectorI< TI >::clear ( )
inline

◆ end()

template<typename TI >
const_iterator Xapian::SmallVectorI< TI >::end ( ) const
inline

◆ front()

template<typename TI >
TI* Xapian::SmallVectorI< TI >::front ( ) const
inline

Definition at line 557 of file smallvector.h.

References Xapian::SmallVectorI< TI >::begin().

◆ operator[]()

template<typename TI >
TI* Xapian::SmallVectorI< TI >::operator[] ( size_type  idx) const
inline

Definition at line 553 of file smallvector.h.

References Xapian::SmallVectorI< TI >::begin().

◆ push_back()

template<typename TI >
void Xapian::SmallVectorI< TI >::push_back ( TI *  elt)
inline

Definition at line 545 of file smallvector.h.

References Xapian::SmallVector_::do_push_back().

Referenced by MultiDatabase::push_back().


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