Changeset 293 in pacpusframework for trunk/examples/ProducerConsumerExample
- Timestamp:
- Mar 27, 2014, 3:50:21 PM (11 years ago)
- Location:
- trunk/examples/ProducerConsumerExample
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/ProducerConsumerExample/ConsumerExample.cpp
r291 r293 60 60 setState(MONITOR_OK); 61 61 LOG_INFO("started component '" << getName() << "'"); 62 63 moveToThread(&mThread); 64 mThread.start(); 62 65 } 63 66 … … 69 72 setState(STOPPED); 70 73 LOG_INFO("stopped component '" << getName() << "'"); 74 QMetaObject::invokeMethod(&mThread, "quit"); 71 75 } 72 76 -
trunk/examples/ProducerConsumerExample/ConsumerExample.h
r291 r293 7 7 #include <Pacpus/kernel/ComponentBase.h> 8 8 #include <QImage> 9 #include <QThread> 9 10 #include <string> 10 11 … … 37 38 38 39 std::string mOutputFileName; 40 QThread mThread; 39 41 }; 40 42 -
trunk/examples/ProducerConsumerExample/ProducerExample.cpp
r291 r293 15 15 16 16 PACPUS_REGISTER_COMPONENT(ProducerExample); 17 18 static const char * outputFileName = "producer.txt";19 17 20 18 ProducerExample::ProducerExample(QString name) … … 62 60 using boost::ref; 63 61 64 std::fstream mFile( outputFileName, std::ios_base::out | std::ios_base::app);62 std::fstream mFile(mOutputFileName, std::ios_base::out | std::ios_base::app); 65 63 if (!mFile.is_open()) { 66 LOG_ERROR("file '" << outputFileName << "' cannot be opened");64 LOG_ERROR("file '" << mOutputFileName << "' cannot be opened"); 67 65 return; 68 66 }
Note:
See TracChangeset
for help on using the changeset viewer.