ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/Spectre2/Daemon.hpp
(Generate patch)

Comparing Spectre2/Daemon.hpp (file contents):
Revision 428 by douglas, 2005-03-24T17:38:00-08:00 vs.
Revision 429 by douglas, 2005-03-25T18:47:25-08:00

# Line 7 | Line 7
7   #ifndef _Daemon_hpp_
8   #define _Daemon_hpp_
9  
10 < #include "Spectre2.hpp"
10 > #include "Share.hpp"
11  
12   #ifndef MENES_PRAGMA_ONCE
13   #pragma once
# Line 20 | Line 20
20   class Daemon
21   {
22   private:
23 + #ifdef __FreeBSD__
24 +        static ext::String secret;
25 + #endif
26 +        const api::Path& config;
27 +        ext::RedBlackSet<Share> shares;
28 +        bool running, loaded;
29          _H<api::Thread> thread;
30          int loop();
31 < protected:
32 <        bool running, loaded;
33 <        virtual void load() = 0;
28 <        virtual void run() = 0;
29 <        Daemon() : running(false), loaded(false) {}
31 >        void load();
32 >        template <typename Worker>
33 >                int work();
34   public:
35 <        virtual ~Daemon() { if (!thread.IsEmpty()) thread->Join(); }
36 <        void start();
33 <        void wait();
35 >        Daemon(const ext::String& config) : config(config), running(true), loaded(false), thread(new api::Thread(etl::BindAll(&Daemon::loop, this))) {}
36 >        ~Daemon();
37          void reload() { loaded = false; }
38          void stop() { running = false; }
39   };

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines