File syn_ao.h¶
Go to the source code of this file
Active Object (Actor model) framework wrapper. More...
#include "../common/syn_defs.h"#include "../pt/syn_pt.h"#include "../sched/syn_mailbox.h"#include "../sched/syn_task.h"#include "../util/syn_fsm.h"
Classes¶
| Type | Name |
|---|---|
| struct | SYN_AO_Event Active Object Event. |
| struct | SYN_ActiveObject Active Object structure. |
Public Functions¶
| Type | Name |
|---|---|
| void | syn_ao_init (SYN_ActiveObject * ao, const char * name, const SYN_FSM_Transition * transitions, SYN_FSM_State initial_state, void * mailbox_buf, size_t mailbox_cap) Initialize an Active Object. |
| bool | syn_ao_post (SYN_ActiveObject * ao, uint16_t sig, void * data) Post an event to the Active Object's mailbox. |
Detailed Description¶
Combines cooperative tasks, protothreads, mailboxes, and state machines to enforce strict event-driven encapsulation.
Public Functions Documentation¶
function syn_ao_init¶
Initialize an Active Object.
void syn_ao_init (
SYN_ActiveObject * ao,
const char * name,
const SYN_FSM_Transition * transitions,
SYN_FSM_State initial_state,
void * mailbox_buf,
size_t mailbox_cap
)
Parameters:
aoActive Object instance.nameName of the active object (used for task/logging).transitionsTransition table for the internal state machine.initial_stateInitial state of the state machine.mailbox_bufBuffer backing the mailbox event queue.mailbox_capCapacity (number of elements) of the buffer.
function syn_ao_post¶
Post an event to the Active Object's mailbox.
Thread-safe and ISR-safe. Protects the mailbox write using critical sections.
Parameters:
aoActive Object instance.sigSignal identifier.dataOptional payload.
Returns:
true if the event was successfully queued, false if queue is full.
The documentation for this class was generated from the following file src/syntropic/sched/syn_ao.h