Windows(C++)[v1.7.5.0]
PanoRtcMessage.h
浏览该文件的文档.
1
3#pragma once
4
5#include "PanoRtcDefs.h"
6#include <cstddef>
7
9PANORTC_NS_BEGIN
10
18{
19public:
20 class Callback;
21
36 virtual QResult setCallback(Callback *callback) = 0;
57 virtual QResult sendMessage(uint64_t userId, PanoData data) = 0;
78 virtual QResult broadcastMessage(PanoData data, bool sendBack=false) = 0;
101 virtual QResult publish(const char *topic, PanoData data, uint32_t requestId=0) = 0;
116 virtual QResult subscribe(const char *topic) = 0;
131 virtual QResult unsubscribe(const char *topic) = 0;
151 virtual QResult setProperty(const char *name, PanoData value) = 0;
152
154 enum class State {
161 };
162
170 {
171 public:
191 virtual void onServiceStateChanged(State state, QResult reason) {}
202 virtual void onUserMessage(uint64_t userId, PanoData data) {}
213 virtual void onSubscribeResult(const char *topic, QResult result) {}
228 virtual void onTopicMessage(const char *topic, uint64_t userId, PanoData data, double timestamp) {}
243 virtual void onPublishTopicMessageFailed(const char *topic, uint64_t userId, uint32_t requestId, QResult reason) {}
254 virtual void onPropertyChanged(PropertyAction *props, int count) {}
255
256 virtual ~Callback() {};
257 };
258
259protected:
260 virtual ~RtcMessage() {}
261};
262
263PANORTC_NS_END
QResult
返回值
Definition: PanoRtcDefs.h:54
RtcMessage的回调函数,在使用RtcMessage之前必须要设置回调以获取事件通知。
Definition: PanoRtcMessage.h:170
virtual void onPropertyChanged(PropertyAction *props, int count)
消息服务属性变更通知
Definition: PanoRtcMessage.h:254
virtual void onPublishTopicMessageFailed(const char *topic, uint64_t userId, uint32_t requestId, QResult reason)
用户主题消息发送失败通知
Definition: PanoRtcMessage.h:243
virtual void onTopicMessage(const char *topic, uint64_t userId, PanoData data, double timestamp)
用户主题消息通知
Definition: PanoRtcMessage.h:228
virtual void onServiceStateChanged(State state, QResult reason)
消息服务状态变更的通知
Definition: PanoRtcMessage.h:191
virtual void onSubscribeResult(const char *topic, QResult result)
主题消息订阅成功与否的通知
Definition: PanoRtcMessage.h:213
virtual void onUserMessage(uint64_t userId, PanoData data)
用户消息通知
Definition: PanoRtcMessage.h:202
RtcMessage, 消息服务核心接口
Definition: PanoRtcMessage.h:18
virtual QResult setCallback(Callback *callback)=0
设置消息服务的回调。
virtual QResult subscribe(const char *topic)=0
订阅一个主题。
State
消息服务状态。
Definition: PanoRtcMessage.h:154
virtual QResult setProperty(const char *name, PanoData value)=0
设置或更新消息服务属性
virtual QResult unsubscribe(const char *topic)=0
取消订阅一个主题。
virtual QResult broadcastMessage(PanoData data, bool sendBack=false)=0
广播消息。
virtual QResult sendMessage(uint64_t userId, PanoData data)=0
发送消息给指定用户。
virtual QResult publish(const char *topic, PanoData data, uint32_t requestId=0)=0
发布一个主题。
数据类型
Definition: PanoRtcDefs.h:1256
属性操作类型
Definition: PanoRtcDefs.h:1267