Пример #1
0
void bin_extractor::setStreamImpl(const shared_ptr<std::istream>& aStreamPtr) {
  if(colCount != 0)
    *this >> close;
  if((aStreamPtr) && (*aStreamPtr)) {
    ReaKaux::unique_lock< ReaKaux::mutex > lock_here(access_mutex);
    in_stream = aStreamPtr;
    readNames();
  };
};
Пример #2
0
data_extractor::~data_extractor() {
  ReaKaux::unique_lock< ReaKaux::mutex > lock_here(access_mutex);
  colCount = 0;
  if((reading_thread) && (reading_thread->joinable())) {
    lock_here.unlock();
    reading_thread->join();
    lock_here.lock();
    reading_thread.reset();
  };
};
Пример #3
0
void ssv_recorder::setStreamImpl(const shared_ptr<std::ostream>& aStreamPtr) {
  if(colCount != 0) {
    *this << close;
    if((aStreamPtr) && (*aStreamPtr)) {
      ReaKaux::unique_lock< ReaKaux::mutex > lock_here(access_mutex);
      out_stream = aStreamPtr;
      out_stream->setf(std::ios::scientific, std::ios::floatfield);
      out_stream->precision(11);
      colCount = names.size();
      lock_here.unlock();
      writeNames();
    };
  } else {
    if((aStreamPtr) && (*aStreamPtr)) {
      ReaKaux::unique_lock< ReaKaux::mutex > lock_here(access_mutex);
      out_stream = aStreamPtr;
      out_stream->setf(std::ios::scientific, std::ios::floatfield);
      out_stream->precision(11);
    };
  };
};
Пример #4
0
bool ssv_extractor::readRow() {
  ReaKaux::unique_lock< ReaKaux::mutex > lock_here(access_mutex);
  if((in_stream) && (*in_stream) && (colCount > 0)) {
    std::string temp;
    std::getline(*in_stream, temp, '\n');
    std::stringstream ss(temp);
    for(unsigned int i = 0; i < colCount; ++i) {
      double tmp = 0;
      ss >> tmp;
      if(!ss)
        return false;
      values_rm.push(tmp);
    };
  };