summaryrefslogtreecommitdiffstats
path: root/src/network/network.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/network.h')
-rw-r--r--src/network/network.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/network/network.h b/src/network/network.h
new file mode 100644
index 000000000..e4de207b2
--- /dev/null
+++ b/src/network/network.h
@@ -0,0 +1,33 @@
+// SPDX-FileCopyrightText: Copyright 2017 Citra Emulator Project
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include <memory>
+#include "network/room.h"
+#include "network/room_member.h"
+
+namespace Network {
+
+class RoomNetwork {
+public:
+ RoomNetwork();
+
+ /// Initializes and registers the network device, the room, and the room member.
+ bool Init();
+
+ /// Returns a pointer to the room handle
+ std::weak_ptr<Room> GetRoom();
+
+ /// Returns a pointer to the room member handle
+ std::weak_ptr<RoomMember> GetRoomMember();
+
+ /// Unregisters the network device, the room, and the room member and shut them down.
+ void Shutdown();
+
+private:
+ std::shared_ptr<RoomMember> m_room_member; ///< RoomMember (Client) for network games
+ std::shared_ptr<Room> m_room; ///< Room (Server) for network games
+};
+
+} // namespace Network