The current implementation for the functionality framework has a glaring flaw due to a few poor assumptions.
It is assumed that any particular resource pool or loader, component or system would be registered only once. While this is a nice thought to have as a developer, making the initial implementation of the framework easier, it becomes a headache for developers of functionality downstream, and even more difficult for no-technical users when trying to sort out dependencies. As such, it had to be changed.
To do this, I introduce what is effectively reference counting, similar to what one can find with `shared_ptr` types. This will prevent issues where the same item can be registered multiple times, and from being deregistered multiple times. This also meant however that counts had to be maintained both for the number of times it is 'registered' and 'initialized'. Especially since functionality can be added and removed even during simulation runtime. This does also require some more careful work in the de/registration and de/initialization functions of the downstream libraries, although it is believed that the benefits are worth it.
There was another glaring issue where initializations returned nothing, assuming that initialization would never fail. This is a terrible assumption to make, and these functions have been changed to at least return std::error_code so that errors can be detected, and either the simulation initialization stopped, or if it was functionality being added, have that functionality backed out and rejected.
2021/07/21