18#include <QtCore/private/qglobal_p.h>
23template<
class T,
int Increment>
28 : m_count(0), m_capacity(0), m_data(
nullptr) {}
31 const T &
at(
int idx)
const {
52 if (m_count == m_capacity) {
53 m_capacity += Increment;
54 m_data = (T *)realloc(
static_cast<void *
>(m_data), m_capacity *
sizeof(T));
56 int moveCount = m_count - idx;
58 ::memmove(
static_cast<void *
>(m_data + idx + 1),
static_cast<const void *
>(m_data + idx), moveCount *
sizeof(T));
64 if (
count >= m_capacity) {
65 m_capacity = (
count + (Increment-1)) & (0xFFFFFFFF - Increment + 1);
66 m_data = (T *)realloc(
static_cast<void *
>(m_data), m_capacity *
sizeof(T));
71 int newSize = m_count +
count;
73 int moveCount = m_count - idx;
75 ::memmove(
static_cast<void *
>(m_data + idx +
count),
static_cast<const void *
>(m_data + idx),
76 moveCount *
sizeof(T));
81 int moveCount = m_count - (idx +
count);
83 ::memmove(
static_cast<void *
>(m_data + idx),
static_cast<const void *
>(m_data + idx +
count),
84 moveCount *
sizeof(T));
90 while (idx < m_count) {
91 if (m_data[idx] ==
v) {
100 for (
int idx = 0; idx < m_count; ++idx)
101 if (m_data[idx] ==
v)
107 return find(
v) != -1;
116 other.m_count = m_count;
117 other.m_capacity = m_capacity;
118 other.m_data = m_data;
void remove(int idx, int count=1)
void copyAndClear(QPODVector< T, Increment > &other)
void insert(int idx, const T &v)
const T & at(int idx) const
void removeOne(const T &v)
bool contains(const T &v)
QPODVector< T, Increment > & operator<<(const T &v)
void insertBlank(int idx, int count)
Combined button and popup list for selecting options.
GLsizei const GLfloat * v
[13]
GLenum GLenum GLsizei count