32#define _Class _IndexPath
67 for (
size_t i = 0; i < this->length; i++) {
69 if (i < this->length - 1) {
87 for (
size_t i = 0; i < this->length; i++) {
108 if (this->length == that->
length) {
109 return memcmp(this->indexes, that->
indexes, this->length *
sizeof(
size_t)) == 0;
116#pragma mark - IndexPath
124 assert(position < self->length);
126 return self->
indexes[position];
149 self->
indexes = calloc(
sizeof(
size_t), length);
152 memcpy(self->
indexes, indexes,
sizeof(
size_t) * length);
158#pragma mark - Class lifecycle
189 .interfaceOffset = offsetof(
IndexPath, interface),
190 .interfaceSize =
sizeof(IndexPathInterface),
Class * _initialize(const ClassDef *def)
Initializes the given Class.
#define alloc(type)
Allocate and initialize and instance of type.
#define super(type, obj, method,...)
int HashForInteger(int hash, const long integer)
Accumulates the hash value of integer into hash.
Utilities for calculating hash values.
#define HASH_SEED
The hash seed value.
static void initialize(Class *clazz)
Index paths represent the path to an element or node within a tree or graph structure.
#define do_once(once, block)
Executes the given block at most one time.
ClassDefs are passed to _initialize via an archetype to initialize a Class.
The runtime representation of a Class.
ident interface
The interface of the Class.
Condition * init(Condition *self)
Initializes this Condition.
Index paths represent the path to an element or node within a tree or graph structure.
IndexPath * initWithIndexes(IndexPath *self, size_t *indexes, size_t length)
Initializes this IndexPath with the specified indexes and length.
Class * _IndexPath(void)
The IndexPath archetype.
IndexPath * initWithIndex(IndexPath *self, size_t index)
Initializes this IndexPath with the specified index.
size_t * indexes
The indexes.
size_t indexAtPosition(const IndexPath *self, size_t position)
size_t length
The length of indexes.
void appendFormat(MutableString *self, const char *fmt,...)
Appends the specified formatted string.
void appendCharacters(MutableString *self, const char *chars)
Appends the specified UTF-8 encoded C string.
Object is the root Class of The Objectively Class hierarchy.
Class * _Object(void)
The Object archetype.
Object * copy(const Object *self)
Creates a shallow copy of this Object.
_Bool isKindOfClass(const Object *self, const Class *clazz)
Tests for Class hierarchy membership.
String * description(const Object *self)
_Bool isEqual(const Object *self, const Object *other)
Tests equality of the other Object.
int hash(const Object *self)
void dealloc(Object *self)
Frees all resources held by this Object.
OBJECTIVELY_EXPORT MutableString * mstr(const char *fmt,...)
A convenience function for instantiating MutableStrings.