/[projects]/smsdaemon/Plugin.h
ViewVC logotype

Annotation of /smsdaemon/Plugin.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 45 - (hide annotations) (download)
Wed Jun 11 09:00:56 2008 UTC (15 years, 11 months ago) by torben
Original Path: smsdaemon/plugins/Plugin.h
File MIME type: text/plain
File size: 935 byte(s)
CMakeLists.txt added a smsdaemon core library in order to ease testing.

The other changes is to make this new library work correctly

1 torben 26 #ifndef __PLUGIN_H__
2     #define __PLUGIN_H__
3    
4     #include <string>
5    
6     /*
7     * Abstract parent class for a sms-daemon plugin.
8     */
9    
10     #include "Sms.h"
11    
12 torben 44 class IGsmModem;
13 torben 26
14     class Plugin
15     {
16     public:
17 torben 28 Plugin(std::string cmd, std::string desc);
18 torben 26
19     /* Called when a incomming sms triggers this plugin.
20     * Use the conversation object to write the response.
21     * Note: the plugin is responsible for parsing and validating the arguments,
22     * and if necessary write a error message back to the user.
23     */
24 torben 44 virtual void Execute(IGsmModem& modem, SMS& sms) = 0;
25 torben 26
26     /*
27     * returns the command that triggers this plugin, for example: "myplugin"
28     */
29 torben 28 virtual std::string GetCommand() {return _command;}
30 torben 26
31     /*
32     * Returns a desciption of this plugin - displayed when somebody calls "help"
33     */
34 torben 28 virtual std::string GetDescription() {return _description;}
35 torben 26
36     virtual ~Plugin() {}
37 torben 28 protected:
38 torben 30
39     std::string _command;
40 torben 28 std::string _description;
41 torben 26 };
42    
43    
44     #endif // __PLUGIN_H__

  ViewVC Help
Powered by ViewVC 1.1.20