-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathIDataViewerCollection.hpp
72 lines (60 loc) · 2.39 KB
/
IDataViewerCollection.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
//
#ifndef IDATAVIEWERCOLLECTION_HPP
#define IDATAVIEWERCOLLECTION_HPP
#include "IDataViewer.hpp"
#include "ctmacros.hpp"
#include <memory>
namespace MAT_NS_BEGIN
{
/// <summary>
/// This interface allows SDK users to register a data viewer
/// that will receive all packets uploaded by the SDK.
/// </summary>
class IDataViewerCollection
{
public:
/// <summary>
/// Dispatch a Data Viewer Event to all viewers in the collection.
/// </summary>
/// <param name="packetData">Data packet to be passed to all viewers.</param>
virtual void DispatchDataViewerEvent(const std::vector<uint8_t>& packetData) const noexcept = 0;
/// <summary>
/// Register an IDataViewer with Data Viewer Collection.
/// </summary>
/// <param name="dataViewer">dataViewer to register with IDataViewerCollection.</param>
virtual void RegisterViewer(const std::shared_ptr<IDataViewer>& dataViewer) = 0;
/// <summary>
/// Unregister a IDataViewer from LogManager.
/// </summary>
/// <param name="viewerName">
/// Unique Name to identify the viewer that should be unregistered from the IDataViewerCollection.
/// </param>
virtual void UnregisterViewer(const char* viewerName) = 0;
/// <summary>
/// Unregister all registered IDataViewers.
/// </summary>
virtual void UnregisterAllViewers() = 0;
/// <summary>
/// Check if the given viewer (name) is registered as a data viewer and is actively transmitting.
/// </summary>
/// <param name="viewerName">
/// Unique Name to identify the viewer being checked.
/// </param>
virtual bool IsViewerEnabled(const char* viewerName) const = 0;
/// <summary>
/// Check if any viewers are registered and actively transmitting.
/// </summary>
virtual bool IsViewerEnabled() const noexcept = 0;
/// <summary>
/// Check if the given viewer (name) is registered as a data viewer.
/// </summary>
/// <param name="viewerName">
/// Unique Name to identify the viewer being checked.
/// </param>
virtual bool IsViewerRegistered(const char* viewerName) const = 0;
};
} MAT_NS_END
#endif