TBitFlagsT Class Reference

class TBitFlagsT

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

Constructor & Destructor Documentation

TBitFlagsT()

TBitFlagsT ( ) [inline]

Default constructor - initialize all flags to zero

TBitFlagsT(T)

TBitFlagsT ( T aFlags ) [inline]

Initialize the whole flag to a certain value

Parameters

T aFlags

TBitFlagsT(const TBitFlagsT &)

TBitFlagsT ( const TBitFlagsT & aFlags ) [inline]

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

Parameters

const TBitFlagsT & aFlags

Member Functions Documentation

Assign(TInt, TBool)

void Assign ( TInt aFlagIndex,
TBool aValue
) [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

Parameters

TInt aFlagIndex
TBool aValue

Clear(TInt)

void Clear ( TInt aFlagIndex ) [inline]

Clear a particular flag

Parameters

TInt aFlagIndex

ClearAll()

void ClearAll ( ) [inline]

Clear all the flags

FlagMask(TInt)

T FlagMask ( TInt aFlagIndex ) const [private, inline]

Generate a mask for a particular flag

Parameters

TInt aFlagIndex

IsClear(TInt)

TBool IsClear ( TInt aFlagIndex ) const [inline]

Check if a particular flag is clear

Parameters

TInt aFlagIndex

IsSet(TInt)

TBool IsSet ( TInt aFlagIndex ) const [inline]

Check if a particular flag is set

Parameters

TInt aFlagIndex

Set(TInt)

void Set ( TInt aFlagIndex ) [inline]

Set a particular flag

Parameters

TInt aFlagIndex

SetAll()

void SetAll ( ) [inline]

Set all the flags

SetValue(T)

void SetValue ( T aFlags ) [inline]

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

Parameters

T aFlags

Toggle(TInt)

void Toggle ( TInt aFlagIndex ) [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.

Parameters

TInt aFlagIndex

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.

Parameters

const TBitFlagsT & aFlags

operator==(const TBitFlagsT &)

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

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

Parameters

const TBitFlagsT & aFlags

operator[](TInt)

TBool operator[] ( TInt aFlagIndex ) const [inline]

Check if a particular flag is set or not

Parameters

TInt aFlagIndex

Member Data Documentation

T iFlags

T iFlags