Functions for implementing a custom space in C.
More...
|
| struct | space_params_t |
| | Data associated with this particular space, including the space's payload and observers. More...
|
| struct | space_api_t |
| | A table of functions to define the behavior of a Space implemented in C. More...
|
Functions for implementing a custom space in C.
This interface allows a custom space to be defined with C. This allows for different space back-ends, such as a distributed database, or different space topologies, such as the multidimensional latent space of word2vec.
◆ space_event_free()
◆ space_event_new_add()
Creates a new space_event_t representing an Add event.
- Parameters
-
| [in] | atom | The atom that is being added to the Space, to embed into the event |
- Returns
- The newly created space_event_t
- Note
- The caller must take ownership responsibility for the returned space_event_t and it must be freed with space_event_free()
- Warning
- This function takes ownership of the atom parameter, so it must not be subsequently access or freed
◆ space_event_new_remove()
Creates a new space_event_t representing a Remove event.
- Parameters
-
| [in] | atom | The atom that is being removed from the Space, to embed into the event |
- Returns
- The newly created space_event_t
- Note
- The caller must take ownership responsibility for the returned space_event_t and it must be freed with space_event_free()
- Warning
- This function takes ownership of the atom parameter, so it must not be subsequently access or freed
◆ space_event_new_replace()
Creates a new space_event_t representing a Replace event.
- Parameters
-
| [in] | pattern | The atom that is being matched in the Space, to embed into the event |
| [in] | tmpl | The atom that is being used to construct new atoms in the Space, to embed into the event |
- Returns
- The newly created space_event_t
- Note
- The caller must take ownership responsibility for the returned space_event_t and it must be freed with space_event_free()
- Warning
- This function takes ownership of both the pattern and the tmpl parameter, so neither may be subsequently access nor freed
◆ space_params_notify_all_observers()
Notifies all associated observers of an event.
- Parameters
-
| [in] | params | A pointer to the space's params |
| [in] | event | A pointer to the event, to broadcast to all observers of the Space |