X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fupdate_checker.h;h=aa5f620e6cf2baf63eb742aca598a15ab8997da7;hb=ccacce39c39d16977ab6c1592fcb6e941b05ddff;hp=78ca403038771c4c2c7adf0afb58fc15bc5c1e24;hpb=ea6b2dae46caa1da829fbf499e83cd6ae3b3773a;p=dcpomatic.git diff --git a/src/lib/update_checker.h b/src/lib/update_checker.h index 78ca40303..aa5f620e6 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,18 @@ 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; boost::thread _thread; boost::mutex _process_mutex; boost::condition _condition; - int _to_do; - bool _terminate; + int _to_do = 0; + bool _terminate = false; };