diff options
author | Henri Herscher <henri@oreka.org> | 2005-10-20 13:40:58 +0000 |
---|---|---|
committer | Henri Herscher <henri@oreka.org> | 2005-10-20 13:40:58 +0000 |
commit | 7e1d63dd9fd149e4934bf77095c8610fac786b04 (patch) | |
tree | 5fe486a1b0300c3b84fb559107a868e5cc2c95da /orkaudio/Daemon.h | |
parent | 467768fc956fc3e5a253373f26c71c681b31b6b8 (diff) |
First checkin
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@2 09dcff7a-b715-0410-9601-b79a96267cd0
Diffstat (limited to 'orkaudio/Daemon.h')
-rw-r--r-- | orkaudio/Daemon.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/orkaudio/Daemon.h b/orkaudio/Daemon.h new file mode 100644 index 0000000..e19fff7 --- /dev/null +++ b/orkaudio/Daemon.h @@ -0,0 +1,47 @@ +/* + * Oreka -- A media capture and retrieval platform + * + * Copyright (C) 2005, orecx LLC + * + * http://www.orecx.com + * + * This program is free software, distributed under the terms of + * the GNU General Public License. + * Please refer to http://www.gnu.org/copyleft/gpl.html + * + */ + +#ifndef __DAEMON_H__ +#define __DAEMON_H__ + +#include "StdString.h" +#include "ace/Singleton.h" +#include "ace/Thread_Mutex.h" + +typedef void (*DaemonHandler)(void); + +class Daemon +{ +public: + //void Initialize(CStdString serviceName, void (*RunHandler)(void), void(*StopHandler)(void)); + void Initialize(CStdString serviceName, DaemonHandler runHandler, DaemonHandler stopHandler); + void Start(); + void Stop(); + void Install(); + void Uninstall(); +private: +#ifdef WIN32 + static void WINAPI Run( DWORD /*argc*/, TCHAR* /*argv*/[] ); +#else + static void Run(); +#endif + + DaemonHandler m_runHandler; + DaemonHandler m_stopHandler; + CStdString m_serviceName; +}; + +typedef ACE_Singleton<Daemon, ACE_Thread_Mutex> DaemonSingleton; + +#endif + |