TBitFlagsT Class Reference

#include <babitflags.h>

class TBitFlagsT

Detailed Description

A simple class which manages the process of setting and clearing flags in an abstract fashion.

Member Attribute Documentation



Constructor & Destructor Documentation

TBitFlagsT ( )


Default constructor - initialize all flags to zero

TBitFlagsT ( T )


Initialize the whole flag to a certain value

TBitFlagsT ( const TBitFlagsT & )

TBitFlagsT(const TBitFlagsT &aFlags)[inline]

Copy constructor - initialize this flag object to mirror that of aFlags.

Member Function Documentation

Assign ( TInt, TBool )


Set or clear a particular flag

If aValue is 1, then the flag is set If aValue is 0, then the flag is cleared

Clear ( TInt )


Clear a particular flag

ClearAll ( )


Clear all the flags

IsClear ( TInt )

TBool IsClear(TIntaFlagIndex)const [inline]

Check if a particular flag is clear

IsSet ( TInt )

TBool IsSet(TIntaFlagIndex)const [inline]

Check if a particular flag is set

Set ( TInt )


Set a particular flag

SetAll ( )


Set all the flags

SetValue ( T )


Assign a new value (directly) to this flag object. Replaces any existing individual flag settings.

Toggle ( TInt )


Change the state of a particular flag. If the flag at the specified index was clear, then it becomes set, otherwise it becomes clear.

Value ( )

TValue()const [inline]

Access the underlying value of the flag.

operator= ( const TBitFlagsT & )

TBitFlagsT &operator=(const TBitFlagsT &aFlags)[inline]

Assignment operator - assign specific value to the whole flag, replacing any existing value.

operator== ( const TBitFlagsT & )

TBool operator==(const TBitFlagsT &aFlags)[inline]

Compare the value of the whole flag with a given value.

Returns: A boolean indicating whether the two flags are identical.

operator[] ( TInt )

TBool operator[](TIntaFlagIndex)const [inline]

Check if a particular flag is set or not

Returns: A boolean indicating whether the specified flag is set or clear