16 #ifndef _LIGHT_VECTOR_H_
17 #define _LIGHT_VECTOR_H_
57 void alloc(
int pos,
size_t n)
60 m_data = !m_data ? (T*)malloc(size *
sizeof(T)) : (T*)realloc(m_data, size *
sizeof(T));
62 for (
int i = size - 1; (i > pos) && (i >= (
int)n); --i )
63 m_data[i] = m_data[i - n];
70 inline void prepend(
const T& v)
75 void insert(
int i,
const T& v)
77 i = qBound(0, i, (
int)size);
83 void append(
const T& v)
86 m_data = !m_data ? (T*)malloc(size *
sizeof(T)) : (T*)realloc(m_data, size *
sizeof(T));
95 inline T& operator [] (
quint16 i)
100 bool contains(
const T& v)
const
102 for (
int i = 0; i < size; i++ )
103 if ( m_data[i] == v )
114 #endif // _LIGHT_VECTOR_H_