LLDB mainline
MemoryMonitor.h
Go to the documentation of this file.
1//===-- MemoryMonitor.h ---------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_HOST_MEMORYMONITOR_H
10#define LLDB_HOST_MEMORYMONITOR_H
11
12#include <functional>
13#include <memory>
14#include <utility>
15
16namespace lldb_private {
17
19public:
20 using Callback = std::function<void()>;
21
22 MemoryMonitor(Callback callback) : m_callback(std::move(callback)) {}
23 virtual ~MemoryMonitor() = default;
24
25 /// MemoryMonitor is not copyable.
26 /// @{
27 MemoryMonitor(const MemoryMonitor &) = delete;
29 /// @}
30
31 static std::unique_ptr<MemoryMonitor> Create(Callback callback);
32
33 virtual void Start() = 0;
34 virtual void Stop() = 0;
35
36protected:
38};
39
40} // namespace lldb_private
41
42#endif
MemoryMonitor(const MemoryMonitor &)=delete
MemoryMonitor is not copyable.
MemoryMonitor(Callback callback)
static std::unique_ptr< MemoryMonitor > Create(Callback callback)
virtual ~MemoryMonitor()=default
MemoryMonitor & operator=(const MemoryMonitor &)=delete
std::function< void()> Callback
A class that represents a running process on the host machine.