ROSE
0.11.96.11
|
Policy indicating how values are merged and split.
Adjacent nodes of an IntervalMap can be joined together provided their values can also be joined together. This joining is a key feature of an IntervalMap since it can significantly reduce the number nodes required in the underlying map.
Definition at line 43 of file IntervalMap.h.
#include <IntervalMap.h>
Public Types | |
typedef I | Interval |
typedef T | Value |
Public Member Functions | |
bool | merge (const Interval &leftInterval, Value &leftValue, const Interval &rightInterval, Value &rightValue) |
Merge two values if possible. More... | |
Value | split (const Interval &interval, Value &value, const typename Interval::Value &splitPoint) |
Split one value into two values. More... | |
void | truncate (const Interval &interval, Value &value, const typename Interval::Value &splitPoint) |
Discard the right part of a value. More... | |
|
inline |
Merge two values if possible.
The rightValue
is merged into the leftValue
if possible, or this method returns false without changing either value. After a successful merge, the rightValue
will be removed from the IntervalMap and its destructor called.
Definition at line 61 of file IntervalMap.h.
|
inline |
Split one value into two values.
The IntervalMap calls this method when the interval
is being split into two smaller, adjacent intervals. The splitPoint
argument is the split point and becomes the least value of the right interval. The value
argument is modified in place to become the left value, and the right value is returned. This method is only invoked when the result would be two non-empty intervals.
Definition at line 73 of file IntervalMap.h.
|
inline |
Discard the right part of a value.
This method is the same as split except the right part of the resulting value is discarded. This is sometimes more efficient than calling split and then destroying the return value.
Definition at line 83 of file IntervalMap.h.