ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/Spectre2/Daemon.hpp
Revision: 402
Committed: 2004-12-29T22:38:37-08:00 (20 years, 5 months ago) by douglas
File size: 646 byte(s)
Log Message:
It bogles the mind!

File Contents

# User Rev Content
1 douglas 402 // 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    
19     class Daemon
20     {
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();
27     private:
28     _H<api::Thread> thread;
29     public:
30     virtual ~Daemon() { thread->Join(); }
31     void reload() { loaded = false; }
32     void stop() { running = false; }
33     };
34    
35     #endif // _Daemon_hpp_

Properties

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