ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/Spectre2/Daemon.hpp
Revision: 430
Committed: 2005-03-25T19:01:08-08:00 (20 years, 2 months ago) by douglas
File size: 796 byte(s)
Log Message:
Make some things actually work, not all of them yet though.

File Contents

# Content
1 // Spectre 2
2 //
3 // Douglas Thrift
4 //
5 // $Id$
6
7 #ifndef _Daemon_hpp_
8 #define _Daemon_hpp_
9
10 #include "Spectre2.hpp"
11
12 #ifndef MENES_PRAGMA_ONCE
13 #pragma once
14 #endif
15
16 #include <menes-api/threads.hpp>
17 #include <menes-etl/fnbind.hpp>
18 #include <menes-ext/threadset.hpp>
19
20 class Share;
21
22 class Daemon
23 {
24 private:
25 #ifdef __FreeBSD__
26 static ext::String secret;
27 #endif
28 const api::Path& config;
29 bool running, loaded;
30 _H<api::Thread> thread;
31 int loop();
32 void load();
33 template <typename Worker>
34 int work();
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 };
42
43 #endif//_Daemon_hpp_

Properties

Name Value
svn:eol-style native
svn:keywords Id