1/*
2    Title:  rts_module.h - Base class for the run-time system modules.
3
4    Copyright (c) 2006, 2011, 2016, 2020 David C.J. Matthews
5
6    This library is free software; you can redistribute it and/or
7    modify it under the terms of the GNU Lesser General Public
8    License version 2.1 as published by the Free Software Foundation.
9
10    This library is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    Lesser General Public License for more details.
14
15    You should have received a copy of the GNU Lesser General Public
16    License along with this library; if not, write to the Free Software
17    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
19*/
20
21#ifndef RTS_MODULE_H_INCLUDED
22#define RTS_MODULE_H_INCLUDED
23
24class ScanAddress;
25class TaskData;
26
27class RtsModule
28{
29public:
30    RtsModule() { RegisterModule(); }
31    virtual ~RtsModule() {} // To keep GCC happy
32
33    virtual void Init(void) {}
34    virtual void Start(void) {}
35    virtual void Stop(void) {}
36    virtual void GarbageCollect(ScanAddress * /*process*/) {}
37    virtual void ForkChild(void) {} // Called in the child process after a Unix fork.
38private:
39    void RegisterModule(void);
40};
41
42void InitModules(void);
43void StartModules(void);
44void StopModules(void);
45void GCModules(ScanAddress *process);
46void ForkChildModules(void);
47
48#endif
49
50