File: monitor.cc

package info (click to toggle)
stealth 1.47.4-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 780 kB
  • ctags: 190
  • sloc: cpp: 1,710; makefile: 155; sh: 62
file content (28 lines) | stat: -rw-r--r-- 782 bytes parent folder | download | duplicates (3)
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
#include "monitor.ih"

/*
    Since the Monitor's destruction is also the termination of the program, no
explicit destruction of the newly created objects is necessary. A pointer is
used to prevent the construction of a constant object. As the constructor
itself would create a constant object, the construction *new... 
is used.

*/

Monitor::Monitor(ConfigSorter &sorter, Reporter &reporter, Scanner &scanner)
:
    d_scanner(scanner),
    d_sorter(sorter),
    d_reporter(reporter)
{
    if (Util::keepAlive())
        s_mode = KEEP_ALIVE;

    d_scanner.preamble();

    signal(SIGHUP,  Monitor::handleProcessSignals);
    signal(SIGTERM, Monitor::handleProcessSignals);
    signal(SIGUSR1, Monitor::handleProcessSignals);
    signal(SIGUSR2, Monitor::handleProcessSignals);
}