value will be the index of current variable
The map value could be a struct/class containing the index and type info + ... as needed - or indeed the key of another map.