SkyWay Linux SDK
読み取り中…
検索中…
一致する文字列を見つけられません
room.hpp
1//
2// © NTT DOCOMO BUSINESS, Inc. All Rights Reserved.
3//
4
5#ifndef SKYWAY_ROOM_ROOM_HPP
6#define SKYWAY_ROOM_ROOM_HPP
7
8#include <skyway/plugin/sfu_bot_plugin/sfu_bot.hpp>
9
10#include "skyway/room/abstract/room.hpp"
11#include "skyway/room/local_room_member.hpp"
12#include "skyway/room/room_domain_factory.hpp"
13
14namespace skyway {
15namespace room {
16
18class RoomFactory : public interface::RoomFactory {
19public:
20 std::shared_ptr<interface::Room> Create(
21 interface::RoomInitOptions options,
22 std::unique_ptr<interface::RoomDomainFactory> domain_factory) override;
23 std::shared_ptr<interface::Room> Find(
24 interface::RoomQuery query,
25 std::unique_ptr<interface::RoomDomainFactory> domain_factory) override;
26 std::shared_ptr<interface::Room> FindOrCreate(
27 interface::RoomInitOptions options,
28 std::unique_ptr<interface::RoomDomainFactory> domain_factory) override;
29};
31
33class Room : public abstract::Room, public std::enable_shared_from_this<Room> {
34public:
35 Room(std::shared_ptr<core::interface::Channel> channel,
36 std::unique_ptr<interface::RoomDomainFactory> factory);
37 interface::RoomType Type() override;
38
40 std::vector<std::shared_ptr<interface::RoomPublication>> Publications() override;
42 std::vector<std::shared_ptr<interface::RoomSubscription>> Subscriptions() override;
44 std::vector<std::shared_ptr<interface::RoomMember>> Members() override;
45
47 static std::shared_ptr<Room> Create(
49 std::unique_ptr<interface::RoomFactory> room_factory = std::make_unique<RoomFactory>(),
50 std::unique_ptr<interface::RoomDomainFactory> domain_factory =
51 std::make_unique<RoomDomainFactory>());
53 static std::shared_ptr<Room> Create();
55 static std::shared_ptr<Room> Find(
57 std::unique_ptr<interface::RoomFactory> room_factory = std::make_unique<RoomFactory>(),
58 std::unique_ptr<interface::RoomDomainFactory> domain_factory =
59 std::make_unique<RoomDomainFactory>());
61 static std::shared_ptr<Room> FindOrCreate(
63 std::unique_ptr<interface::RoomFactory> room_factory = std::make_unique<RoomFactory>(),
64 std::unique_ptr<interface::RoomDomainFactory> domain_factory =
65 std::make_unique<RoomDomainFactory>());
67 std::shared_ptr<LocalRoomMember> Join(interface::RoomMemberInitOptions options);
68
70 std::shared_ptr<plugin::sfu_bot::SfuBot> GetSfuBot();
72
73protected:
74 // core::interface::Channel::EventListener
75 void OnMemberListChanged() override;
76 void OnMemberJoined(std::shared_ptr<core::interface::Member> member) override;
77 void OnMemberLeft(std::shared_ptr<core::interface::Member> member) override;
78 void OnMemberMetadataUpdated(std::shared_ptr<core::interface::Member> member,
79 const std::string& metadata) override;
80 void OnPublicationMetadataUpdated(std::shared_ptr<core::interface::Publication> publication,
81 const std::string& metadata) override;
82 void OnPublicationListChanged() override;
83 void OnStreamPublished(std::shared_ptr<core::interface::Publication> publication) override;
84 void OnStreamUnpublished(std::shared_ptr<core::interface::Publication> publication) override;
85 void OnPublicationEnabled(std::shared_ptr<core::interface::Publication> publication) override;
86 void OnPublicationDisabled(std::shared_ptr<core::interface::Publication> publication) override;
88 void OnPublicationSubscribed(
89 std::shared_ptr<core::interface::Subscription> subscription) override;
90 void OnPublicationUnsubscribed(
91 std::shared_ptr<core::interface::Subscription> subscription) override;
92
93private:
94 static std::shared_ptr<Room> CreateShared(
95 std::shared_ptr<core::interface::Channel> channel,
96 std::unique_ptr<interface::RoomDomainFactory> factory);
97
98 bool IsSfuOriginPublication(std::shared_ptr<core::interface::Publication> publication);
99
100public:
102 friend class RoomFactory;
104};
105
106} // namespace room
107} // namespace skyway
108
109#endif /* SKYWAY_ROOM_ROOM_HPP */
DefaultRoomの操作を行うクラス
Definition room.hpp:33
void OnMemberListChanged() override
Member が入退出したときに発生するイベント
std::shared_ptr< LocalRoomMember > Join(interface::RoomMemberInitOptions options)
Roomへ参加します。
void OnSubscriptionListChanged() override
StreamがSubscribeまたはUnsubscribeされた時に発生するイベント
void OnPublicationListChanged() override
Publicationが作成または削除された時に発生するイベント
static std::shared_ptr< Room > FindOrCreate(interface::RoomInitOptions options, std::unique_ptr< interface::RoomFactory > room_factory=std::make_unique< RoomFactory >(), std::unique_ptr< interface::RoomDomainFactory > domain_factory=std::make_unique< RoomDomainFactory >())
Roomの検索をし、存在しなければ作成します。
std::vector< std::shared_ptr< interface::RoomPublication > > Publications() override
Roomに存在するPublicationを取得します。
static std::shared_ptr< Room > Find(interface::RoomQuery query, std::unique_ptr< interface::RoomFactory > room_factory=std::make_unique< RoomFactory >(), std::unique_ptr< interface::RoomDomainFactory > domain_factory=std::make_unique< RoomDomainFactory >())
Roomの検索をします。
std::vector< std::shared_ptr< interface::RoomSubscription > > Subscriptions() override
Roomに存在するSubscriptionを取得します。
std::vector< std::shared_ptr< interface::RoomMember > > Members() override
Roomに存在するMemberを取得します。
static std::shared_ptr< Room > Create()
Roomを作成します。
static std::shared_ptr< Room > Create(interface::RoomInitOptions options, std::unique_ptr< interface::RoomFactory > room_factory=std::make_unique< RoomFactory >(), std::unique_ptr< interface::RoomDomainFactory > domain_factory=std::make_unique< RoomDomainFactory >())
Roomを作成します。
interface::RoomType Type() override
RoomのTypeを取得します。
Roomの操作を行う抽象クラス
Definition room.hpp:21
RoomのCreate/FindOrCreateで扱うオプション
Definition room.hpp:20
MemberのCreateで扱うオプション
Definition room.hpp:52
RoomのFind/FindOrCreateで扱うオプション
Definition room.hpp:36