Sigma
Sigma copied to clipboard
Component and composite ID's should not be of type std::string
The reason for this is that strings and templates are not friends.
We can not write a template that would take the component ID as argument if this is a string.
As a consequence, we need to create a class for each component where a template would be sufficient.
I propose ID's to be of type unsigned int, and to create "name resolver" classes to transform a name into an ID.
uint32_t instead of a unsign int . If not, we can find the the size of the type can change depending of the compiler and if the OS is a 32 or 64 bit.
The "name resolver" sounds me to a hash function. We can use the same hash function to generate the ID from the string, and to store these strings in a hash table.
See ResourceSystem and a resource like Mesh to see how I handled this in a manner that has both a string and an ID.