MCPcopy Create free account
hub / github.com/OpenZWave/open-zwave / GetBitMask

Method GetBitMask

cpp/src/Manager.cpp:3427–3457  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Gets a BitMask on a BitSet ValueID -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

3425// Gets a BitMask on a BitSet ValueID
3426//-----------------------------------------------------------------------------
3427bool Manager::GetBitMask
3428(
3429 ValueID const& _id,
3430 int32* o_mask
3431)
3432{
3433 bool res = false;
3434
3435 if( o_mask )
3436 {
3437 if( ValueID::ValueType_BitSet == _id.GetType() )
3438 {
3439 if( Driver* driver = GetDriver( _id.GetHomeId() ) )
3440 {
3441 LockGuard LG(driver->m_nodeMutex);
3442 if( ValueBitSet* value = static_cast<ValueBitSet*>( driver->GetValue( _id ) ) )
3443 {
3444 *o_mask = value->GetBitMask();
3445 value->Release();
3446 res = true;
3447 } else {
3448 OZW_ERROR(OZWException::OZWEXCEPTION_INVALID_VALUEID, "Invalid ValueID passed to GetBitMask");
3449 }
3450 }
3451 } else {
3452 OZW_ERROR(OZWException::OZWEXCEPTION_CANNOT_CONVERT_VALUEID, "ValueID passed to GetBitMask is not a BitSet Value");
3453 }
3454 }
3455
3456 return res;
3457}
3458
3459//-----------------------------------------------------------------------------
3460// <Manager::GetBitSetSize

Callers

nothing calls this directly

Calls 2

GetValueMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected