25 #ifndef XAPIAN_INCLUDED_SMALLVECTOR_H 26 #define XAPIAN_INCLUDED_SMALLVECTOR_H 71 return T(static_cast<typename T::Internal*>(*ptr));
75 return T(static_cast<typename T::Internal*>(ptr[idx]));
98 return const_iterator(
c >
sizeof(
p) /
sizeof(*
p) ?
99 static_cast<void * const *>(
p[0]) :
103 const_iterator
end()
const {
104 return const_iterator(
c >
sizeof(
p) /
sizeof(*
p) ?
105 static_cast<void * const *>(
p[1]) :
110 return c >
sizeof(
p) /
sizeof(*
p) ?
111 static_cast<void**
>(
p[1]) - static_cast<void**>(
p[0]) :
c;
115 return c >
sizeof(
p) /
sizeof(*
p) ?
c :
sizeof(
p) /
sizeof(*
p);
119 return c >
sizeof(
p) /
sizeof(*
p) ?
p[0] ==
p[1] :
c == 0;
123 for (const_iterator i = begin(); i != end(); ++i)
124 if ((*i).internal.get() && --(*i).internal->_refs == 0)
125 delete (*i).internal.get();
127 if (
c >
sizeof(
p) /
sizeof(*
p))
128 delete []
static_cast<typename T::Internal**
>(
p[0]);
134 if (n >
sizeof(
p) /
sizeof(*
p) && n >
c) {
141 size_type cap = capacity();
147 if (elt.internal.get())
148 ++elt.internal->_refs;
149 if (
c >=
sizeof(
p) /
sizeof(*p)) {
150 void ** e =
static_cast<void **
>(
p[1]);
151 *e++ =
static_cast<void*
>(elt.internal.get());
152 p[1] =
static_cast<void*
>(e);
154 p[
c++] = elt.internal.get();
165 #endif // XAPIAN_INCLUDED_SMALLVECTOR_H
The Xapian namespace contains public interfaces for the Xapian library.
const_iterator operator++(int)
const_iterator begin() const
void push_back(const T &elt)
Vector of Xapian PIMPL objects.
bool operator==(const const_iterator &o) const
bool operator!=(const const_iterator &o) const
void reserve(size_type n)
T operator[](size_type idx) const
size_type capacity() const
const_iterator(void *const *ptr_)
T operator[](size_type idx) const
if(!(properties &BACKEND))
void do_reserve(std::size_t n)
const_iterator end() const
const_iterator & operator++()
const_iterator operator+(int n)