MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
EvalReport.hpp
Go to the documentation of this file.
1#pragma once
2
3namespace Lila {
4
5/**
6 * @brief Where an evaluated block came from.
7 *
8 * Local: a call on the Lila object itself, which includes everything the host
9 * evaluates and every block staged before the session started.
10 * Client: a message a connected client sent.
11 */
12enum class EvalOrigin : uint8_t {
13 Local,
14 Client
15};
16
17/**
18 * @brief What one evaluation did.
19 *
20 * The views are valid only for the duration of the observer call. Copy them to
21 * keep them. When ok is true, reason is empty.
22 */
23struct EvalReport {
24 EvalOrigin origin;
25 bool ok;
26 std::string_view code;
27 std::string_view reason;
28};
29
30/**
31 * @brief Receives each evaluation's report.
32 *
33 * A plain function and a pointer it is handed back, so nothing owned by one
34 * side of the library boundary is released by the other. It runs on the thread
35 * that evaluated, which for a client is the listener's, and must not block. An
36 * exception that escapes it is logged and dropped.
37 */
38using EvalObserver = void (*)(void* user, const EvalReport& report);
39
40} // namespace Lila
EvalOrigin
Where an evaluated block came from.
void(*)(void *user, const EvalReport &report) EvalObserver
Receives each evaluation's report.
EvalOrigin origin
std::string_view code
std::string_view reason
What one evaluation did.