SafeAPI RBC 2oo2 Generic Application
IL/CTC route and train logic for the safeAPIRBC2oo2 reference RBC
Loading...
Searching...
No Matches
ab_ga_dispatch.h File Reference

GA's single GP-notification subscriber AND registration point for everything GP calls into GA with - interface-simplification pass, on direct instruction: GP used to know about six separate notify types, each with its own registration call site scattered across il.c/ctc.c/ma_logic_adaptation.c; a later pass converted every remaining bare GP->GA call (IL envelope apply, IL/CTC output draining) to a registration too, for the same reason. This module is now the ONLY thing in GA that ever calls ab_gp_db_register_route_context_notify()/ _register_train_context_notify()/_register_il_envelope_handler()/ _register_il_output_producer()/_register_ctc_output_producer() (ga_interface.h) - it registers ONCE, at ab_ga_dispatch_init(), and fans every notification/dispatch out to whichever of GA's own sibling modules (il/ctc) care, via plain internal function calls. GP has zero knowledge that those are separate GA modules. More...

#include "ga_interface.h"
Include dependency graph for ab_ga_dispatch.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

sapi_status_t ab_ga_dispatch_init (ab_gp_train_session_t *sessions, ab_gp_db_t *db)
 Registers every GA<->GP subscription this process needs, in one place: route-context notify, train-context notify, the IL envelope handler, the IL output producer, and the CTC output producer (all declared in ga_interface.h, first failure wins). Setup-phase only (same contract as those registration functions) - call once from AB/ma_logic_adaptation/ab_ga_ma_logic_adaptation.c's own ab_ga_ma_adaptation_init(), GA's own single entry point GP calls (AB/GP/com/ab_gp_channel.c's own ab_gp_channel_ga_setup()) - not from GP directly.

Detailed Description

GA's single GP-notification subscriber AND registration point for everything GP calls into GA with - interface-simplification pass, on direct instruction: GP used to know about six separate notify types, each with its own registration call site scattered across il.c/ctc.c/ma_logic_adaptation.c; a later pass converted every remaining bare GP->GA call (IL envelope apply, IL/CTC output draining) to a registration too, for the same reason. This module is now the ONLY thing in GA that ever calls ab_gp_db_register_route_context_notify()/ _register_train_context_notify()/_register_il_envelope_handler()/ _register_il_output_producer()/_register_ctc_output_producer() (ga_interface.h) - it registers ONCE, at ab_ga_dispatch_init(), and fans every notification/dispatch out to whichever of GA's own sibling modules (il/ctc) care, via plain internal function calls. GP has zero knowledge that those are separate GA modules.

  • it only ever talks to this one dispatch point (route/train context) or through function pointers this point handed it (envelope handler, output producers).

Definition in file ab_ga_dispatch.h.

Function Documentation

◆ ab_ga_dispatch_init()

sapi_status_t ab_ga_dispatch_init ( ab_gp_train_session_t * sessions,
ab_gp_db_t * db )

Registers every GA<->GP subscription this process needs, in one place: route-context notify, train-context notify, the IL envelope handler, the IL output producer, and the CTC output producer (all declared in ga_interface.h, first failure wins). Setup-phase only (same contract as those registration functions) - call once from AB/ma_logic_adaptation/ab_ga_ma_logic_adaptation.c's own ab_ga_ma_adaptation_init(), GA's own single entry point GP calls (AB/GP/com/ab_gp_channel.c's own ab_gp_channel_ga_setup()) - not from GP directly.

Parameters
sessions/

param db This channel's own long-lived Train session table/Train-Route database (both opaque to GA) - captured in this module's own static storage (one GA instance per process/ channel, so one copy is all that's ever needed) and handed to the CTC output producer as its registration context (the IL output producer needs neither; the IL envelope handler receives its own sessions/db as ordinary call parameters from GP instead, per-call, not through this capture - see ab_gp_il_envelope_handler_fn's own doc, ga_interface.h).

Returns
SAPI_STATUS_OK on success; whatever the first failing registration call itself returned otherwise.

Global functions

Definition at line 36 of file ab_ga_dispatch.c.