xapian-core  2.0.0
Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes | List of all members
Xapian::SmallVector_ Class Reference

#include <smallvector.h>

+ Inheritance diagram for Xapian::SmallVector_:

Public Member Functions

 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)
 

Protected Member Functions

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)
 

Private Attributes

std::size_t c = 0
 
void * p [INTERNAL_CAPACITY]
 

Static Private Attributes

static constexpr std::size_t INTERNAL_CAPACITY = 2
 

Detailed Description

Definition at line 413 of file smallvector.h.

Constructor & Destructor Documentation

◆ SmallVector_() [1/4]

Xapian::SmallVector_::SmallVector_ ( )
inline

Definition at line 421 of file smallvector.h.

◆ SmallVector_() [2/4]

Xapian::SmallVector_::SmallVector_ ( const SmallVector_ )
delete

◆ SmallVector_() [3/4]

Xapian::SmallVector_::SmallVector_ ( SmallVector_ &&  o)
inlinenoexcept

Definition at line 429 of file smallvector.h.

References c, and p.

◆ SmallVector_() [4/4]

Xapian::SmallVector_::SmallVector_ ( std::size_t  n)
inlineexplicit

Definition at line 434 of file smallvector.h.

References reserve().

Member Function Documentation

◆ capacity()

std::size_t Xapian::SmallVector_::capacity ( ) const
inline

Definition at line 446 of file smallvector.h.

References c, INTERNAL_CAPACITY, and is_external().

Referenced by do_push_back().

◆ do_begin()

void* const* Xapian::SmallVector_::do_begin ( ) const
inlineprotected

Definition at line 476 of file smallvector.h.

References is_external(), and p.

Referenced by Xapian::SmallVectorI< TI >::begin().

◆ do_clear()

void Xapian::SmallVector_::do_clear ( )
inlineprotected

Definition at line 465 of file smallvector.h.

References c, do_free(), and is_external().

Referenced by Xapian::SmallVectorI< TI >::clear().

◆ do_end()

void* const* Xapian::SmallVector_::do_end ( ) const
inlineprotected

Definition at line 480 of file smallvector.h.

References c, is_external(), and p.

Referenced by Xapian::SmallVectorI< TI >::end().

◆ do_free()

void Xapian::SmallVector_::do_free ( )
protected

Definition at line 54 of file smallvector.cc.

References p.

Referenced by do_clear().

◆ do_push_back()

void Xapian::SmallVector_::do_push_back ( void *  elt)
inlineprotected

Definition at line 484 of file smallvector.h.

References c, capacity(), do_reserve(), INTERNAL_CAPACITY, p, and size().

Referenced by Xapian::SmallVectorI< TI >::push_back().

◆ do_reserve()

void Xapian::SmallVector_::do_reserve ( std::size_t  n)
protected

Definition at line 32 of file smallvector.cc.

References c, is_external(), p, and rare.

Referenced by do_push_back(), and reserve().

◆ empty()

bool Xapian::SmallVector_::empty ( ) const
inline

◆ is_external()

bool Xapian::SmallVector_::is_external ( ) const
inlineprotected

Return true if storage is external to the object.

Definition at line 472 of file smallvector.h.

References c, and INTERNAL_CAPACITY.

Referenced by capacity(), do_begin(), do_clear(), do_end(), do_reserve(), empty(), and size().

◆ operator=()

void Xapian::SmallVector_::operator= ( const SmallVector_ )
delete

◆ reserve()

void Xapian::SmallVector_::reserve ( std::size_t  n)
inline

Definition at line 454 of file smallvector.h.

References c, do_reserve(), and INTERNAL_CAPACITY.

Referenced by MultiDatabase::reserve(), and SmallVector_().

◆ size()

std::size_t Xapian::SmallVector_::size ( ) const
inline

Member Data Documentation

◆ c

std::size_t Xapian::SmallVector_::c = 0
private

◆ INTERNAL_CAPACITY

constexpr std::size_t Xapian::SmallVector_::INTERNAL_CAPACITY = 2
staticconstexprprivate

Definition at line 416 of file smallvector.h.

Referenced by capacity(), do_push_back(), is_external(), and reserve().

◆ p

void* Xapian::SmallVector_::p[INTERNAL_CAPACITY]
private

Definition at line 418 of file smallvector.h.

Referenced by do_begin(), do_end(), do_push_back(), do_reserve(), empty(), size(), and SmallVector_().


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