#include <FlagList.h>
Public Member Functions | |
| FlagList () | |
| Constructor. | |
| ~FlagList () | |
| Destructor. | |
| bool | IsEmpty () |
| Indicates whether all of the flags are set to false. | |
| bool | AnyMatch (FlagList &flag) |
| Indicates whether any of the requested flags are present. | |
| bool | AllMatch (FlagList &flag) |
| Indicates whether all of the requested flags are present. | |
| void | Add (FlagList &flag) |
| Add more flags to the list. | |
| void | Remove (FlagList &flag) |
| Remove an flag from the list. | |
| void | Clear () |
| Clear all flags. | |
This class basically adds some extra functions to std::bitset to make the operations more transparent. Each flag is given a particular bit. This allows for fast checking of which flag has occured. If we used, for example, and array of boolean values we would have to loop over the array and check for each bit. Here we can check the for many flags simultaneously by using bitwise operators.
| glotzutil::FlagList< N >::FlagList | ( | ) | [inline] |
Constructor.
| glotzutil::FlagList< N >::~FlagList | ( | ) | [inline] |
Destructor.
| bool glotzutil::FlagList< N >::IsEmpty | ( | ) | [inline] |
Indicates whether all of the flags are set to false.
| bool glotzutil::FlagList< N >::AnyMatch | ( | FlagList< N > & | flag | ) | [inline] |
Indicates whether any of the requested flags are present.
| flag | is list of flags to check for matching |
| bool glotzutil::FlagList< N >::AllMatch | ( | FlagList< N > & | flag | ) | [inline] |
Indicates whether all of the requested flags are present.
| flag | is list of flags to check for matching |
| void glotzutil::FlagList< N >::Add | ( | FlagList< N > & | flag | ) | [inline] |
Add more flags to the list.
| flag | is a list of flags to be added |
| void glotzutil::FlagList< N >::Remove | ( | FlagList< N > & | flag | ) | [inline] |
Remove an flag from the list.
| flag | is a list of flags to be removed |
| void glotzutil::FlagList< N >::Clear | ( | ) | [inline] |
Clear all flags.
1.5.3