// Spectre 2 // // Douglas Thrift // // $Id$ #ifndef _Daemon_hpp_ #define _Daemon_hpp_ #include "Share.hpp" #ifndef MENES_PRAGMA_ONCE #pragma once #endif #include #include #include class Daemon { private: #ifdef __FreeBSD__ static ext::String secret; #endif const api::Path& config; ext::RedBlackSet shares; bool running, loaded; _H thread; int loop(); void load(); template int work(); public: Daemon(const ext::String& config) : config(config), running(true), loaded(false), thread(new api::Thread(etl::BindAll(&Daemon::loop, this))) {} ~Daemon(); void reload() { loaded = false; } void stop() { running = false; } }; #endif//_Daemon_hpp_