File: processClass.h

package info (click to toggle)
procserv 2.8.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,356 kB
  • sloc: sh: 4,154; cpp: 1,715; ansic: 1,417; python: 870; makefile: 65
file content (43 lines) | stat: -rwxr-xr-x 1,176 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Process server for soft ioc
// David H. Thompson 8/29/2003
// Ralph Lange <ralph.lange@gmx.de> 2007-2016
// GNU Public License (GPLv3) applies - see www.gnu.org


#ifndef processClassH
#define processClassH

#include "procServ.h"

#ifdef __CYGWIN__
#include <windows.h>
#endif /* __CYGWIN__ */

class processClass : public connectionItem
{
friend connectionItem * processFactory(char *exe, char *argv[]);
friend bool processFactoryNeedsRestart();
friend void processFactorySendSignal(int signal);
public:
    processClass(char *exe, char *argv[]);
    void readFromFd(void);
    int Send(const char *,int);
    void markDeadIfChildIs(pid_t pid) { if (pid==_pid) _markedForDeletion=true; }
    char factoryName[100];
    virtual bool isProcess() const { return true; }
    virtual bool isLogger() const { return false; }
    static void restartOnce ();
    static bool exists() { return _runningItem ? true : false; }
    virtual ~processClass();
protected:
    pid_t _pid;
    static processClass * _runningItem;
    static time_t _restartTime;
    void terminateJob();
#ifdef __CYGWIN__
    HANDLE _hwinjob;
#endif /* __CYGWIN__ */
};


#endif /* #ifndef processClassH */