1 #include "pipe_paging.h" 2 3 PipePaging::PipePaging() 4 { 5 } 6 7 /* Add a region to the sequence. */ 8 9 void PipePaging::add_region(PageMapper *mapper) 10 { 11 _regions.push_back(mapper); 12 } 13 14 /* Return the first region in the sequence. */ 15 16 PageMapper *PipePaging::first_region() 17 { 18 return _regions.front(); 19 } 20 21 /* Return the next region for the reader. If only a single region remains, with 22 the reader wishing to move to the next, return NULL. */ 23 24 PageMapper *PipePaging::next_region() 25 { 26 if (_regions.size() > 1) 27 { 28 _regions.pop_front(); 29 return _regions.front(); 30 } 31 else 32 return NULL; 33 } 34 35 // vim: tabstop=4 expandtab shiftwidth=4