1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7 #if !defined(BOOST_SPIRIT_RANGE_RUN_MAY_16_2006_0801_PM)
8 #define BOOST_SPIRIT_RANGE_RUN_MAY_16_2006_0801_PM
14 #include <boost/spirit/home/support/char_set/range.hpp>
17 namespace boost { namespace spirit { namespace support { namespace detail
19 ///////////////////////////////////////////////////////////////////////////
22 // An implementation of a sparse bit (boolean) set. The set uses
23 // a sorted vector of disjoint ranges. This class implements the
24 // bare minimum essentials from which the full range of set
25 // operators can be implemented. The set is constructed from
26 // ranges. Internally, adjacent or overlapping ranges are
29 // range_runs are very space-economical in situations where there
30 // are lots of ranges and a few individual disjoint values.
31 // Searching is O(log n) where n is the number of ranges.
33 // { Low level interface }
34 ///////////////////////////////////////////////////////////////////////////
35 template <typename Char>
40 typedef range<Char> range_type;
41 typedef std::vector<range_type> storage_type;
43 void swap(range_run& other);
44 bool test(Char v) const;
45 void set(range_type const& range);
46 void clear(range_type const& range);
55 #include <boost/spirit/home/support/char_set/range_run_impl.hpp>