Last change
on this file since 252 was 176, checked in by Marek Kurdej, 11 years ago |
Added: addParameters() method in ComponentBase using Boost.Program_Options.
Each component can declare its parameters and they will be read automatically before configureComponent() method.
See example ProducerConsumerExample constructors.
|
File size:
859 bytes
|
Line | |
---|
1 | #ifndef CONSUMEREXAMPLE_H
|
---|
2 | #define CONSUMEREXAMPLE_H
|
---|
3 |
|
---|
4 | #include "ProducerConsumerExampleConfig.h"
|
---|
5 |
|
---|
6 | #include <fstream>
|
---|
7 | #include <Pacpus/kernel/ComponentBase.h>
|
---|
8 | #include <QImage>
|
---|
9 | #include <QThread>
|
---|
10 | #include <string>
|
---|
11 |
|
---|
12 | namespace pacpus {
|
---|
13 |
|
---|
14 | class PRODUCERCONSUMEREXAMPLE_API ConsumerExample
|
---|
15 | : public QObject
|
---|
16 | , public ComponentBase
|
---|
17 | {
|
---|
18 | Q_OBJECT
|
---|
19 |
|
---|
20 | public:
|
---|
21 | ConsumerExample(QString name);
|
---|
22 | ~ConsumerExample();
|
---|
23 |
|
---|
24 | virtual void stopActivity();
|
---|
25 | virtual void startActivity();
|
---|
26 | virtual COMPONENT_CONFIGURATION configureComponent(XmlComponentConfig config);
|
---|
27 | void process(const QImage& matrix);
|
---|
28 |
|
---|
29 | private:
|
---|
30 | virtual void addInputs();
|
---|
31 | virtual void addOutputs();
|
---|
32 |
|
---|
33 | QImage matrix;
|
---|
34 | QThread thread;
|
---|
35 |
|
---|
36 | int m_counter;
|
---|
37 | std::ofstream m_file;
|
---|
38 |
|
---|
39 | std::string mOutputFileName;
|
---|
40 | };
|
---|
41 |
|
---|
42 | } // namespace pacpus
|
---|
43 |
|
---|
44 | #endif // CONSUMEREXAMPLE_H
|
---|
Note:
See
TracBrowser
for help on using the repository browser.