The more I flesh out my resource manager design the more I realize just how much more work and classes I need still need to add. While I was working on my ResourceItem class, one of the components it needs is to keep track of a bit field to keep track of its state whether it is loaded, ready to use, disabled, etc. Instead of normally hacking my way through the code implementations i decided to encapsulate that bit field implementation instead. And I created a class that wraps bit manipulation called BitFlags. Here’s a simple UML Class Diagram below.
BitFlags member and interface.
Basically, this class handles the low level bitwise manipulation like setting which particular bits on and off. The interface seems self-explanatory so I’ll just let you figure the methods out. Link to the implementation is provided below. As an added bonus, here’s a bunch of bitwise manipulation macros extracted from my Pulse Library project.
Link to BitFlags class implementation:
Feel fre to ask if you have any question!