Dummy module

Module dummy is a simple module intended as a template for creating new modules.

Header file

 1: #ifndef DUMMYMODULE_H_
 2: #define DUMMYMODULE_H_
 3:
 4: #include "yuri/io/BasicIOThread.h"
 5:
 6: namespace yuri {
 7: namespace dummy_module {
 8: using yuri::log::Log;
 9: using yuri::config::Parameter;
10: using yuri::config::Parameters;
11: using yuri::io::pThreadBase;
12:
13: class DummyModule: public yuri::io::BasicIOThread
14: {
15: public:
16:     IO_THREAD_GENERATOR_DECLARATION
17:     static shared_ptr<Parameters> configure();
18:     virtual ~DummyModule();
19: private:
20:     DummyModule(Log &log_,pThreadBase parent,Parameters &parameters);
21:     virtual bool step();
22:     virtual bool set_param(Parameter& param);
23:     std::string dummy_name;
24: };
25:
26: } /* namespace dummy_module */
27: } /* namespace yuri */
28: #endif /* DUMMYMODULE_H_ */

Include header for basic IO class

4: #include "yuri/io/BasicIOThread.h"

Publicly derive from yuri::io::BasicIOThread

13: class DummyModule: public yuri::io::BasicIOThread

Use macro to declare a generator

16: IO_THREAD_GENERATOR_DECLARATION

Declare configure method to provide default configuration

17: static shared_ptr<Parameters> configure();

Optionally declare method set_param() for setting parameters

23: virtual bool set_param(Parameter& param);
 
yuri/module/dummy.txt · Last modified: 2013/02/12 19:17 by neneko
 
Except where otherwise noted, content on this wiki is licensed under the following license: GNU Free Documentation License 1.3
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki