----------------------------------------------------------------------------- Remove all the values associated with a command class from the store -----------------------------------------------------------------------------
| 135 | // Remove all the values associated with a command class from the store |
| 136 | //----------------------------------------------------------------------------- |
| 137 | void ValueStore::RemoveCommandClassValues |
| 138 | ( |
| 139 | uint8 const _commandClassId |
| 140 | ) |
| 141 | { |
| 142 | map<uint32,Value*>::iterator it = m_values.begin(); |
| 143 | while( it != m_values.end() ) |
| 144 | { |
| 145 | Value* value = it->second; |
| 146 | ValueID const& valueId = value->GetID(); |
| 147 | if( _commandClassId == valueId.GetCommandClassId() ) |
| 148 | { |
| 149 | // The value belongs to the specified command class |
| 150 | |
| 151 | // First notify the watchers |
| 152 | if( Driver* driver = Manager::Get()->GetDriver( valueId.GetHomeId() ) ) |
| 153 | { |
| 154 | Notification* notification = new Notification( Notification::Type_ValueRemoved ); |
| 155 | notification->SetValueId( valueId ); |
| 156 | driver->QueueNotification( notification ); |
| 157 | } |
| 158 | |
| 159 | // Now release and remove the value from the store |
| 160 | value->Release(); |
| 161 | m_values.erase( it++ ); |
| 162 | } |
| 163 | else |
| 164 | { |
| 165 | ++it; |
| 166 | } |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | //----------------------------------------------------------------------------- |
| 171 | // <ValueStore::GetValue> |
no test coverage detected