Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <Babitflags.h>

Class TBitFlagsT

class TBitFlagsT;

Description

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

Members

Defined in TBitFlagsT:


Construction and destruction


TBitFlagsT()

inline TBitFlagsT();

Description

Default constructor - initialize all flags to zero


TBitFlagsT(T)

inline TBitFlagsT(T aFlags);

Description

Initialize the whole flag to a certain value

Parameters

T aFlags


TBitFlagsT(const TBitFlagsT &)

inline TBitFlagsT(const TBitFlagsT &aFlags);

Description

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

Parameters

const TBitFlagsT &aFlags

[Top]


Member functions


SetAll()

inline void SetAll();

Description

Set all the flags


ClearAll()

inline void ClearAll();

Description

Clear all the flags


Set(TInt)

inline void Set(TInt aFlagIndex);

Description

Set a particular flag

Parameters

TInt aFlagIndex


Clear(TInt)

inline void Clear(TInt aFlagIndex);

Description

Clear a particular flag

Parameters

TInt aFlagIndex


Assign(TInt,TBool)

inline void Assign(TInt aFlagIndex, TBool aValue);

Description

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


Toggle(TInt)

inline void Toggle(TInt aFlagIndex);

Description

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


operator[](TInt)const

inline TBool operator[](TInt aFlagIndex) const;

Description

Check if a particular flag is set or not

Parameters

TInt aFlagIndex

Return value

TBool

A boolean indicating whether the specified flag is set or clear


operator=(const TBitFlagsT &)

inline TBitFlagsT& operator=(const TBitFlagsT &aFlags);

Description

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

Parameters

const TBitFlagsT &aFlags

Return value

TBitFlagsT &


operator==(const TBitFlagsT &)

inline TBool operator==(const TBitFlagsT &aFlags);

Description

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

Parameters

const TBitFlagsT &aFlags

Return value

TBool

A boolean indicating whether the two flags are identical.


IsSet(TInt)const

inline TBool IsSet(TInt aFlagIndex) const;

Description

Check if a particular flag is set

Parameters

TInt aFlagIndex

Return value

TBool


IsClear(TInt)const

inline TBool IsClear(TInt aFlagIndex) const;

Description

Check if a particular flag is clear

Parameters

TInt aFlagIndex

Return value

TBool


Value()const

inline T Value() const;

Description

Access the underlying value of the flag.

Return value

T


SetValue(T)

inline void SetValue(T aFlags);

Description

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

Parameters

T aFlags

[Top]


Member data


iFlags

T iFlags;

Description