|
Boost Users : |
From: Nathan Myers (ncm-yahoospam_at_[hidden])
Date: 2001-12-24 08:45:40
I have uploaded to the Boost files section couple of archives
containing an implementation of a class template extent_set;
look in the folder "extent_set". The zip and tgz archives there
are identical. Included in each is a header file and a test suite.
boost::extent_set<> implements a set of half-open ranges on a scalar
type, with automatic splitting and merging, appropriate for managing
ranges of disk blocks or video frames. In use it looks like:
boost::extent_set<int> set;
set.insert(10, 20); // now contains [10,20)
set.insert(30, 50); // now contains [10,20) [30,50)
set.erase(40, 45); // now contains [10,20) [30,40) [45,50)
set.insert(20, 30); // now contains [10,40) [45,50)
std::cout << "("
<< set.begin()->first << ","
<< set.begin()->second << ")" << std::endl; // writes "(10,40)"
It is implemented using std::map.
This is the initial submission. Please 'ave a look.
(I am only subscribed to the -users list, so far.)
Nathan Myers
ncm at cantrip dot org
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net