11 std::shared_ptr <notifications_processor> processor, std::shared_ptr<notification_decoder> decoder)
12 :_poll_intervals_ms(poll_intervals_ms),
14 _notifications_processor(processor),
18 {
polling(cancellable_timer); });
37 if( poll_intervals_ms )
58 if (strong) strong->raise_notification(
_decoder->decode(
val));
69 "Error polling loop is not behaving as expected!\nThis can indicate an issue with camera firmware or the underlying OS..." 71 if (strong) strong->raise_notification(postcondition_failed);
76 catch (
const std::exception& ex)
78 LOG_ERROR(
"Error during polling error handler: " << ex.what());
82 LOG_ERROR(
"Unknown error during polling error handler!");
87 LOG_DEBUG(
"Notification polling loop is being shut-down");
GLfloat GLfloat GLfloat GLfloat h
std::shared_ptr< notification_decoder > _decoder
std::weak_ptr< notifications_processor > _notifications_processor
polling_error_handler(unsigned int poll_intervals_ms, std::shared_ptr< option > option, std::shared_ptr< notifications_processor > processor, std::shared_ptr< notification_decoder > decoder)
void polling(dispatcher::cancellable_timer cancellable_timer)
void start(unsigned int poll_intervals_ms=0)
std::shared_ptr< option > _option
unsigned int _poll_intervals_ms
std::shared_ptr< active_object<> > _active_object
bool try_sleep(std::chrono::milliseconds::rep ms)