ceptr
|
Where the VMHost takes care of processing and thinking, the Accumulator takes care of persistence and signaling (i.e. manifestation and sensation). It can be thought of as implementing the "body" of receptors. More...
Files | |
file | accumulator.c |
implementation file for accumulator | |
file | accumulator.h |
header file for the accumulator | |
Functions | |
void | _a_boot (char *dir_name) |
void | _a_start_vmhost () |
void | _a_shut_down () |
Xaddr | _a_new_instance (Instances *i, T *t) |
T * | _a_get_instance (Instances *i, Xaddr x) |
void | _a_get_instances (Instances *instances, Symbol s, T *t) |
T * | _a_set_instance (Instances *instances, Xaddr x, T *t) |
void | _a_delete_instance (Instances *instances, Xaddr x) |
void | _a_free_instances (Instances *i) |
S * | __a_serialize_instances (Instances *i) |
void | _a_serialize_instances (Instances *i, char *file) |
void | __a_unserialize_instances (SemTable *sem, Instances *instances, S *s) |
void | _a_unserialize_instances (SemTable *sem, Instances *i, char *file) |
T * | _a_gen_token (Instances *i, Xaddr x, T *dependency) |
Xaddr | _a_get_token_xaddr (Instances *i, T *token, T *dependency) |
void | _a_add_dependency (Instances *instances, T *token, T *dependency) |
void | _a_delete_dependency (Instances *instances, T *token, T *dependency) |
void | _a_delete_token (Instances *instances, T *token) |
Variables | |
VMHost * | G_vm |
void * | _o_add_label (char *label, T *def) |
T * | _o_make_protocol_def (SemTable *sem, Context c, char *label,...) |
void | _t_replace_sem_refs (T *t, T *sem_map) |
void | _o_merge_sem_map (T *from, T *into) |
T * | _o_bindings2sem_map (T *bindings, T *sem_map, T *defaults) |
T * | _o_unwrap (SemTable *sem, T *def, T *sem_map) |
T * | _o_resolve (SemTable *sem, T *def, T *sem_map) |
void | _o_express_role (Receptor *r, Protocol protocol, Symbol role, Aspect aspect, T *bindings) |
T * | __o_initiate (Receptor *r, SemanticID protocol, SemanticID interaction, T *bindings, T **sem_mapP) |
void | _o_initiate (Receptor *r, SemanticID protocol, SemanticID interaction, T *bindings) |
Where the VMHost takes care of processing and thinking, the Accumulator takes care of persistence and signaling (i.e. manifestation and sensation). It can be thought of as implementing the "body" of receptors.
T* __o_initiate | ( | Receptor * | r, |
SemanticID | protocol, | ||
SemanticID | interaction, | ||
T * | bindings, | ||
T ** | sem_mapP | ||
) |
build a run-tree and semantic map that will initiate a protocol interaction
[in] | receptor | initiating the protocol interaction |
[in] | protocol | which protocol |
[in] | interaction | which interaction in the protocol |
[in] | bindings | tree of PROTOCOL_BINDINGS |
[out] | sem_map | semantic map built by the protocol |
Definition at line 473 of file protocol.c.
void _a_boot | ( | char * | dir_path | ) |
bootstrap the ceptr system
starts up the vmhost and wakes up receptors that should be running in it.
check the compository to verify our version of the vmhost
Definition at line 60 of file accumulator.c.
void _a_shut_down | ( | ) |
clean shutdown of the the ceptr system
should be called by the thread that called _a_boot() (or _a_start_vmhost())
Definition at line 134 of file accumulator.c.
convert PROTOCOL_BINDINGS to SEMANTIC_MAP adding in any defaults
[in] | bindings | PROTOCOL_BINDINGS to be converted |
[in,out] | sem_map | SEMANTIC_MAP to be added to (may be NULL) |
[in] | defaults | PROTOCOL_DEFAULTS to be added if not in bindings |
Definition at line 234 of file protocol.c.
setup a receptor to participate as some role in a protocol
[in] | receptor | in which to express the protocol role |
[in] | protocol | which protocol |
[in] | role | symbol of role to express |
[in] | aspect | on which aspect to install the expectations |
[in] | bindings | PROTOCOL_BINDINGs tree to concretize the unknowns in the protocol def |
Definition at line 409 of file protocol.c.
void _o_initiate | ( | Receptor * | r, |
SemanticID | protocol, | ||
SemanticID | interaction, | ||
T * | bindings | ||
) |
initiate the first signal in a protocol interaction
[in] | receptor | initiating the protocol interaction |
[in] | protocol | which protocol |
[in] | interaction | which interaction in the protocol |
[in] | bindings | tree of PROTOCOL_BINDINGS |
Definition at line 506 of file protocol.c.
helper to build a PROTOCOL_DEFINITION
NOTE: this just makes it easier to build protocol defs in c. If you don't get the params right when calling it, it will segfault!
[in,out] | protocols | a protocols def tree containing protocols which will be added to |
[in] | label | the name of the protocol |
[in] | ... | params in correct order |
Definition at line 37 of file protocol.c.
convert a, possibly composed, protocol definition into an expressable definition
convert a PROTOCOL_DEF to a concretized version according to the RESOLUTIONs and LINKAGEs in the the def and the bindings
[in] | sem | SemTable contexts |
[in,out] | def | protocol definition to resolve |
[in] | role | the role that needs resolving |
[in] | sem_map | used to resolve the bindings |
Definition at line 372 of file protocol.c.
recursively expand wrapped protocol defs
[in] | sem | SemTable of contexts |
[in] | def | protocol definition tree |
[in,out] | sem_map | semantic map of the unwrapped protocols |
Definition at line 262 of file protocol.c.