ROSE 0.11.145.192
Public Types | Public Member Functions | List of all members
RangeMapVoid< R > Class Template Reference

Description

template<class R>
class RangeMapVoid< R >

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
 

Member Typedef Documentation

◆ Range

template<class R >
typedef R RangeMapVoid< R >::Range

Definition at line 550 of file rangemap.h.

Constructor & Destructor Documentation

◆ RangeMapVoid() [1/2]

template<class R >
RangeMapVoid< R >::RangeMapVoid ( )
inline

Definition at line 552 of file rangemap.h.

◆ RangeMapVoid() [2/2]

template<class R >
template<class Other >
RangeMapVoid< R >::RangeMapVoid ( const Other &  )
inlineexplicit

Definition at line 555 of file rangemap.h.

Member Function Documentation

◆ removing()

template<class R >
void RangeMapVoid< R >::removing ( const Range )
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.

◆ truncate()

template<class R >
void RangeMapVoid< R >::truncate ( const Range ,
const typename Range::Value &   
)
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.

◆ merge()

template<class R >
bool RangeMapVoid< R >::merge ( const Range ,
const Range ,
const RangeMapVoid< R > &   
)
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.

◆ split()

template<class R >
RangeMapVoid RangeMapVoid< R >::split ( const Range ,
const typename Range::Value &   
)
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.

◆ print()

template<class R >
void RangeMapVoid< R >::print ( std::ostream &  ) const
inline

Definition at line 593 of file rangemap.h.


The documentation for this class was generated from the following file: