HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
isink.h
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License.
3 
4 #pragma once
5 
6 #include <string>
7 
10 
11 namespace onnxruntime {
12 namespace logging {
13 class ISink {
14  public:
15  explicit ISink(SinkType type = SinkType::BaseSink) : type_(type) {}
16 
17  SinkType GetType() const { return type_; }
18 
19  /**
20  Sends the message to the sink.
21  @param timestamp The timestamp.
22  @param logger_id The logger identifier.
23  @param message The captured message.
24  */
25  void Send(const Timestamp& timestamp, const std::string& logger_id, const Capture& message) {
26  SendImpl(timestamp, logger_id, message);
27  }
28 
29  /**
30  Sends a Profiling Event Record to the sink.
31  @param Profiling Event Record
32  */
33  virtual void SendProfileEvent(profiling::EventRecord&) const {};
34 
35  virtual ~ISink() = default;
36 
37  private:
38  SinkType type_;
39 
40  // Make Code Analysis happy by disabling all for now. Enable as needed.
41  ORT_DISALLOW_COPY_ASSIGNMENT_AND_MOVE(ISink);
42 
43  virtual void SendImpl(const Timestamp& timestamp, const std::string& logger_id, const Capture& message) = 0;
44 };
45 } // namespace logging
46 } // namespace onnxruntime
GLuint GLsizei const GLchar * message
Definition: glcorearb.h:2543
SinkType GetType() const
Definition: isink.h:17
void Send(const Timestamp &timestamp, const std::string &logger_id, const Capture &message)
Definition: isink.h:25
virtual ~ISink()=default
std::chrono::time_point< std::chrono::system_clock > Timestamp
Definition: logging.h:59
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:108
ISink(SinkType type=SinkType::BaseSink)
Definition: isink.h:15
virtual void SendProfileEvent(profiling::EventRecord &) const
Definition: isink.h:33