Contur 2
Educational OS kernel simulator
Loading...
Searching...
No Matches
file_sink.h
Go to the documentation of this file.
1
3
4#pragma once
5
6#include <memory>
7#include <string>
8
10
11namespace contur {
12
14 class FileSink final : public ITraceSink
15 {
16 public:
19 explicit FileSink(std::string filePath);
20
22 ~FileSink() override;
23
25 FileSink(const FileSink &) = delete;
26
28 FileSink &operator=(const FileSink &) = delete;
30 FileSink(FileSink &&) noexcept;
31
33 FileSink &operator=(FileSink &&) noexcept;
34
36 void write(const TraceEvent &event) override;
37
38 private:
39 struct Impl;
40 std::unique_ptr<Impl> impl_;
41 };
42
43} // namespace contur
FileSink(const FileSink &)=delete
Copy construction is disabled.
FileSink(FileSink &&) noexcept
Move-constructs sink state.
~FileSink() override
Destroys file sink.
std::unique_ptr< Impl > impl_
Definition file_sink.h:40
FileSink & operator=(const FileSink &)=delete
Copy assignment is disabled.
FileSink(std::string filePath)
Constructs a file sink for the given path.
void write(const TraceEvent &event) override
Writes one trace event to the sink.
Sink interface that receives structured trace events.
Definition trace_sink.h:12
Definition block.h:15
Structured trace event record.
Definition trace_event.h:21
Trace sink interface for trace event consumers.