Overte C++ Documentation
CloseEventSender.h
1 //
2 // CloseEventSender.h
3 // interface/src/networking
4 //
5 // Created by Stephen Birarda on 5/31/17.
6 // Copyright 2017 High Fidelity, Inc.
7 //
8 // Distributed under the Apache License, Version 2.0.
9 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
10 //
11 
12 #ifndef hifi_CloseEventSender_h
13 #define hifi_CloseEventSender_h
14 
15 #include <atomic>
16 
17 #include <QtCore/QString>
18 #include <QtCore/QUuid>
19 
20 #include <DependencyManager.h>
21 
22 class CloseEventSender : public QObject, public Dependency {
23  Q_OBJECT
24  SINGLETON_DEPENDENCY
25 
26 public:
27  void startThread();
28  bool hasTimedOutQuitEvent();
29  bool hasFinishedQuitEvent() { return _hasFinishedQuitEvent; }
30 
31 public slots:
32  void sendQuitEventAsync();
33 
34 private slots:
35  void handleQuitEventFinished();
36 
37 private:
38  std::atomic<bool> _hasFinishedQuitEvent { false };
39  std::atomic<int64_t> _quitEventStartTimestamp;
40 };
41 
42 #endif // hifi_CloseEventSender_h