36typedef struct VectorInterface VectorInterface;
96#define VectorElement(vector, type, index) \
97 (((type *) vector->elements) + (index))
102#define VectorValue(vector, type, index) \
103 *(VectorElement(vector, type, index))
108struct VectorInterface {
113 ObjectInterface objectInterface;
161 ssize_t (*indexOf)(
const Vector *self,
const ident element);
173 Vector *(*initWithElements)(
Vector *self,
size_t size,
size_t count,
ident elements);
193 void (*insert)(
Vector *self,
const ident element,
size_t index);
223 void (*removeAll)(
Vector *self);
232 void (*removeAt)(
Vector *self,
size_t index);
241 void (*resize)(
Vector *self,
size_t capacity);
262 Vector *(*vectorWithElements)(
size_t size,
size_t count,
ident elements);
272 Vector *(*vectorWithSize)(
size_t size);
Object is the root Class of The Objectively Class hierarchy.
void * ident
The identity type, similar to Objective-C id.
#define OBJECTIVELY_EXPORT
bool(* Predicate)(const ident obj, ident data)
The Predicate function type for filtering Objects.
Order(* Comparator)(const ident obj1, const ident obj2)
The Comparator function type for ordering Objects.
ident(* Functor)(const ident obj, ident data)
The Functor function type for transforming Objects.
void(* Consumer)(ident data)
The Consumer function type.
ident(* Reducer)(const ident obj, ident accumulator, ident data)
The Reducer function type for reducing collections.
void(* VectorEnumerator)(const Vector *vector, ident obj, ident data)
The VectorEnumerator function type.
OBJECTIVELY_EXPORT Class * _Vector(void)
The runtime representation of a Class.
Object is the root Class of The Objectively Class hierarchy.
Object object
The superclass.
Consumer destroy
Optional destructor called when an element is removed.
VectorInterface * interface
The interface.
size_t count
The count of elements.
size_t capacity
The capacity.
ident elements
The elements.
size_t size
The size of each element.