|
Objectively
Object oriented framework for C.
|
#include <Vector.h>
Properties | |
| size_t | capacity |
| The capacity. | |
| size_t | count |
| The count of elements. | |
| Consumer | destroy |
| Optional destructor called when an element is removed. | |
| ident | elements |
| The elements. | |
| Object | object |
| The superclass. | |
| size_t | size |
| The size of each element. | |
Properties inherited from Object | |
| Class * | clazz |
| Every instance of Object begins with a pointer to its Class. | |
| unsigned int | magic |
| A header to allow introspection of Object types. | |
Methods | |
| Class * | _Vector (void) |
| The Vector archetype. | |
| void | add (Vector *self, const ident element) |
| Adds the specified element to this Vector. | |
| void | enumerate (const Vector *self, VectorEnumerator enumerator, ident data) |
| Enumerates the elements of this Vector with the given function. | |
| void | filter (const Vector *self, Predicate predicate, ident data) |
| Filters the elements of this Vector with the given Predicate. | |
| void | filter (Vector *self, Predicate predicate, ident data) |
| ident | find (const Vector *self, Predicate predicate, ident data) |
| ssize_t | indexOf (const Vector *self, const ident element) |
| Vector * | initWithElements (Vector *self, size_t size, size_t count, ident elements) |
| Initializes this Vector with the specified elements. | |
| Vector * | initWithSize (Vector *self, size_t size) |
| Initializes this Vector with the specified element size. | |
| void | insert (Vector *self, const ident element, size_t index) |
| Inserts the element at the specified index. | |
| Vector * | mappedVector (const Vector *self, Functor functor, ident data) |
Returns a new Vector containing the elements of this Vector transformed by functor. | |
| ident | reduce (const Vector *self, Reducer reducer, ident accumulator, ident data) |
| void | removeAll (Vector *self) |
| Removes all elements from this Vector without modifying its capacity. | |
| void | removeAt (Vector *self, size_t index) |
| Removes the element at the specified index. | |
| void | removeAtFast (Vector *self, size_t index) |
| Removes the element at the specified index in constant time by moving the last element into its place. | |
| void | resize (Vector *self, size_t capacity) |
| Resizes this Vector to the specified capacity. | |
| void | sort (Vector *self, Comparator comparator) |
Sorts this Vector in place using comparator. | |
| Vector * | vectorWithElements (size_t size, size_t count, ident elements) |
| Creates a new Vector with the specified elements. | |
| Vector * | vectorWithSize (size_t size) |
| Creates a new Vector with the specified element size. | |
Methods inherited from Object | |
| Class * | _Object (void) |
| The Object archetype. | |
| Object * | copy (const Object *self) |
| Creates a shallow copy of this Object. | |
| void | dealloc (Object *self) |
| Frees all resources held by this Object. | |
| String * | description (const Object *self) |
| int | hash (const Object *self) |
| Object * | init (Object *self) |
| Initializes this Object. | |
| bool | isEqual (const Object *self, const Object *other) |
| Tests equality of the other Object. | |
| bool | isKindOfClass (const Object *self, const Class *clazz) |
| Tests for Class hierarchy membership. | |
Protected Attributes | |
| VectorInterface * | interface |
| The interface. | |
Protected Attributes inherited from Object | |
| ObjectInterface * | interface |
| The interface. | |
| Consumer Vector::destroy |
| Class * _Vector | ( | void | ) |
The Vector archetype.
Definition at line 450 of file Vector.c.
| void enumerate | ( | const Vector * | self, |
| VectorEnumerator | enumerator, | ||
| ident | data | ||
| ) |
Definition at line 152 of file Vector.c.
| self | The Vector. |
| element | The element. |
-1 if not found. Initializes this Vector with the specified elements.
| self | The Vector. |
| size | The element size. |
| count | The count of elements. |
| elements | The elements, which will be freed when this Vector is released. |
NULL on error. Definition at line 199 of file Vector.c.
Initializes this Vector with the specified element size.
| self | The Vector. |
| size | The element size. |
NULL on error. Definition at line 214 of file Vector.c.
Inserts the element at the specified index.
| self | The Vector. |
| element | The element to insert. |
| index | The index at which to insert. |
Definition at line 228 of file Vector.c.
Returns a new Vector containing the elements of this Vector transformed by functor.
| self | The Vector. |
| functor | The Functor. |
| data | User data. |
| self | The Vector. |
| reducer | The Reducer. |
| accumulator | The initial accumulator value. |
| data | User data. |
| void removeAll | ( | Vector * | self | ) |
| void removeAt | ( | Vector * | self, |
| size_t | index | ||
| ) |
| void removeAtFast | ( | Vector * | self, |
| size_t | index | ||
| ) |
Removes the element at the specified index in constant time by moving the last element into its place.
| self | The Vector. |
| index | The index of the element to remove. |
| void resize | ( | Vector * | self, |
| size_t | capacity | ||
| ) |
| void sort | ( | Vector * | self, |
| Comparator | comparator | ||
| ) |
Creates a new Vector with the specified elements.
| size | The element size. |
| count | The count of elements. |
| elements | THe elements, which will be freed when this Vector is released. |
Definition at line 403 of file Vector.c.
| Vector * vectorWithSize | ( | size_t | size | ) |