LibJuno 1.0.4
LibJuno is a lightweight C11 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
processor_app.h
Go to the documentation of this file.
1/*
2 MIT License
3
4 Copyright (c) 2025 Robin A. Onsay
5
6 Permission is hereby granted, free of charge, to any person obtaining
7 a copy of this software and associated documentation files
8 (the "Software"), to deal in the Software without restriction,
9 including without limitation the rights to use, copy, modify, merge,
10 publish, distribute, sublicense, and/or sell copies of the Software,
11 and to permit persons to whom the Software is furnished to do so,
12 subject to the following conditions:
13
14 The above copyright notice and this permission notice shall be
15 included in all copies or substantial portions of the Software.
16*/
17
50#ifndef PROCESSOR_APP_H
51#define PROCESSOR_APP_H
52
53#include "juno/app/app_api.h"
54#include "juno/ds/array_api.h"
55#include "juno/module.h"
56#include "juno/sb/broker_api.h"
57#include "juno/types.h"
58
59#ifdef __cplusplus
60extern "C"
61{
62#endif
63
64/* --------------------------------------------------------------------------
65 * PROCESSOR_APP_T — concrete ProcessorApp struct
66 * -------------------------------------------------------------------------- */
67
86struct PROCESSOR_APP_TAG JUNO_MODULE_DERIVE(JUNO_APP_ROOT_T,
88 JUNO_SB_BROKER_ROOT_T *ptBroker;
90 JUNO_DS_ARRAY_ROOT_T *_ptPipeArray;
92 JUNO_FAILURE_HANDLER_T _pfcnFailureHandler;
94 JUNO_USER_DATA_T *_pvFailureUserData;
96 JUNO_SB_PIPE_T tPipe;
97);
98typedef struct PROCESSOR_APP_TAG PROCESSOR_APP_T;
99
100/* --------------------------------------------------------------------------
101 * ProcessorApp_Init — wire vtable and inject dependencies
102 * -------------------------------------------------------------------------- */
103
128// @{"req": ["REQ-UDPAPP-016"]}
130 PROCESSOR_APP_T *ptApp,
131 JUNO_SB_BROKER_ROOT_T *ptBroker,
132 JUNO_DS_ARRAY_ROOT_T *ptPipeArray,
133 JUNO_FAILURE_HANDLER_T pfcnFailureHandler,
134 void *pvFailureUserData
135);
136
137#ifdef __cplusplus
138}
139#endif
140
141#endif /* PROCESSOR_APP_H */
Application module API (start/process/exit lifecycle).
struct JUNO_APP_ROOT_TAG JUNO_APP_ROOT_T
The application module.
Definition app_api.h:50
Abstract fixed-capacity array interface for DS modules.
struct JUNO_DS_ARRAY_ROOT_TAG JUNO_DS_ARRAY_ROOT_T
Opaque array root carrying capacity and API pointer.
Definition array_api.h:58
Software Bus (SB) broker for single-threaded message fan-out.
struct JUNO_SB_BROKER_ROOT_TAG JUNO_SB_BROKER_ROOT_T
Definition broker_api.h:66
struct JUNO_SB_PIPE_TAG JUNO_SB_PIPE_T
Definition broker_api.h:68
#define JUNO_MODULE_DERIVE(ROOT_T,...)
Implement a derived module embedding the root as the first member.
Definition module.h:161
void(* JUNO_FAILURE_HANDLER_T)(JUNO_STATUS_T tStatus, const char *pcCustomMessage, JUNO_USER_DATA_T *pvUserData)
Failure handler callback signature.
Definition status.h:110
int32_t JUNO_STATUS_T
Canonical status type for LibJuno functions.
Definition status.h:51
void JUNO_USER_DATA_T
Opaque user data type for failure callbacks.
Definition status.h:101
Module system and dependency injection primitives for LibJuno.
JUNO_STATUS_T ProcessorApp_Init(PROCESSOR_APP_T *ptApp, JUNO_SB_BROKER_ROOT_T *ptBroker, JUNO_DS_ARRAY_ROOT_T *ptPipeArray, JUNO_FAILURE_HANDLER_T pfcnFailureHandler, void *pvFailureUserData)
Initialize a ProcessorApp instance.
Definition processor_app.cpp:110
struct PROCESSOR_APP_TAG PROCESSOR_APP_T
Definition processor_app.h:98
Common module result type aliases used throughout LibJuno.