Clarisse 5.0 SP8 SDK
5.0.5.8.0
|
Public Types | |
enum | TestMode { MODE_DISABLE = 0, MODE_EXACT_BITS, MODE_ALL_BITS, MODE_ONE_BIT, MODE_COUNT } |
Public Member Functions | |
CoreBitFieldHelper () | |
CoreBitFieldHelper (const bool &inclusive, const int &bits, const TestMode &mode=MODE_ONE_BIT) | |
CoreBitFieldHelper (const int &inclusive_bits, const TestMode &inclusive_mode=MODE_ALL_BITS) | |
CoreBitFieldHelper (const int &inclusive_bits, const int &exclusive_bits, const TestMode &inclusive_mode=MODE_ALL_BITS, const TestMode &exclusive_mode=MODE_ALL_BITS) | |
~CoreBitFieldHelper () | |
Destructor. | |
bool | is_disabled () const |
bool | tests_bits (const int &bits) const |
bool | tests_include (const int &bits) const |
bool | tests_exclude (const int &bits) const |
Protected Attributes | |
int | m_inclusive_bits |
Bits to test for existency. | |
int | m_exclusive_bits |
Bits to test for absence. | |
TestMode | m_inclusive_mode |
Test mode for the inclusive bits. | |
TestMode | m_exclusive_mode |
Test mode for the exclusive bits. | |
Helper class for performing inclusive and/or exclusive bit field tests.
It defines:
Test modes defining how to compare 2 bit fields.
CoreBitFieldHelper::CoreBitFieldHelper | ( | ) |
Default constructor. Sets all bit fields to 0 and all test modes to MODE_DISABLE.
CoreBitFieldHelper::CoreBitFieldHelper | ( | const bool & | inclusive, |
const int & | bits, | ||
const TestMode & | mode = MODE_ONE_BIT |
||
) |
Constructor to create an inclusive-only or excluvie-only CoreBitFieldHelper.
inclusive | If true, will create an inclusive bit field. Otherwise creates an exclusive bit field. |
bits | The inclusive or exclusive bits to test, depending on inclusive . The unused bit field is set to 0. |
mode | The inclusive or exclusive test mode, depending on inclusive . The unused mode is set to MODE_DISABLE |
CoreBitFieldHelper::CoreBitFieldHelper | ( | const int & | inclusive_bits, |
const TestMode & | inclusive_mode = MODE_ALL_BITS |
||
) |
Constructor to create an inclusive-only CoreBitFieldHelper.
inclusive_bits | The inclusive bits to test. |
inclusive_mode | The inclusive bits test mode |
CoreBitFieldHelper::CoreBitFieldHelper | ( | const int & | inclusive_bits, |
const int & | exclusive_bits, | ||
const TestMode & | inclusive_mode = MODE_ALL_BITS , |
||
const TestMode & | exclusive_mode = MODE_ALL_BITS |
||
) |
Constructor to specify all parameters.
inclusive_bits | The inclusive bits to test. |
exclusive_bits | The exclusive bits to test. |
inclusive_mode | The inclusive bits test mode |
exclusive_mode | The exclusive bits test mode |
bool CoreBitFieldHelper::is_disabled | ( | ) | const |
Checks if test conditions are always true, meaning that calling the test methods is unnecessary.
|
inline |
Compares the given bits against the member inclusive and exclusive bits.
bits | The bits to test. |
bool CoreBitFieldHelper::tests_exclude | ( | const int & | bits | ) | const |
Compares the given bits against the member exclusive bits.
bits | The bits to test. |
bool CoreBitFieldHelper::tests_include | ( | const int & | bits | ) | const |
Compares the given bits against the member inclusive bits.
bits | The bits to test. |