// a Class that stores a set of flags, all in one unsigned int variable. // for systems with 4-byte integers, this allows for 32 on/off flags class BitFlags { public: BitFlags(); // defaults all flags to "off" void Set(int num); // set flag # num to 1 void Unset(int num); // unset (i.e. set to 0) flag #num void Flip(int num); // flip flag #num bool Query(int num) const; // return true if #num is set, false otherwise private: int Mask(int num) const; unsigned int flags; // stores a set of flags const int numflags; // number of stored flags };