8#ifndef SKYWAY_ROOM_P2P_P2P_ROOM_HPP
9#define SKYWAY_ROOM_P2P_P2P_ROOM_HPP
11#include "skyway/room/abstract/room.hpp"
12#include "skyway/room/p2p/local_p2p_room_member.hpp"
13#include "skyway/room/p2p/room_domain_factory.hpp"
20class P2PRoomFactory :
public interface::RoomFactory {
22 std::shared_ptr<interface::Room> Create(
23 interface::RoomInitOptions options,
24 std::unique_ptr<interface::RoomDomainFactory> domain_factory)
override;
25 std::shared_ptr<interface::Room> Find(
26 interface::RoomQuery query,
27 std::unique_ptr<interface::RoomDomainFactory> domain_factory)
override;
28 std::shared_ptr<interface::Room> FindOrCreate(
29 interface::RoomInitOptions options,
30 std::unique_ptr<interface::RoomDomainFactory> domain_factory)
override;
37 P2PRoom(std::shared_ptr<core::interface::Channel> channel,
38 std::unique_ptr<interface::RoomDomainFactory> factory);
39 interface::RoomType
Type()
override;
42 static std::shared_ptr<P2PRoom>
Create(
44 std::unique_ptr<interface::RoomFactory> room_factory = std::make_unique<P2PRoomFactory>(),
45 std::unique_ptr<interface::RoomDomainFactory> domain_factory =
46 std::make_unique<RoomDomainFactory>());
48 static std::shared_ptr<P2PRoom>
Create();
50 static std::shared_ptr<P2PRoom>
Find(
52 std::unique_ptr<interface::RoomFactory> room_factory = std::make_unique<P2PRoomFactory>(),
53 std::unique_ptr<interface::RoomDomainFactory> domain_factory =
54 std::make_unique<RoomDomainFactory>());
58 std::unique_ptr<interface::RoomFactory> room_factory = std::make_unique<P2PRoomFactory>(),
59 std::unique_ptr<interface::RoomDomainFactory> domain_factory =
60 std::make_unique<RoomDomainFactory>());
65 static std::shared_ptr<P2PRoom> CreateShared(
66 std::shared_ptr<core::interface::Channel> channel,
67 std::unique_ptr<interface::RoomDomainFactory> factory);
71 friend class P2PRoomFactory;
72 friend class P2PRoomTest;
73 friend class LocalP2PRoomMemberTest;
Roomの操作を行う抽象クラス
Definition room.hpp:20
P2PRoomの操作を行うクラス
Definition p2p_room.hpp:35
static std::shared_ptr< P2PRoom > Create()
P2PRoomを作成します。
static std::shared_ptr< P2PRoom > Find(interface::RoomQuery query, std::unique_ptr< interface::RoomFactory > room_factory=std::make_unique< P2PRoomFactory >(), std::unique_ptr< interface::RoomDomainFactory > domain_factory=std::make_unique< RoomDomainFactory >())
P2PRoomの検索をします。
interface::RoomType Type() override
RoomのTypeを取得します。
std::unique_ptr< LocalP2PRoomMember > Join(interface::RoomMemberInitOptions options)
P2PRoomへ参加します。
static std::shared_ptr< P2PRoom > Create(interface::RoomInitOptions options, std::unique_ptr< interface::RoomFactory > room_factory=std::make_unique< P2PRoomFactory >(), std::unique_ptr< interface::RoomDomainFactory > domain_factory=std::make_unique< RoomDomainFactory >())
P2PRoomを作成します。
static std::shared_ptr< P2PRoom > FindOrCreate(interface::RoomInitOptions options, std::unique_ptr< interface::RoomFactory > room_factory=std::make_unique< P2PRoomFactory >(), std::unique_ptr< interface::RoomDomainFactory > domain_factory=std::make_unique< RoomDomainFactory >())
P2PRoomの検索をし、存在しなければ作成します。
RoomのCreate/FindOrCreateで扱うオプション
Definition room.hpp:23
MemberのCreateで扱うオプション
Definition room.hpp:55
RoomのFind/FindOrCreateで扱うオプション
Definition room.hpp:39