TBitFlagsT Class Reference

#include <babitflags.h>

class TBitFlagsT
Public Attributes
T iFlags
Public Member Functions
TBitFlagsT()
TBitFlagsT(T)
TBitFlagsT(const TBitFlagsT &)
voidAssign(TInt, TBool)
voidClear(TInt)
voidClearAll()
TBool IsClear(TInt)
TBool IsSet(TInt)
voidSet(TInt)
voidSetAll()
voidSetValue(T)
voidToggle(TInt)
T Value()
TBitFlagsT &operator=(const TBitFlagsT &)
TBool operator==(const TBitFlagsT &)
TBool operator[](TInt)

Detailed Description

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

Member Attribute Documentation

iFlags

T iFlags

Constructor & Destructor Documentation

TBitFlagsT ( )

TBitFlagsT()[inline]

Default constructor - initialize all flags to zero

TBitFlagsT ( T )

TBitFlagsT(TaFlags)[inline]

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 )

voidAssign(TIntaFlagIndex,
TBoolaValue
)[inline]

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 )

voidClear(TIntaFlagIndex)[inline]

Clear a particular flag

ClearAll ( )

voidClearAll()[inline]

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 )

voidSet(TIntaFlagIndex)[inline]

Set a particular flag

SetAll ( )

voidSetAll()[inline]

Set all the flags

SetValue ( T )

voidSetValue(TaFlags)[inline]

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

Toggle ( TInt )

voidToggle(TIntaFlagIndex)[inline]

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 ( )

T Value()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.

Return Value
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

Return Value
A boolean indicating whether the specified flag is set or clear