#include <SFBReactor.h>
Data Fields | |
u8 | tableIndex |
u8 | entryIndex |
Conceptually, a GRL is just a 16 bit index into a set of function pointers (specifically, PacketHandler's). It exists primarily so that a SFBDispatchEntry can unite a PacketHandler with a u8 type code and eight bits of flags, and fit it all in a word.
Within the 16 bits of a GRL, a two-level (table, entry) structure allows different parts of the codebase (sketch, reflex core, external libraries..) each to provide their own arrays of PacketHandler pointers. Each such array is assigned a table number (when passed to SFBReactor::reflexes), and then the associated entry numbers are its array indices. Such arrays will typically be declared "const", so they are stored in flash memory, avoiding the need to waste RAM on the function pointers themselves.