aboutsummaryrefslogtreecommitdiff
path: root/include/lldb/Initialization/SystemLifetimeManager.h
blob: 2dd7b22c240a494a04f630be2b420ecac8f63758 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//===-- SystemLifetimeManager.h -------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef LLDB_INITIALIZATION_SYSTEM_LIFETIME_MANAGER_H
#define LLDB_INITIALIZATION_SYSTEM_LIFETIME_MANAGER_H

#include "lldb/lldb-private-types.h"

#include <memory>
#include <mutex>

namespace lldb_private
{
class SystemInitializer;

class SystemLifetimeManager
{
  public:
    SystemLifetimeManager();
    ~SystemLifetimeManager();

    void Initialize(std::unique_ptr<SystemInitializer> initializer, LoadPluginCallbackType plugin_callback);
    void Terminate();

  private:
      std::recursive_mutex m_mutex;
      std::unique_ptr<SystemInitializer> m_initializer;
      bool m_initialized;

      // Noncopyable.
      SystemLifetimeManager(const SystemLifetimeManager &other) = delete;
      SystemLifetimeManager &
      operator=(const SystemLifetimeManager &other) = delete;
};
}

#endif