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

Method GetValueListItems

cpp/src/Manager.cpp:2625–2655  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Gets the list of items from a list value -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

2623// Gets the list of items from a list value
2624//-----------------------------------------------------------------------------
2625bool Manager::GetValueListItems
2626(
2627 ValueID const& _id,
2628 vector<string>* o_value
2629)
2630{
2631 bool res = false;
2632
2633 if( o_value )
2634 {
2635 if( ValueID::ValueType_List == _id.GetType() )
2636 {
2637 if( Driver* driver = GetDriver( _id.GetHomeId() ) )
2638 {
2639 LockGuard LG(driver->m_nodeMutex);
2640 if( ValueList* value = static_cast<ValueList*>( driver->GetValue( _id ) ) )
2641 {
2642 o_value->clear();
2643 res = value->GetItemLabels( o_value );
2644 value->Release();
2645 } else {
2646 OZW_ERROR(OZWException::OZWEXCEPTION_INVALID_VALUEID, "Invalid ValueID passed to GetValueListItems");
2647 }
2648 }
2649 } else {
2650 OZW_ERROR(OZWException::OZWEXCEPTION_CANNOT_CONVERT_VALUEID, "ValueID passed to GetValueListItems is not a List Value");
2651 }
2652 }
2653
2654 return res;
2655}
2656
2657//-----------------------------------------------------------------------------
2658// <Manager::GetValueListValues>

Callers

nothing calls this directly

Calls 4

clearMethod · 0.80
GetItemLabelsMethod · 0.80
GetValueMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected