Last change
on this file since 289 was 288, checked in by Marek Kurdej, 11 years ago |
Using boost::shared_ptr for storing components.
|
File size:
851 bytes
|
Rev | Line | |
---|
[163] | 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>
|
---|
[176] | 10 | #include <string>
|
---|
[163] | 11 |
|
---|
[288] | 12 | namespace pacpus
|
---|
| 13 | {
|
---|
[163] | 14 |
|
---|
| 15 | class PRODUCERCONSUMEREXAMPLE_API ConsumerExample
|
---|
[288] | 16 | : public QObject
|
---|
| 17 | , public ComponentBase
|
---|
[163] | 18 | {
|
---|
| 19 | Q_OBJECT
|
---|
| 20 |
|
---|
| 21 | public:
|
---|
| 22 | ConsumerExample(QString name);
|
---|
| 23 | ~ConsumerExample();
|
---|
| 24 |
|
---|
| 25 | virtual void stopActivity();
|
---|
| 26 | virtual void startActivity();
|
---|
| 27 | virtual COMPONENT_CONFIGURATION configureComponent(XmlComponentConfig config);
|
---|
| 28 | void process(const QImage& matrix);
|
---|
| 29 |
|
---|
| 30 | private:
|
---|
| 31 | virtual void addInputs();
|
---|
| 32 | virtual void addOutputs();
|
---|
| 33 |
|
---|
| 34 | QImage matrix;
|
---|
| 35 | QThread thread;
|
---|
| 36 |
|
---|
| 37 | int m_counter;
|
---|
| 38 | std::ofstream m_file;
|
---|
[176] | 39 |
|
---|
| 40 | std::string mOutputFileName;
|
---|
[163] | 41 | };
|
---|
| 42 |
|
---|
| 43 | } // namespace pacpus
|
---|
| 44 |
|
---|
| 45 | #endif // CONSUMEREXAMPLE_H
|
---|
Note:
See
TracBrowser
for help on using the repository browser.