enabled specifying numeric config values using all strtof capabilities
[clinton/Smoothieware.git] / src / libs / Module.h
1 /*
2 This file is part of Smoothie (http://smoothieware.org/). The motion control part is heavily based on Grbl (https://github.com/simen/grbl).
3 Smoothie is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
4 Smoothie is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
5 You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>.
6 */
7
8 #ifndef MODULE_H
9 #define MODULE_H
10
11 #include <string>
12 using std::string;
13
14 // See : http://smoothieware.org/listofevents
15
16 enum _EVENT_ENUM {
17 #define EVENT(name, func) name,
18 #include "Event.h"
19 #undef EVENT
20 NUMBER_OF_DEFINED_EVENTS
21 };
22
23 class Module;
24
25 typedef void (Module::*ModuleCallback)(void * argument);
26
27 extern const ModuleCallback kernel_callback_functions[NUMBER_OF_DEFINED_EVENTS];
28
29 // Module base class
30 // All modules must extend this class, see http://smoothieware.org/moduleexample
31 class Kernel;
32 class Module {
33 public:
34 Module();
35 virtual ~Module();
36 virtual void on_module_loaded();
37 void register_for_event( _EVENT_ENUM event_id);
38 #define EVENT(name, func) virtual void func (void*);
39 #include "Event.h"
40 #undef EVENT
41 };
42
43 #endif