Ignore:
Timestamp:
03/27/14 12:53:43 (10 years ago)
Author:
Marek Kurdej
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/ProducerConsumerExample/ProducerExample.h

    r176 r291  
    1616#include <Pacpus/kernel/road_time.h>
    1717//#include <Pacpus/structure/genericStructures.h>
    18 #include <QThread>
     18
     19#include <boost/asio.hpp>
     20#include <boost/date_time/posix_time/posix_time_types.hpp>
     21#include <fstream>
    1922#include <QImage>
    2023
    21 namespace pacpus {                                                                             
     24namespace pacpus
     25{
    2226
    2327class PRODUCERCONSUMEREXAMPLE_API ProducerExample
    24         : public QThread
    25         , public ComponentBase
     28    : public QObject
     29    , public ComponentBase
    2630{
    2731    Q_OBJECT
     
    4145    virtual COMPONENT_CONFIGURATION configureComponent(XmlComponentConfig config);
    4246
    43 protected:
    44     void run();
    45 
    46 public Q_SLOTS:
     47private:
     48    void produce(int& counter);
    4749
    4850private:
    4951    std::string mOutputFileName;
    50     //QThread thread;
     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;
    5159};
    5260
Note: See TracChangeset for help on using the changeset viewer.