[cosmetic] cleanup copyright headers
[vuplus_xbmc] / xbmc / windowing / tests / wayland / WestonProcess.h
1 #pragma once
2
3 /*
4  *      Copyright (C) 2005-2013 Team XBMC
5  *      http://xbmc.org
6  *
7  *  This Program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2, or (at your option)
10  *  any later version.
11  *
12  *  This Program is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  *  GNU General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with XBMC; see the file COPYING.  If not, see
19  *  <http://www.gnu.org/licenses/>.
20  *
21  */
22 #include "system.h"
23
24 #include <boost/noncopyable.hpp>
25
26 #ifdef UNICODE
27   typedef CStdStringW        CStdString;
28 #else
29   typedef CStdStringA        CStdString;
30 #endif
31
32 typedef int32_t pid_t;
33
34 namespace xbmc
35 {
36 namespace test
37 {
38 class Process :
39   boost::noncopyable
40 {
41 public:
42
43   Process(const CStdString &base,
44           const CStdString &socket);
45   ~Process();
46
47   void WaitForSignal(int signal, int timeout);
48   void WaitForStatus(int status, int timeout);
49
50   void Interrupt();
51   void Terminate();
52   void Kill();
53   
54   pid_t Pid();
55   
56   static const int DefaultProcessWaitTimeout = 3000; // 3000ms
57
58 private:
59   
60   void SendSignal(int signal);
61   
62   void Child(const char *program,
63              char * const *options);
64   void ForkError();
65   void Parent();
66   
67   pid_t m_pid;
68 };
69 }
70 }