| 299 | } |
| 300 | |
| 301 | void CheckerComponent::ObjectHandler(const ConfigObject::Ptr& object) |
| 302 | { |
| 303 | Checkable::Ptr checkable = dynamic_pointer_cast<Checkable>(object); |
| 304 | |
| 305 | if (!checkable) |
| 306 | return; |
| 307 | |
| 308 | Zone::Ptr zone = Zone::GetByName(checkable->GetZoneName()); |
| 309 | bool same_zone = (!zone || Zone::GetLocalZone() == zone); |
| 310 | |
| 311 | { |
| 312 | std::unique_lock<std::mutex> lock(m_Mutex); |
| 313 | |
| 314 | if (object->IsActive() && !object->IsPaused() && same_zone) { |
| 315 | if (m_PendingCheckables.find(checkable) != m_PendingCheckables.end()) |
| 316 | return; |
| 317 | |
| 318 | m_IdleCheckables.insert(GetCheckableScheduleInfo(checkable)); |
| 319 | } else { |
| 320 | m_IdleCheckables.erase(checkable); |
| 321 | m_PendingCheckables.erase(checkable); |
| 322 | } |
| 323 | |
| 324 | m_CV.notify_all(); |
| 325 | } |
| 326 | } |
| 327 | |
| 328 | CheckableScheduleInfo CheckerComponent::GetCheckableScheduleInfo(const Checkable::Ptr& checkable) |
| 329 | { |