ROSE 0.11.145.192
|
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 548 of file rangemap.h.
#include <roseSupport/rangemap.h>
Public Types | |
typedef R | Range |
Public Member Functions | |
template<class Other > | |
RangeMapVoid (const Other &) | |
void | removing (const Range &) |
Remove a value from a RangeMap. | |
void | truncate (const Range &, const typename Range::Value &) |
Truncate the RangeMap value. | |
bool | merge (const Range &, const Range &, const RangeMapVoid &) |
Attempts to merge the specified range into this range. | |
RangeMapVoid | split (const Range &, const typename Range::Value &) |
Split a value into two parts. | |
void | print (std::ostream &) const |
typedef R RangeMapVoid< R >::Range |
Definition at line 550 of file rangemap.h.
|
inline |
Definition at line 552 of file rangemap.h.
|
inlineexplicit |
Definition at line 555 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 559 of file rangemap.h.
|
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 564 of file rangemap.h.
|
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 581 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 589 of file rangemap.h.
|
inline |
Definition at line 593 of file rangemap.h.