Unmutable array of atoms. The tuple class is built around the FTS array data structure.
Tuple objects contain atoms that can be accessed by index. Within externals, its size can grow and shrink to accomodate adding elements.
Typedefs | |
typedef struct fts_tuple | fts_tuple_t |
FTS tuple data type. | |
Functions | |
FTS_API fts_array_t * | fts_tuple_get_array (fts_tuple_t *tuple) |
Get a tuple's internal fts array. | |
void | fts_tuple_init (fts_tuple_t *tuple, int ac, const fts_atom_t *at) |
Initialise a tuple with given elements. | |
void | fts_tuple_destroy (fts_tuple_t *tuple) |
Destroy (deinitialise) a tuple. | |
void | fts_tuple_clear (fts_tuple_t *tuple) |
Clear tuple (set size to 0). | |
void | fts_tuple_set_size (fts_tuple_t *tuple, int size) |
Set size of a tuple. | |
void | fts_tuple_set (fts_tuple_t *tuple, int ac, const fts_atom_t *at) |
Set elements (and size) of a tuple. | |
FTS_API void | fts_tuple_append (fts_tuple_t *tuple, int ac, fts_atom_t *at) |
Append arguments to a tuple. | |
FTS_API void | fts_tuple_append_int (fts_tuple_t *tuple, int val) |
Append int argument to a tuple. | |
FTS_API void | fts_tuple_append_float (fts_tuple_t *tuple, float val) |
Append float argument to a tuple. | |
FTS_API void | fts_tuple_append_symbol (fts_tuple_t *tuple, fts_symbol_t val) |
Append symbol argument to a tuple. | |
FTS_API void | fts_tuple_append_object (fts_tuple_t *tuple, fts_object_t *val) |
Append object argument to a tuple. | |
FTS_API int | fts_is_tuple (fts_atom_t *a) |
Check whether value is a tuple object. | |
Variables | |
FTS_API fts_class_t * | fts_tuple_class |
The FTS tuple class identifier (pointer to class instance). |
FTS_API int fts_is_tuple | ( | fts_atom_t * | a | ) |
Check whether value is a tuple object.
a | the atom |
FTS_API void fts_tuple_append | ( | fts_tuple_t * | tuple, | |
int | ac, | |||
fts_atom_t * | at | |||
) |
Append arguments to a tuple.
tuple | the tuple | |
ac | argument count | |
at | argument values |
FTS_API void fts_tuple_append_float | ( | fts_tuple_t * | tuple, | |
float | val | |||
) |
Append float argument to a tuple.
tuple | the tuple | |
val | float argument |
FTS_API void fts_tuple_append_int | ( | fts_tuple_t * | tuple, | |
int | val | |||
) |
Append int argument to a tuple.
tuple | the tuple | |
val | int argument |
FTS_API void fts_tuple_append_object | ( | fts_tuple_t * | tuple, | |
fts_object_t * | val | |||
) |
Append object argument to a tuple.
tuple | the tuple | |
val | fts_object argument |
FTS_API void fts_tuple_append_symbol | ( | fts_tuple_t * | tuple, | |
fts_symbol_t | val | |||
) |
Append symbol argument to a tuple.
tuple | the tuple | |
val | symbol argument |
void fts_tuple_clear | ( | fts_tuple_t * | tuple | ) |
Clear tuple (set size to 0).
tuple | the tuple |
void fts_tuple_destroy | ( | fts_tuple_t * | tuple | ) |
Destroy (deinitialise) a tuple.
tuple | the tuple |
FTS_API fts_array_t* fts_tuple_get_array | ( | fts_tuple_t * | tuple | ) |
Get a tuple's internal fts array.
tuple | the tuple |
void fts_tuple_init | ( | fts_tuple_t * | tuple, | |
int | ac, | |||
const fts_atom_t * | at | |||
) |
Initialise a tuple with given elements.
tuple | the tuple | |
ac | the atoms count | |
at | atoms to initialize the content of the array |
void fts_tuple_set | ( | fts_tuple_t * | tuple, | |
int | ac, | |||
const fts_atom_t * | at | |||
) |
Set elements (and size) of a tuple.
tuple | the tuple | |
ac | number of elements | |
at | array of elements |
void fts_tuple_set_size | ( | fts_tuple_t * | tuple, | |
int | size | |||
) |
Set size of a tuple.
New elements are initialised to 0.
tuple | the tuple | |
size | new size |