Safir SDK Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ProcessMonitor.h
Go to the documentation of this file.
1 /******************************************************************************
2 *
3 * Copyright Saab AB, 2007-2013 (http://safir.sourceforge.net)
4 *
5 * Created by: Jonas Thor / stjth
6 *
7 *******************************************************************************
8 *
9 * This file is part of Safir SDK Core.
10 *
11 * Safir SDK Core is free software: you can redistribute it and/or modify
12 * it under the terms of version 3 of the GNU General Public License as
13 * published by the Free Software Foundation.
14 *
15 * Safir SDK Core is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with Safir SDK Core. If not, see <http://www.gnu.org/licenses/>.
22 *
23 ******************************************************************************/
24 #ifndef __PROCESS_MONITOR_H__
25 #define __PROCESS_MONITOR_H__
26 
27 #include <Safir/Utilities/Internal/UtilsExportDefs.h>
29 #include <boost/function.hpp>
30 #include <boost/shared_ptr.hpp>
31 
32 namespace Safir
33 {
34 namespace Utilities
35 {
36  class ProcessMonitorImpl;
37 
38  class LLUF_UTILS_API ProcessMonitor
39  {
40  public:
41  typedef boost::function<void(const pid_t pid)> OnTerminateCb;
42 
44  ~ProcessMonitor();
45 
54  void Init(const OnTerminateCb& callback);
55 
56 
62  void StartMonitorPid(const pid_t pid);
63 
69  void StopMonitorPid(const pid_t pid);
70 
71  private:
72 
73 #ifdef _MSC_VER
74 #pragma warning (push)
75 #pragma warning (disable: 4251)
76 #endif
77 
78  boost::shared_ptr<ProcessMonitorImpl> m_impl;
79 
80 #ifdef _MSC_VER
81 #pragma warning (pop)
82 #endif
83  };
84 
85 }
86 }
87 
88 #endif
89 
boost::function< void(const pid_t pid)> OnTerminateCb
Definition: ProcessMonitor.h:41
Definition: ProcessMonitor.h:38