All data updates from the BLE devices happens through a queue of DataUpdate objects. This uses native RealTimeOS queues so is fast and thread safe, so I think is a reasonable strategy.
Our DataUpdate class is a bit weird though. It is basically a container for a union of all our DataUpdate subtypes along with a marker of the type of the union. This is very efficient on space but adding a new update type feels pretty jank and includes a lot of boilerplate. Is there a better way in c/c++ that would be just as fast?
All data updates from the BLE devices happens through a queue of
DataUpdate
objects. This uses native RealTimeOS queues so is fast and thread safe, so I think is a reasonable strategy.Our
DataUpdate
class is a bit weird though. It is basically a container for a union of all our DataUpdate subtypes along with a marker of the type of the union. This is very efficient on space but adding a new update type feels pretty jank and includes a lot of boilerplate. Is there a better way in c/c++ that would be just as fast?