Public Types
Public Functions
mdds::segment_tree::segment_tree()¶mdds::segment_tree::segment_tree(const segment_tree &r)¶mdds::segment_tree::~segment_tree()¶mdds::segment_tree::operator==(const segment_tree &r)¶Equality between two segment_tree instances is evaluated by comparing the segments that they store. The trees are not compared.
mdds::segment_tree::operator!=(const segment_tree &r)¶mdds::segment_tree::is_tree_valid()¶Check whether or not the internal tree is in a valid state. The tree must be valid in order to perform searches.
mdds::segment_tree::build_tree()¶Build or re-build tree based on the current set of segments.
mdds::segment_tree::insert(key_type begin_key, key_type end_key, value_type pdata)¶Insert a new segment.
begin_key - begin point of the segment. The value is inclusive.
end_key - end point of the segment. The value is non-inclusive.
pdata - pointer to the data instance associated with this segment. Note that the caller must manage the life cycle of the data instance.
mdds::segment_tree::search(key_type point, search_result_type &result)¶Search the tree and collect all segments that include a specified point.
point - specified point value
result - doubly-linked list of data instances associated with the segments that include the specified point. Note that the search result gets appended to the list; the list will not get emptied on each search. It is caller’s responsibility to empty the list before passing it to this method in case the caller so desires.
mdds::segment_tree::search(key_type point)¶Search the tree and collect all segments that include a specified point.
point - specified point value
mdds::segment_tree::remove(value_type value)¶Remove a segment that matches by the value. This will not invalidate the tree; however, if you have removed lots of segments, you might want to re-build the tree to shrink its size.
value - value to remove a segment by.
mdds::segment_tree::clear()¶Remove all segments data.
mdds::segment_tree::size()¶Return the number of segments currently stored in this container.
mdds::segment_tree::empty()¶Return whether or not the container stores any segments or none at all.
mdds::segment_tree::leaf_size()¶Return the number of leaf nodes.
Public Functions
mdds::segment_tree<_Key, _Value>::fill_nonleaf_value_handler::operator()(__st::nonleaf_node<segment_tree> &_self, const __st::node_base *left_node, const __st::node_base *right_node)¶Public Functions
mdds::segment_tree<_Key, _Value>::leaf_value_type::operator==(const leaf_value_type &r)¶Public Functions
mdds::segment_tree<_Key, _Value>::nonleaf_value_type::operator==(const nonleaf_value_type &r)¶Public Members
mdds::segment_tree<_Key, _Value>::nonleaf_value_type::low¶mdds::segment_tree<_Key, _Value>::nonleaf_value_type::high¶low range value (inclusive)
mdds::segment_tree<_Key, _Value>::nonleaf_value_type::data_chain¶high range value (non-inclusive)
Inherits from mdds::segment_tree< _Key, _Value >::search_result_base
Public Functions
mdds::segment_tree<_Key, _Value>::search_result::begin()¶mdds::segment_tree<_Key, _Value>::search_result::end()¶Inherits from mdds::segment_tree< _Key, _Value >::iterator_base
Public Functions
mdds::segment_tree<_Key, _Value>::search_result::iterator::iterator()¶Friends
mdds::segment_tree::segment_tree< _Key, _Value >::search_result