35 m_array = g_ptr_array_new();
39 m_array = g_ptr_array_sized_new(initialSize);
43 g_ptr_array_free(m_array, TRUE);
47 m_array = g_ptr_array_sized_new(other.m_array->len);
48 for (
unsigned int i = 0; i < other.m_array->len; i++) {
49 g_ptr_array_add(m_array, g_ptr_array_index(other.m_array, i));
56 g_ptr_array_free(m_array, TRUE);
57 m_array = g_ptr_array_sized_new(other.m_array->len);
58 for (
unsigned int i = 0; i < other.m_array->len; i++) {
59 g_ptr_array_add(m_array, g_ptr_array_index(other.m_array, i));
66 g_ptr_array_add(m_array, t);
69 inline bool remove(T* t) {
70 return g_ptr_array_remove(m_array, t);
80 GPtrArray* oldArray = m_array;
81 m_array = g_ptr_array_sized_new(oldArray->len + 1);
83 for (
unsigned int i = 0; i < oldArray->len; i++) {
84 g_ptr_array_add(m_array, g_ptr_array_index(oldArray, i));
85 if (g_ptr_array_index(oldArray, i) == t)
86 g_ptr_array_add(m_array, newT);
89 g_ptr_array_free(oldArray, TRUE);
100 GPtrArray* oldArray = m_array;
101 m_array = g_ptr_array_sized_new(oldArray->len + 1);
103 for (
unsigned int i = 0; i < oldArray->len; i++) {
104 if (g_ptr_array_index(oldArray, i) == t)
105 g_ptr_array_add(m_array, newT);
106 g_ptr_array_add(m_array, g_ptr_array_index(oldArray, i));
109 g_ptr_array_free(oldArray, TRUE);
113 return m_array->len == 0;
121 g_ptr_array_free(m_array, TRUE);
122 m_array = g_ptr_array_new();
128 return (T*) g_ptr_array_index(m_array, i);
132 return (T*&) g_ptr_array_index(m_array, i);
136 for (
unsigned int i = 0; i < m_array->len; i++) {
137 if (g_ptr_array_index(m_array, i) == t)
145 for (
unsigned int i = 0; i < m_array->len; i++) {
146 if (g_ptr_array_index(m_array, i) == t)
156 return (T*) g_ptr_array_index(m_array, 0);
162 return (T*) g_ptr_array_index(m_array, m_array->len - 1);