Public Types
Public Functions
mdds::rectangle_set::rectangle_set()¶mdds::rectangle_set::rectangle_set(const rectangle_set &r)¶mdds::rectangle_set::~rectangle_set()¶mdds::rectangle_set::operator=(const rectangle_set &r)¶mdds::rectangle_set::operator==(const rectangle_set &r)¶Equality between two instances of rectangle_set is evaluated based on the stored rectangle instances; their pointer values and geometries.
mdds::rectangle_set::operator!=(const rectangle_set &r)¶mdds::rectangle_set::insert(key_type x1, key_type y1, key_type x2, key_type y2, value_type data)¶Insert a new rectangle (and data associated with it) into the set. Note that insertion of duplicate data instance is not allowed. A data is considered a duplicate if its pointer value is identical to one of the data instances already stored within. Also note that the end point of a rectangle is non-inclusive; a rectangle of (x1,y1) - (x2,y2) means that the rectangle spans x1 <= x < x2 and y1 <= y < y2.
x1 - lower x coordinate of the rectangle. Inclusive.
y1 - lower y coordinate of the rectangle. Inclusive.
x2 - upper x coordinate of the rectangle. Non-inclusive.
y2 - upper y coordinate of the rectangle. Non-inclusive.
data - pointer to data instance associated with this rectangle. Note that the caller is responsible for managing the life cycle of the data instance.
mdds::rectangle_set::search(key_type x, key_type y, search_result_type &result)¶Search and collect all rectangles that contains a given point.
x - x coordinate of a query point.
y - y coordinate of a query point.
result - array of pointers to rectangle instances.
mdds::rectangle_set::search(key_type x, key_type y)¶Search and collect all rectangles containing a given point.
x - x coordinate of a query point.
y - y coordinate of a query point.
mdds::rectangle_set::remove(value_type data)¶Remove a rectangle instance pointed to by a given pointer.
data - pointer that points to the rectangle instance you wish to remove from the set.
mdds::rectangle_set::clear()¶Clear all rectangles stored in the set.
mdds::rectangle_set::size()¶Return the number of rectangles currently stored in the set.
mdds::rectangle_set::empty()¶Check whether or not the set is empty.
Most of the implementation of search_result and its iterator is in segment_tree since the iteration logic is identical & depends on the segment_tree internals.
Inherits from mdds::segment_tree< _Key, _Value >::search_result_base
Public Types
mdds::rectangle_set<_Key, _Value>::search_result::res_chains_type¶mdds::rectangle_set<_Key, _Value>::search_result::res_chains_ptr¶mdds::rectangle_set<_Key, _Value>::search_result::data_chain_type¶Public Functions
mdds::rectangle_set<_Key, _Value>::search_result::search_result()¶mdds::rectangle_set<_Key, _Value>::search_result::search_result(const search_result &r)¶mdds::rectangle_set<_Key, _Value>::search_result::begin()¶mdds::rectangle_set<_Key, _Value>::search_result::end()¶Inherits from mdds::segment_tree< _Key, _Value >::iterator_base
Public Functions
mdds::rectangle_set<_Key, _Value>::search_result::iterator::iterator()¶Friends
mdds::rectangle_set::rectangle_set< _Key, _Value >::search_result