I'm tring to map a key with a "generic" value, and by that I mean that it could be an int, float, char, string, and so on.
In particular I am tring to do this because I receive converted CAN data in the model, and the possible types are (currently) int, float and string.
The first idea was to create an abstract object that could be implemented in different ways (one for each device type), then place it in a container (map or set).
Than I tought it would be more light and efficient to use as value a "generic type", so that as data comes from the CAN bus, the container would be automatically built without creating new ad-hoc objects.
Aucun commentaire:
Enregistrer un commentaire