X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Fupdate_checker.h;h=a0845b1941cf3fb78fb41ae2045ae4b2b3d32a68;hb=33e13c4053138930f4b2f59349e441c76111059d;hp=5071bf4ec86840658e3adc246a161c31776c6034;hpb=3828baf56467224f5d44049bf1e7a7ed11f43a05;p=dcpomatic.git diff --git a/src/lib/update_checker.h b/src/lib/update_checker.h index 5071bf4ec..a0845b194 100644 --- a/src/lib/update_checker.h +++ b/src/lib/update_checker.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Carl Hetherington + Copyright (C) 2014-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,10 +18,12 @@ */ -/** @file src/lib/update.h + +/** @file src/lib/update_checker.h * @brief UpdateChecker class. */ + #include "signaller.h" #include #include @@ -29,17 +31,22 @@ #include #include + struct update_checker_test; + /** Class to check for the existance of an update for DCP-o-matic on a remote server */ -class UpdateChecker : public Signaller, public boost::noncopyable +class UpdateChecker : public Signaller { public: ~UpdateChecker (); + UpdateChecker (UpdateChecker const &); + UpdateChecker& operator= (UpdateChecker const &); + void run (); - enum State { + enum class State { YES, ///< there is an update FAILED, ///< the check failed, so we don't know NO, ///< there is no update @@ -83,19 +90,19 @@ private: void thread (); char* _buffer; - int _offset; - CURL* _curl; + int _offset = 0; + CURL* _curl = nullptr; /** mutex to protect _state, _stable, _test and _emits */ mutable boost::mutex _data_mutex; State _state; boost::optional _stable; boost::optional _test; - int _emits; + int _emits = 0; - boost::thread* _thread; + boost::thread _thread; boost::mutex _process_mutex; boost::condition _condition; - int _to_do; - bool _terminate; + int _to_do = 0; + bool _terminate = false; };