TBitFlagsT Class Reference

class TBitFlagsT

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

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)
TValue()
TBitFlagsT &operator=(const TBitFlagsT &)
TBool operator==(const TBitFlagsT &)
TBool operator[](TInt)
Private Member Functions
TFlagMask(TInt)
Public Attributes
TiFlags

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

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)

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

Parameters

TInt aFlagIndex
TBool aValue

Clear(TInt)

voidClear(TIntaFlagIndex)[inline]

Clear a particular flag

Parameters

TInt aFlagIndex

ClearAll()

voidClearAll()[inline]

Clear all the flags

FlagMask(TInt)

TFlagMask(TIntaFlagIndex)const [private, inline]

Generate a mask for a particular flag

Parameters

TInt aFlagIndex

IsClear(TInt)

TBool IsClear(TIntaFlagIndex)const [inline]

Check if a particular flag is clear

Parameters

TInt aFlagIndex

IsSet(TInt)

TBool IsSet(TIntaFlagIndex)const [inline]

Check if a particular flag is set

Parameters

TInt aFlagIndex

Set(TInt)

voidSet(TIntaFlagIndex)[inline]

Set a particular flag

Parameters

TInt aFlagIndex

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.

Parameters

T aFlags

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.

Parameters

TInt aFlagIndex

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.

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[](TIntaFlagIndex)const [inline]

Check if a particular flag is set or not

Parameters

TInt aFlagIndex

Member Data Documentation

T iFlags

TiFlags