ROSE
0.9.6a
|
Value type for a RangeMap with no useful data attached to the ranges. More...
#include <rangemap.h>
Public Types | |
typedef R | Range |
Public Member Functions | |
RangeMapVoid () | |
template<class Other > | |
RangeMapVoid (const Other &) | |
void | removing (const Range &my_range) |
Remove a value from a RangeMap. More... | |
void | truncate (const Range &my_range, const typename Range::Value &new_end) |
Truncate the RangeMap value. More... | |
bool | merge (const Range &my_range, const Range &other_range, const RangeMapVoid &other_value) |
Attempts to merge the specified range into this range. More... | |
RangeMapVoid | split (const Range &my_range, const typename Range::Value &new_end) |
Split a value into two parts. More... | |
void | print (std::ostream &o) const |
Friends | |
std::ostream & | operator<< (std::ostream &o, const RangeMapVoid &x) |
Value type for a RangeMap with no useful data attached to the ranges.
This also serves as an example documenting the interface for the operations a RangeMap can perform on its values. The single template parameter is the Range type.
Definition at line 533 of file rangemap.h.
typedef R RangeMapVoid< R >::Range |
Definition at line 535 of file rangemap.h.
|
inline |
Definition at line 537 of file rangemap.h.
Referenced by RangeMapVoid< R >::split().
|
inlineexplicit |
Definition at line 540 of file rangemap.h.
|
inline |
Remove a value from a RangeMap.
This method is invoked by RangeMap when it is removing a value from the map, such as during an erase() or clear() operation. It is not called for the merge() argument after a successful merge.
Definition at line 544 of file rangemap.h.
Referenced by RangeMap< Extent >::erase().
|
inline |
Truncate the RangeMap value.
This is similar to the removing() method, but only discards part of the value. The new_end
argument is the first value past the end of this range and must be such that the range would not become larger.
Definition at line 551 of file rangemap.h.
Referenced by RangeMap< Extent >::erase().
|
inline |
Attempts to merge the specified range into this range.
The specified range must adjoin this range (on the left or right) but not overlap with this range. The my_range
argument is the range associated with this value and the other_range
argument is the adjoining range for the value to be merged into this one. The third argument is the value to be merged into this one.
Merging is optional. If two values cannot be merged then they will be represented as distinct elements in the RangeMap. However, merging can significantly reduce the size of large RangeMap objects.
If a merge occurs, then the removing() method of other_value
is not invoked, but other_value will nonetheless be removed from the memory map. Therefore, if its removing() method needs to do anything it should be called explicitly. It must be done this way in order to allow the merge operation the possibility doing something more efficient than copying and then deleting other_value.
Returns true if merging occurred, false otherwise.
Definition at line 569 of file rangemap.h.
|
inline |
Split a value into two parts.
This is the inverse of the merge() operation. In effect, it truncates this value so it ends at new_end
(exclusive), but rather than discarding the right part, it returns it as a new value. The new_end
must be inside my_range
so that neither the modified nor returned ranges are empty. The my_range
argument is the value's range before it is split.
Definition at line 578 of file rangemap.h.
References RangeMapVoid< R >::RangeMapVoid().
Referenced by RangeMap< Extent >::erase().
|
inline |
Definition at line 583 of file rangemap.h.
|
friend |
Definition at line 584 of file rangemap.h.