~awuerl/blitzortung-tracker/0.9

« back to all changes in this revision

Viewing changes to source/lib/Process.cc

  • Committer: Andreas Wuerl
  • Date: 2012-03-08 22:02:31 UTC
  • Revision ID: andi@debian-20120308220231-8dc444kpv5b4s72p
backported most of the 1.0 features

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include "Process.h"
2
 
#include "DataThread.h"
 
2
#include "DataWorker.h"
3
3
 
4
4
#include "exception/Base.h"
5
5
 
12
12
    amplitudeLimit_(0.0),
13
13
    logger_("Process")
14
14
  {
15
 
    DataThread dataThread(eventQueue_, eventCountBuffer_, transfer, output);
16
 
 
17
 
    dataThread.setEventRateLimit(eventRateLimit);
18
 
 
19
 
    boost::thread thread(dataThread);
 
15
    DataWorker dataWorker(eventQueue_, eventCountBuffer_, transfer, output);
 
16
 
 
17
    dataWorker.setEventRateLimit(eventRateLimit);
 
18
 
 
19
    boost::thread thread(dataWorker);
20
20
  }
21
21
 
22
22
  Process::~Process() {
50
50
    }
51
51
  }
52
52
 
53
 
  const DataThread::EventCountBuffer& Process::getEventCountBuffer() const {
 
53
  const DataWorker::EventCountBuffer& Process::getEventCountBuffer() const {
54
54
    return eventCountBuffer_;
55
55
  }
56
56
  
65
65
  void Process::setAmplitudeLimit(double amplitudeLimit) {
66
66
    amplitudeLimit_ = amplitudeLimit;
67
67
  }
 
68
 
 
69
  const pt::ptime& Process::getStartTime() const {
 
70
    return startTime_;
 
71
  }
 
72
 
 
73
  const pt::time_duration Process::getUptime() const {
 
74
    return pt::second_clock::universal_time() - getStartTime();
 
75
  }
68
76
}
69
77