CrystalSpace

Public API Reference

csFlags Class Reference

Set of flags which can be accessed through masks. More...

#include <csutil/flags.h>

List of all members.

Public Member Functions

bool Check (uint32 mask) const
 Check if any of the given flags are set.
bool CheckAll (uint32 mask) const
 Check if all the given flags are set.
 csFlags (uint32 value=0)
 Constructor. All flags are set to false by default.
uint32 Get () const
 Get flags.
bool operator!= (const csFlags &other) const
 Check if two sets of flags are not equal.
csFlags operator& (const csFlags &other) const
 AND-combine two sets of flags.
bool operator== (const csFlags &other) const
 Check if two sets of flags are equal.
void Reset (uint32 mask)
 Reset all given flags.
void Set (uint32 mask, uint32 value)
 Set all flags with the given mask.
void Set (uint32 mask)
 Set all given flags.
void SetAll (uint32 value)
 Initialize all flags to the given mask.
void SetBool (uint32 mask, bool value)
 Set all flags with the given value.

Detailed Description

Set of flags which can be accessed through masks.

Definition at line 31 of file flags.h.


Constructor & Destructor Documentation

csFlags::csFlags ( uint32  value = 0  )  [inline]

Constructor. All flags are set to false by default.

Definition at line 39 of file flags.h.


Member Function Documentation

bool csFlags::Check ( uint32  mask  )  const [inline]

Check if any of the given flags are set.

Definition at line 94 of file flags.h.

bool csFlags::CheckAll ( uint32  mask  )  const [inline]

Check if all the given flags are set.

Definition at line 98 of file flags.h.

uint32 csFlags::Get (  )  const [inline]

Get flags.

Definition at line 90 of file flags.h.

bool csFlags::operator!= ( const csFlags other  )  const [inline]

Check if two sets of flags are not equal.

Definition at line 106 of file flags.h.

csFlags csFlags::operator& ( const csFlags other  )  const [inline]

AND-combine two sets of flags.

Definition at line 109 of file flags.h.

bool csFlags::operator== ( const csFlags other  )  const [inline]

Check if two sets of flags are equal.

Definition at line 103 of file flags.h.

void csFlags::Reset ( uint32  mask  )  [inline]

Reset all given flags.

This will clear all flags which you specify in the mask. i.e. if a mask bit is 1 then the corresponding flag will be cleared. All other flags are untouched.

Definition at line 65 of file flags.h.

void csFlags::Set ( uint32  mask,
uint32  value 
) [inline]

Set all flags with the given mask.

With this function you can set and clear a series of flags but only the flags you specify in the mask will be affected.

Definition at line 73 of file flags.h.

void csFlags::Set ( uint32  mask  )  [inline]

Set all given flags.

This function will set all flags which are '1' in the mask. All other flags are untouched. This contrasts with SetAll() which will set all flags that are '1' in the input and clear the flags that are '0'.

Definition at line 56 of file flags.h.

void csFlags::SetAll ( uint32  value  )  [inline]

Initialize all flags to the given mask.

You can use this function to set and clear all flags at once. If you only want to set flags (and not clear others) then use 'Set(mask)'.

Definition at line 47 of file flags.h.

void csFlags::SetBool ( uint32  mask,
bool  value 
) [inline]

Set all flags with the given value.

This function will set all flags given in the mask with either '1' or '0' depending on the boolean input value.

Definition at line 81 of file flags.h.


The documentation for this class was generated from the following file:

Generated for Crystal Space 2.0 by doxygen 1.6.1