-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathIDataInspector.hpp
79 lines (68 loc) · 2.95 KB
/
IDataInspector.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
72
73
74
75
76
77
78
//
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
//
#ifndef IDATAINSPECTOR_HPP
#define IDATAINSPECTOR_HPP
#include "EventProperty.hpp"
#include "ctmacros.hpp"
#include "CsProtocol_types.hpp"
#include <functional>
#include <memory>
#include <string>
#include <vector>
namespace MAT_NS_BEGIN
{
/// <summary>
/// This interface allows SDK users to register a data inspector
/// that will inspect the data being uploaded by the SDK.
/// </summary>
class IDataInspector
{
public:
/// <summary>
/// Default virtual destructor
/// </summary>
virtual ~IDataInspector() = default;
/// <summary>
/// Set the enabled state at runtime for the inspector.
/// </summary>
/// <param name="isEnabled">Boolean value to denote whether the inspector is enabled or not.</param>
virtual void SetEnabled(bool isEnabled) noexcept = 0;
/// <summary>
/// Get the current state for the inspector.
/// </summary>
/// <returns>True if the data inspector is enabled, False otherwise.</returns>
virtual bool IsEnabled() const noexcept = 0;
/// <summary>
/// Iterate and inspect the given record's Part-B and
/// Part-C properties
/// </summary>
/// <param name="record">Record to inspect</param>
/// <returns>Always returns true.</returns>
virtual bool InspectRecord(::CsProtocol::Record& record) noexcept = 0;
/// <summary>
/// Inspect an ISemanticContext value.
/// </summary>
/// <param name="contextName">Name of the Context</param>
/// <param name="contextValue">Value of the Context</param>
/// <param name="isGlobalContext">Whether this is a global/logmanager Context or local ILogger context</param>
/// <param name="associatedTenant">(Optional) Tenant associated with the Context</param>
virtual void InspectSemanticContext(const std::string& contextName, const std::string& contextValue, bool isGlobalContext, const std::string& associatedTenant) noexcept = 0;
/// <summary>
/// Inspect an ISemanticContext value.
/// </summary>
/// <param name="contextName">Name of the Context</param>
/// <param name="contextValue">Value of the Context</param>
/// <param name="isGlobalContext">Whether this is a global/logmanager Context or local ILogger context</param>
/// <param name="associatedTenant">(Optional) Tenant associated with the Context</param>
virtual void InspectSemanticContext(const std::string& contextName, GUID_t contextValue, bool isGlobalContext, const std::string& associatedTenant) noexcept = 0;
/// <summary>
/// Returns unique name for current Data Inspector
/// </summary>
/// <returns>Name of Data Inspector</returns>
virtual const char* GetName() const noexcept = 0;
};
}
MAT_NS_END
#endif