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 402 by douglas, 2004-12-29T22:38:37-08:00 vs.
Revision 430 by douglas, 2005-03-25T19:01:08-08:00

# 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 Share;
21  
22   class Daemon
23   {
21 protected:
22        bool running, loaded;
23        virtual int loop();
24        virtual void load() { api::Cerr << this << ios::NewLine; loaded = true; }//=0;
25        virtual void run() { api::Cerr << this << ios::NewLine; running = false; }//=0;
26        Daemon();
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 <        virtual ~Daemon() { thread->Join(); }
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_
43 > #endif//_Daemon_hpp_

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines