resetting the solver
[satune.git] / src / Collections / vector.h
index f140fac7937055a92790ebdfef3594fc6a0a0cb9..6c532532c8e39a3f115c61900d7fdfa0bfc894ce 100644 (file)
@@ -16,8 +16,9 @@
        type lastVector ## name(Vector ## name * vector);                      \
        void popVector ## name(Vector ## name * vector);                       \
        type getVector ## name(Vector ## name * vector, uint index);           \
+       void setExpandVector ## name(Vector ## name * vector, uint index, type item); \
        void setVector ## name(Vector ## name * vector, uint index, type item); \
-       uint getSizeVector ## name(Vector ## name * vector);                   \
+       uint getSizeVector ## name(const Vector ## name * vector);                   \
        void setSizeVector ## name(Vector ## name * vector, uint size);        \
        void deleteVector ## name(Vector ## name * vector);                    \
        void clearVector ## name(Vector ## name * vector);                     \
        type getVector ## name(Vector ## name * vector, uint index) {         \
                return vector->array[index];                                        \
        }                                                                     \
+       void setExpandVector ## name(Vector ## name * vector, uint index, type item) { \
+               if (index >= vector->size)                                            \
+                       setSizeVector ## name(vector, index + 1);                         \
+               setVector ## name(vector, index, item);                             \
+       }                                                                     \
        void setVector ## name(Vector ## name * vector, uint index, type item) { \
                vector->array[index] = item;                                          \
        }                                                                     \
-       uint getSizeVector ## name(Vector ## name * vector) {                  \
+       uint getSizeVector ## name(const Vector ## name * vector) {           \
                return vector->size;                                                \
        }                                                                     \
        void deleteVector ## name(Vector ## name * vector) {                     \