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
15namespace lldb_private {
16
18public:
19 using Callback = std::function<void()>;
20
21 MemoryMonitor(Callback callback) : m_callback(callback) {}
22 virtual ~MemoryMonitor() = default;
23
24 /// MemoryMonitor is not copyable.
25 /// @{
26 MemoryMonitor(const MemoryMonitor &) = delete;
28 /// @}
29
30 static std::unique_ptr<MemoryMonitor> Create(Callback callback);
31
32 virtual void Start() = 0;
33 virtual void Stop() = 0;
34
35protected:
37};
38
39} // namespace lldb_private
40
41#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.