Changeset 176 in pacpusframework for trunk/examples/ProducerConsumerExample/ConsumerExample.cpp
- Timestamp:
- Oct 11, 2013, 2:10:06 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/ProducerConsumerExample/ConsumerExample.cpp
r165 r176 20 20 LOG_INFO("Thread " << thread.currentThread()); 21 21 LOG_INFO("Current Thread " << QThread::currentThread()); 22 23 namespace po = boost::program_options; 24 25 addParameters() 26 ("output-path", po::value<std::string>(&mOutputFileName)->default_value("consumer.txt"), "set output file path") 27 ; 22 28 } 23 29 … … 40 46 ConsumerExample::configureComponent(XmlComponentConfig /*config*/) 41 47 { 42 LOG_TRACE(Q_FUNC_INFO);48 PACPUS_LOG_FUNCTION(); 43 49 44 // load XML parameters 50 // load XML parameters -- NOT NEEDED - loaded by boost::program_options (used addParameters()) 45 51 46 LOG_INFO("component '" << name() << "' configured");52 LOG_INFO("component '" << getName() << "' configured"); 47 53 return ComponentBase::CONFIGURED_OK; 48 54 } … … 54 60 m_counter = 0; 55 61 56 static const char * outputFileName = "consumer.txt"; 57 m_file.open(outputFileName, std::ios_base::out | std::ios_base::app); 62 m_file.open(mOutputFileName.c_str(), std::ios_base::out | std::ios_base::app); 58 63 if (!m_file.is_open()) { 59 LOG_ERROR("file '" << outputFileName << "'cannot be opened");64 LOG_ERROR("file '" << mOutputFileName << "' cannot be opened"); 60 65 } 61 66 62 67 thread.start(); 63 68 setState(MONITOR_OK); 64 LOG_INFO("started component '" << name() << "'");69 LOG_INFO("started component '" << getName() << "'"); 65 70 } 66 71 … … 72 77 m_file.close(); 73 78 setState(STOPPED); 74 LOG_INFO("stopped component '" << name() << "'");79 LOG_INFO("stopped component '" << getName() << "'"); 75 80 } 76 81
Note:
See TracChangeset
for help on using the changeset viewer.