Overte C++ Documentation
LoginStateManager.h
1 //
2 // LoginStateManager.h
3 // interface/src
4 //
5 // Created by Wayne Chen on 11/5/18.
6 // Copyright 2018 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 #ifndef hifi_LoginStateManager_h
12 #define hifi_LoginStateManager_h
13 #include <QtCore/QList>
14 #include <QtCore/QVariant>
15 
16 #include <PointerEvent.h>
17 
18 #include <shared/ReadWriteLockable.h>
19 
20 class LoginStateManager : protected ReadWriteLockable {
21 public:
22  LoginStateManager() = default;
23  ~LoginStateManager() = default;
24 
25  void setUp();
26  void tearDown();
27 
28  void update(const QString& dominantHand, const QUuid& loginObjectID);
29 
30  bool isSetUp() const { return (_leftLoginPointerID > PointerEvent::INVALID_POINTER_ID) && (_rightLoginPointerID > PointerEvent::INVALID_POINTER_ID); }
31 
32 private:
33  QString _dominantHand;
34  QList<QVariant> _renderStates {};
35  QList<QVariant> _defaultRenderStates {};
36  unsigned int _leftLoginPointerID { PointerEvent::INVALID_POINTER_ID };
37  unsigned int _rightLoginPointerID { PointerEvent::INVALID_POINTER_ID };
38 };
39 
40 #endif // hifi_LoginStateManager_h