Typedefs | |
typedef void(* | fts_object_listener_callback_t )(fts_object_t *o, void *l, fts_symbol_t s, int ac, const fts_atom_t *at) |
FTS object listener callback function data type. | |
typedef struct fts_context | fts_context_t |
FTS object context base type. | |
typedef struct fts_object_listener | fts_object_listener_t |
FTS object listener type. | |
typedef struct fts_object | fts_object_t |
FTS object data type. | |
typedef struct fts_safeobject | fts_safeobject_t |
FTS (thread-safe) shared object data type. | |
Functions | |
FTS_API fts_object_t * | fts_object_create (fts_class_t *cl, int ac, const fts_atom_t *at) |
Create an instance of the given class. | |
FTS_API void | fts_object_destroy (fts_object_t *o) |
Destroy object. | |
void | fts_object_refer (fts_object_t *o) |
Add a reference to an object (increment reference count). | |
void | fts_object_release (fts_object_t *o) |
Remove a reference from an object (decrement reference count). | |
FTS_API void | fts_object_set_persistence (fts_object_t *o, int persistence) |
Set the name of an object. | |
FTS_API fts_class_t * | fts_object_get_class (fts_object_t *o) |
Get the class of an object. | |
FTS_API fts_symbol_t | fts_object_get_class_name (fts_object_t *o) |
Get the class name of an object. | |
FTS_API int | fts_object_is_a (fts_object_t *o, fts_class_t *c) |
Check whether an object is an instance of a given class. | |
FTS_API fts_context_t * | fts_object_get_context (fts_object_t *o) |
Get the context of an object. | |
FTS_API void | fts_object_set_context (fts_object_t *o, fts_context_t *c) |
Set the context of an object. | |
FTS_API fts_object_t * | fts_object_get_container (fts_object_t *o) |
Get the container of an object. | |
FTS_API fts_symbol_t | fts_object_get_name (fts_object_t *o) |
Get the name of an object (if available in the given context). | |
FTS_API void | fts_object_add_listener (fts_object_t *o, void *listener, fts_object_listener_callback_t callback) |
Add a listener to an object. | |
FTS_API void | fts_object_remove_listener (fts_object_t *o, void *listener) |
Remove a listener from an object. | |
FTS_API void | fts_object_call_listeners (fts_object_t *o, fts_symbol_t s, int ac, const fts_atom_t *at) |
Call the listeners of an object. | |
FTS_API void | fts_object_changed (fts_object_t *o) |
Notify listeners that an object has changed. | |
FTS_API fts_method_t | fts_send_message (fts_object_t *o, fts_symbol_t s, int ac, const fts_atom_t *at, fts_atom_t *ret) |
Send an arbitrary message to an object (invoke method). | |
FTS_API void | fts_method_invoke (fts_method_t method, fts_object_t *o, int ac, const fts_atom_t *at, fts_atom_t *ret) |
Invoke a method. | |
FTS_API fts_status_t | fts_method_call (fts_object_t *o, fts_symbol_t selector, int ac, const fts_atom_t *at, fts_atom_t *ret) |
Invoke a method (by name) of a given object. |
typedef void(* fts_object_listener_callback_t)(fts_object_t *o, void *l, fts_symbol_t s, int ac, const fts_atom_t *at) |
FTS object listener callback function data type.
o | the object | |
l | the listener | |
s | selector | |
ac | args count | |
at | arguments |
FTS_API fts_status_t fts_method_call | ( | fts_object_t * | o, | |
fts_symbol_t | selector, | |||
int | ac, | |||
const fts_atom_t * | at, | |||
fts_atom_t * | ret | |||
) |
Invoke a method (by name) of a given object.
o | the target object | |
selector | the selector | |
ac | argument count | |
at | argument values | |
ret | pointer to return value |
FTS_API void fts_method_invoke | ( | fts_method_t | method, | |
fts_object_t * | o, | |||
int | ac, | |||
const fts_atom_t * | at, | |||
fts_atom_t * | ret | |||
) |
Invoke a method.
method | the method | |
o | the target object | |
ac | argument count | |
at | argument values | |
ret | pointer to return value |
FTS_API void fts_object_add_listener | ( | fts_object_t * | o, | |
void * | listener, | |||
fts_object_listener_callback_t | callback | |||
) |
Add a listener to an object.
o | the object | |
listener | the object listener | |
callback | the fts_object_listener_callaback |
FTS_API void fts_object_call_listeners | ( | fts_object_t * | o, | |
fts_symbol_t | s, | |||
int | ac, | |||
const fts_atom_t * | at | |||
) |
Call the listeners of an object.
o | the object | |
s | selector | |
ac | arguments count | |
at | arguments |
FTS_API void fts_object_changed | ( | fts_object_t * | o | ) |
Notify listeners that an object has changed.
o | the object |
FTS_API fts_object_t* fts_object_create | ( | fts_class_t * | cl, | |
int | ac, | |||
const fts_atom_t * | at | |||
) |
Create an instance of the given class.
cl | the class to instantiate | |
ac | argument count | |
at | the arguments |
Make sure that the object has a reference (e.g. by fts_object_refer) before calling any other function.
FTS_API void fts_object_destroy | ( | fts_object_t * | o | ) |
Destroy object.
This function is called by fts_object_release() when the last object reference is removed. It shouldn't ever be called directly.
o | the object |
FTS_API fts_class_t* fts_object_get_class | ( | fts_object_t * | o | ) |
Get the class of an object.
o | the object |
FTS_API fts_symbol_t fts_object_get_class_name | ( | fts_object_t * | o | ) |
Get the class name of an object.
o | the object |
FTS_API fts_object_t* fts_object_get_container | ( | fts_object_t * | o | ) |
Get the container of an object.
o | the object |
FTS_API fts_context_t* fts_object_get_context | ( | fts_object_t * | o | ) |
Get the context of an object.
o | the object |
FTS_API fts_symbol_t fts_object_get_name | ( | fts_object_t * | o | ) |
Get the name of an object (if available in the given context).
o | the object |
FTS_API int fts_object_is_a | ( | fts_object_t * | o, | |
fts_class_t * | c | |||
) |
Check whether an object is an instance of a given class.
o | the object | |
c | the class |
void fts_object_refer | ( | fts_object_t * | o | ) |
Add a reference to an object (increment reference count).
o | the object |
void fts_object_release | ( | fts_object_t * | o | ) |
Remove a reference from an object (decrement reference count).
o | the object |
FTS_API void fts_object_remove_listener | ( | fts_object_t * | o, | |
void * | listener | |||
) |
Remove a listener from an object.
o | the object | |
listener | the listener |
FTS_API void fts_object_set_context | ( | fts_object_t * | o, | |
fts_context_t * | c | |||
) |
Set the context of an object.
o | the object | |
c | the context |
FTS_API void fts_object_set_persistence | ( | fts_object_t * | o, | |
int | persistence | |||
) |
Set the name of an object.
o | the object | |
persistence |
FTS_API fts_method_t fts_send_message | ( | fts_object_t * | o, | |
fts_symbol_t | s, | |||
int | ac, | |||
const fts_atom_t * | at, | |||
fts_atom_t * | ret | |||
) |
Send an arbitrary message to an object (invoke method).
o | the target object | |
s | the message symbol | |
ac | argument count | |
at | argument values | |
ret | pointer to return value |