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 403 by douglas, 2004-12-29T22:57:50-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 15 | Line 15
15  
16   #include <menes-api/threads.hpp>
17   #include <menes-etl/fnbind.hpp>
18 + #include <menes-ext/threadset.hpp>
19  
20   class Daemon
21   {
21 protected:
22        bool running, loaded;
23        virtual void load()/*=0*/;
24        virtual void run()/*=0*/;
25        Daemon();
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 +        void load();
32 +        template <typename Worker>
33 +                int work();
34   public:
35 <        virtual ~Daemon() { thread->Join(); }
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   };
40  
41 < #endif // _Daemon_hpp_
41 > #endif//_Daemon_hpp_

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines