Microsoft Information Protection SDK - C++ 1.17
API Reference Documentation for C++
Loading...
Searching...
No Matches
event.h
Go to the documentation of this file.
1/*
2 *
3 * Copyright (c) Microsoft Corporation.
4 * All rights reserved.
5 *
6 * This code is licensed under the MIT License.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files(the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions :
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 * THE SOFTWARE.
25 *
26 */
33#ifndef API_MIP_EVENT_H_
34#define API_MIP_EVENT_H_
35
36#include <chrono>
37#include <memory>
38#include <string>
39#include <vector>
40
42#include "mip/event_property.h"
43#include "mip/mip_namespace.h"
44
45MIP_NAMESPACE_BEGIN
46
50class Event {
51public:
57 virtual const std::string& GetName() const = 0;
58
64 virtual EventLevel GetLevel() const = 0;
65
71 virtual const std::chrono::steady_clock::time_point& GetStartTime() const = 0;
72
78 virtual void AddProperty(const std::shared_ptr<EventProperty>& prop) = 0;
79
86 virtual void AddProperty(const std::string& name, bool value) = 0;
87
95 virtual void AddProperty(const std::string& name, double value, Pii pii) = 0;
96
104 virtual void AddProperty(const std::string& name, int64_t value, Pii pii) = 0;
105
113 virtual void AddProperty(const std::string& name, const std::string& value, Pii pii) = 0;
114
124 virtual void AddAuditOnlyProperty(const std::string& name, const std::string& value) = 0;
125
131 virtual std::vector<std::shared_ptr<EventProperty>> GetProperties() const = 0;
132
140 virtual std::shared_ptr<EventProperty> GetProperty(const std::string& name) const = 0;
141
143 virtual ~Event() {}
144protected:
145 Event() {}
147};
148
149MIP_NAMESPACE_END
150#endif // API_MIP_EVENT_H_
151
A single audit/telemetry event.
Definition event.h:50
virtual const std::string & GetName() const =0
Get event name.
virtual const std::chrono::steady_clock::time_point & GetStartTime() const =0
Get event start time.
virtual void AddProperty(const std::string &name, const std::string &value, Pii pii)=0
Add a string property to the event.
virtual void AddProperty(const std::shared_ptr< EventProperty > &prop)=0
Add a property to the event.
virtual std::vector< std::shared_ptr< EventProperty > > GetProperties() const =0
Get all event properties.
virtual void AddAuditOnlyProperty(const std::string &name, const std::string &value)=0
Add an audit-only string property to the event.
virtual void AddProperty(const std::string &name, bool value)=0
Add a bool property to the event.
virtual void AddProperty(const std::string &name, int64_t value, Pii pii)=0
Add an int64 property to the event.
virtual void AddProperty(const std::string &name, double value, Pii pii)=0
Add a double property to the event.
virtual EventLevel GetLevel() const =0
Get level of event, indicating whether it is considered necessary service data (NSD) or not.
virtual std::shared_ptr< EventProperty > GetProperty(const std::string &name) const =0
Get property with the given name, if any.
File containing diagnostic-related types.
EventLevel
Description of event importance.
Definition diagnostic_types.h:86
Pii
Description of PII data, if any.
Definition diagnostic_types.h:47
A file containing the EventProperty class which describes a single audit/telemetry property.
MIP namespace macros.