source: pacpusframework/trunk/examples/ProducerConsumerExample/ProducerExample.h@ 291

Last change on this file since 291 was 291, checked in by Marek Kurdej, 10 years ago

Reworked threading in InputInterfaceBase, each slot has its own processing thread.

File size: 1.2 KB
Line 
1/**
2@file
3Purpose: Lidar Detection
4
5@date created 2010-06-03 16:13
6@author Julien Moras
7@version $Id: $
8*/
9
10#ifndef PRODUCEREXAMPLE_H
11#define PRODUCEREXAMPLE_H
12
13#include "ProducerConsumerExampleConfig.h"
14
15#include <Pacpus/kernel/ComponentBase.h>
16#include <Pacpus/kernel/road_time.h>
17//#include <Pacpus/structure/genericStructures.h>
18
19#include <boost/asio.hpp>
20#include <boost/date_time/posix_time/posix_time_types.hpp>
21#include <fstream>
22#include <QImage>
23
24namespace pacpus
25{
26
27class PRODUCERCONSUMEREXAMPLE_API ProducerExample
28 : public QObject
29 , public ComponentBase
30{
31 Q_OBJECT
32
33public:
34 static const char * COMPONENT_TYPE;
35
36 ProducerExample(QString name);
37 ~ProducerExample();
38
39 virtual void addInputs();
40 virtual void addOutputs();
41
42 virtual void startActivity();
43 virtual void stopActivity();
44
45 virtual COMPONENT_CONFIGURATION configureComponent(XmlComponentConfig config);
46
47private:
48 void produce(int& counter);
49
50private:
51 std::string mOutputFileName;
52
53 std::fstream mFile;
54 OutputInterface<QImage, ProducerExample>* mImageOutput;
55
56 boost::asio::io_service mIo;
57 boost::posix_time::time_duration mInterval;
58 boost::asio::deadline_timer mTimer;
59};
60
61} // namespace pacpus
62
63#endif // PRODUCEREXAMPLE_H
Note: See TracBrowser for help on using the repository browser.