store<M, T> method

void store<M, T>(
  1. String n,
  2. Defi<M> m
)

Implementation

void store<M, T>(String n, Defi<M> m) {
  switch (M) {
    case const (SPI):
      _spi
          .putIfAbsent(T, () => {})
          .putIfAbsent(n, () => [])
          .add(m as Defi<SPI>);
    case const (MPI):
      _mpi.putIfAbsent(T, () => m as Defi<MPI>);
    default:
      throw Exception('unknown macro: $M');
  }
}