summaryrefslogtreecommitdiffhomepage
path: root/options/scoped.hpp
blob: fd797219050b4a95783a0231f9d6d607c707c21b (plain)
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
#pragma once

#include "bundle.hpp"
#include <QString>

#include "export.hpp"

#include <atomic>

namespace options {

struct OPENTRACK_OPTIONS_EXPORT opts
{
    bundle b;
    opts(const QString& name);
    opts& operator=(const opts&) = delete;
    opts(const opts&) = delete;
    ~opts();

    // XXX hack: the flag shouldn't be here as action at distance -sh 20160926
    static void set_teardown_flag(bool value);
    static bool is_tracker_teardown();
private:
    static std::atomic_bool teardown_flag;
    static void ensure_thread();
};

}