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

Method NotifyWatchers

cpp/src/Driver.cpp:6223–6259  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Notify any watching objects of a value change -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

6221// Notify any watching objects of a value change
6222//-----------------------------------------------------------------------------
6223void Driver::NotifyWatchers
6224(
6225)
6226{
6227 list<Notification*>::iterator nit = m_notifications.begin();
6228 while( nit != m_notifications.end() )
6229 {
6230 Notification* notification = m_notifications.front();
6231 m_notifications.pop_front();
6232
6233 /* check the any ValueID's sent as part of the Notification are still valid */
6234 switch (notification->GetType()) {
6235 case Notification::Type_ValueChanged:
6236 case Notification::Type_ValueRefreshed: {
6237 Value *val = GetValue(notification->GetValueID());
6238 if (!val) {
6239 Log::Write(LogLevel_Info, notification->GetNodeId(), "Dropping Notification as ValueID does not exist");
6240 nit = m_notifications.begin();
6241 delete notification;
6242 val->Release();
6243 continue;
6244 }
6245 break;
6246 }
6247 default:
6248 break;
6249 }
6250
6251 Log::Write(LogLevel_Detail, notification->GetNodeId(), "Notification: %s", notification->GetAsString().c_str());
6252
6253 Manager::Get()->NotifyWatchers( notification );
6254
6255 delete notification;
6256 nit = m_notifications.begin();
6257 }
6258 m_notificationsEvent->Reset();
6259}
6260
6261//-----------------------------------------------------------------------------
6262// <Driver::HandleRfPowerLevelSetResponse>

Callers

nothing calls this directly

Calls 9

WriteFunction · 0.85
GetNodeIdMethod · 0.80
GetFunction · 0.70
beginMethod · 0.45
endMethod · 0.45
ReleaseMethod · 0.45
c_strMethod · 0.45
GetAsStringMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected