7 |
|
#ifndef _Daemon_hpp_ |
8 |
|
#define _Daemon_hpp_ |
9 |
|
|
10 |
< |
#include "Share.hpp" |
10 |
> |
#include "Spectre2.hpp" |
11 |
|
|
12 |
|
#ifndef MENES_PRAGMA_ONCE |
13 |
|
#pragma once |
17 |
|
#include <menes-etl/fnbind.hpp> |
18 |
|
#include <menes-ext/threadset.hpp> |
19 |
|
|
20 |
+ |
class Share; |
21 |
+ |
|
22 |
|
class Daemon |
23 |
|
{ |
24 |
|
private: |
26 |
|
static ext::String secret; |
27 |
|
#endif |
28 |
|
const api::Path& config; |
27 |
– |
ext::RedBlackSet<Share> shares; |
29 |
|
bool running, loaded; |
30 |
|
_H<api::Thread> thread; |
31 |
|
int loop(); |
35 |
|
public: |
36 |
|
Daemon(const ext::String& config) : config(config), running(true), loaded(false), thread(new api::Thread(etl::BindAll(&Daemon::loop, this))) {} |
37 |
|
~Daemon(); |
38 |
+ |
static ext::RedBlackSet<Share> shares; |
39 |
|
void reload() { loaded = false; } |
40 |
|
void stop() { running = false; } |
41 |
|
}; |