Debian Codegraph @

Source/Core/Common/QoSSession.h

raw symbols SCIP
1 // Copyright 2017 Dolphin Emulator Project
2 // SPDX-License-Identifier: GPL-2.0-or-later
3
4 #pragma once
5
6 #include <enet/enet.h>
7 #include <utility>
8
9 namespace Common
10 {
11 class QoSSession
12 {
13 public:
14 // 1 0 1 1 1 0 0 0
15 // DSCP ECN
16 static constexpr int ef_tos = 0b10111000;
17
18 QoSSession() = default;
19 QoSSession(ENetPeer* peer, int tos_val = ef_tos);
20
21 ~QoSSession();
22
23 QoSSession& operator=(const QoSSession&) = delete;
24 QoSSession(const QoSSession&) = delete;
25
26 QoSSession& operator=(QoSSession&& session);
27 QoSSession(QoSSession&& session) { *this = std::move(session); }
28 bool Successful() const { return m_success; }
29
30 private:
31 #if defined(_WIN32)
32 void* m_qos_handle = nullptr;
33 unsigned long m_qos_flow_id = 0;
34
35 ENetPeer* m_peer = nullptr;
36 #endif
37
38 bool m_success = false;
39 };
40 } // namespace Common