Advertisement
Guest User

Untitled

a guest
Aug 20th, 2016
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. //pq_ - std::priority_queue with shared painters on file chunks ( ck ) that automatically loads next data part when current is read.
  2.  
  3.     for(auto ck : chunks)
  4.         pq_.push(ck);
  5.  
  6.     size_t buffer_size = 4 * 1024;
  7.     std::vector<int> buffer;
  8.     buffer.reserve(buffer_size);
  9.  
  10.     while(!pq_.empty())
  11.     {
  12.         auto ck = pq_.top();
  13.         pq_.pop();
  14.  
  15.         int min = ck->cur();
  16.  
  17.         if(ck->ok())
  18.         {
  19.             ck->next();
  20.  
  21.             pq_.push(ck);
  22.  
  23.         }
  24.  
  25.         buffer.push_back(min);
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement