glotzutil::FlagList< N > Class Template Reference
[Utilities]

A list of flags configured for fast bitwise operations. More...

#include <FlagList.h>

List of all members.

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.


Detailed Description

template<int N>
class glotzutil::FlagList< N >

A list of flags configured for fast bitwise operations.

Author:
Aaron Keys
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.

Constructor & Destructor Documentation

template<int N>
glotzutil::FlagList< N >::FlagList (  )  [inline]

Constructor.

template<int N>
glotzutil::FlagList< N >::~FlagList (  )  [inline]

Destructor.


Member Function Documentation

template<int N>
bool glotzutil::FlagList< N >::IsEmpty (  )  [inline]

Indicates whether all of the flags are set to false.

Returns:
a bool indicating whether or not the flaglist has registered any flags

template<int N>
bool glotzutil::FlagList< N >::AnyMatch ( FlagList< N > &  flag  )  [inline]

Indicates whether any of the requested flags are present.

Parameters:
flag is list of flags to check for matching

template<int N>
bool glotzutil::FlagList< N >::AllMatch ( FlagList< N > &  flag  )  [inline]

Indicates whether all of the requested flags are present.

Parameters:
flag is list of flags to check for matching

template<int N>
void glotzutil::FlagList< N >::Add ( FlagList< N > &  flag  )  [inline]

Add more flags to the list.

Parameters:
flag is a list of flags to be added

template<int N>
void glotzutil::FlagList< N >::Remove ( FlagList< N > &  flag  )  [inline]

Remove an flag from the list.

Parameters:
flag is a list of flags to be removed

template<int N>
void glotzutil::FlagList< N >::Clear (  )  [inline]

Clear all flags.


The documentation for this class was generated from the following file:
Generated on Tue Feb 24 20:55:03 2009 by  doxygen 1.5.3