#pragma once #define LUT_DECL_VAR(name, aType, aCount, bType, bCount) \ int name##A2B[aCount]; \ int name##B2A[bCount]; \ using name##AType = aType; \ using name##BType = bType; \ void InitializeLookupTable_##name() #define LUT_MAP_FOR(name) \ int* lutMappingA2B = name##A2B; \ int* lutMappingB2A = name##B2A #define LUT_MAP(from, to) \ lutMappingA2B[from] = to; \ lutMappingB2A[to] = from #define LUT_INIT(name) InitializeLookupTable_##name() #define LUT_LOOKUP(name, from) (name##BType)(name##A2B[from]) #define LUT_REV_LOOKUP(name, to) (name##AType)(name##B2A[to])