yat  0.10.4pre
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
theplu::yat::utility::SegmentMap< T, Tp, Compare > Class Template Reference

a map of Segments More...

#include </scratch/bob/jari/tmp/pristine/yat-0.10.x/yat/utility/SegmentMap.h>

Inheritance diagram for theplu::yat::utility::SegmentMap< T, Tp, Compare >:
theplu::yat::utility::SegmentTree< std::map< Segment< T, Compare >, Tp, SegmentCompare< T, Compare > >, Compare, PairFirst< const std::pair< const Segment< T, Compare >, Tp > > >

List of all members.

Public Types

typedef Tp mapped_type
 mapped type
typedef std::map< Segment< T,
Compare >, Tp, SegmentCompare
< T, Compare > >::key_type 
key_type
 key type is same as Container 's key_type.
typedef std::map< Segment< T,
Compare >, Tp, SegmentCompare
< T, Compare > >::value_type 
value_type
 value type is same as Container 's value_type.
typedef key_type::value_type element_type
 element type is same as key_type 's value_type.
typedef std::map< Segment< T,
Compare >, Tp, SegmentCompare
< T, Compare > >::key_compare 
key_compare
 key compare
typedef std::map< Segment< T,
Compare >, Tp, SegmentCompare
< T, Compare >
>::value_compare 
value_compare
 value compare
typedef Compare element_compare
 element compare
typedef std::map< Segment< T,
Compare >, Tp, SegmentCompare
< T, Compare > >::pointer 
pointer
 pointer
typedef std::map< Segment< T,
Compare >, Tp, SegmentCompare
< T, Compare > >::reference 
reference
 reference
typedef std::map< Segment< T,
Compare >, Tp, SegmentCompare
< T, Compare >
>::const_reference 
const_reference
 const reference
typedef std::map< Segment< T,
Compare >, Tp, SegmentCompare
< T, Compare > >::size_type 
size_type
 size_type
typedef std::map< Segment< T,
Compare >, Tp, SegmentCompare
< T, Compare >
>::difference_type 
difference_type
 difference_type
typedef std::map< Segment< T,
Compare >, Tp, SegmentCompare
< T, Compare > >::iterator 
iterator
 iterator
typedef std::map< Segment< T,
Compare >, Tp, SegmentCompare
< T, Compare >
>::const_iterator 
const_iterator
 const_iterator

Public Member Functions

 SegmentMap (void)
 creates a set with no segments
const_iterator begin (void) const
iterator begin (void)
void clear (void)
 erases all values
size_type count (const element_type &element) const
bool empty (void) const
const_iterator end (void) const
iterator end (void)
void erase (iterator first, iterator last)
 erase values in range [first, last)
void erase (iterator pos)
iterator find (const element_type &element)
const_iterator find (const element_type &vt) const
std::pair< iterator, bool > insert (const value_type &value)
 insert value
key_compare key_comp (void) const
iterator lower_bound (const element_type &element)
 similar to lower_bound in std::set and std::map
const_iterator lower_bound (const element_type &element) const
 similar to lower_bound in std::set and std::map
size_type size (void) const
iterator upper_bound (const element_type &element)
const_iterator upper_bound (const element_type &element) const
 similar to upper_bound in std::set and std::map
value_compare value_comp (void) const

Protected Member Functions

std::pair< iterator, iteratoroverlap_range (const key_type &segment)

Protected Attributes

std::map< Segment< T, Compare >
, Tp, SegmentCompare< T,
Compare > > 
container_
 underlying container

Detailed Description

template<typename T, typename Tp, class Compare = std::less<T>>
class theplu::yat::utility::SegmentMap< T, Tp, Compare >

a map of Segments

A map with key Segment. The Segments cannot overlap.

Since:
new in yat 0.7

Member Typedef Documentation

typedef key_type::value_type theplu::yat::utility::SegmentTree< std::map< Segment< T, Compare >, Tp, SegmentCompare< T, Compare > > , Compare, PairFirst< const std::pair< const Segment< T, Compare >, Tp > > >::element_type
inherited

element type is same as key_type 's value_type.

If the key held is Segment<T>, value_type is T.

typedef std::map< Segment< T, Compare >, Tp, SegmentCompare< T, Compare > > ::key_type theplu::yat::utility::SegmentTree< std::map< Segment< T, Compare >, Tp, SegmentCompare< T, Compare > > , Compare, PairFirst< const std::pair< const Segment< T, Compare >, Tp > > >::key_type
inherited

key type is same as Container 's key_type.

Typically Segment<element_type>.

typedef std::map< Segment< T, Compare >, Tp, SegmentCompare< T, Compare > > ::value_type theplu::yat::utility::SegmentTree< std::map< Segment< T, Compare >, Tp, SegmentCompare< T, Compare > > , Compare, PairFirst< const std::pair< const Segment< T, Compare >, Tp > > >::value_type
inherited

value type is same as Container 's value_type.

Typically a Segment<element_type> or pair<const Segment<element_type>, Data>.


Member Function Documentation

const_iterator theplu::yat::utility::SegmentTree< std::map< Segment< T, Compare >, Tp, SegmentCompare< T, Compare > > , Compare, PairFirst< const std::pair< const Segment< T, Compare >, Tp > > >::begin ( void  ) const
inlineinherited
Returns:
const iterator pointing to beginning of container
iterator theplu::yat::utility::SegmentTree< std::map< Segment< T, Compare >, Tp, SegmentCompare< T, Compare > > , Compare, PairFirst< const std::pair< const Segment< T, Compare >, Tp > > >::begin ( void  )
inlineinherited
Returns:
iterator pointing to beginning of container
size_type theplu::yat::utility::SegmentTree< std::map< Segment< T, Compare >, Tp, SegmentCompare< T, Compare > > , Compare, PairFirst< const std::pair< const Segment< T, Compare >, Tp > > >::count ( const element_type element) const
inherited
Returns:
1 if there is a Segment that overlaps with element
bool theplu::yat::utility::SegmentTree< std::map< Segment< T, Compare >, Tp, SegmentCompare< T, Compare > > , Compare, PairFirst< const std::pair< const Segment< T, Compare >, Tp > > >::empty ( void  ) const
inlineinherited
Returns:
true if size is zero
const_iterator theplu::yat::utility::SegmentTree< std::map< Segment< T, Compare >, Tp, SegmentCompare< T, Compare > > , Compare, PairFirst< const std::pair< const Segment< T, Compare >, Tp > > >::end ( void  ) const
inlineinherited
Returns:
a const_iterator pointing to the end of container
iterator theplu::yat::utility::SegmentTree< std::map< Segment< T, Compare >, Tp, SegmentCompare< T, Compare > > , Compare, PairFirst< const std::pair< const Segment< T, Compare >, Tp > > >::end ( void  )
inlineinherited
Returns:
end of container
void theplu::yat::utility::SegmentTree< std::map< Segment< T, Compare >, Tp, SegmentCompare< T, Compare > > , Compare, PairFirst< const std::pair< const Segment< T, Compare >, Tp > > >::erase ( iterator  first,
iterator  last 
)
inlineinherited

erase values in range [first, last)

Since:
New in yat 0.8
void theplu::yat::utility::SegmentTree< std::map< Segment< T, Compare >, Tp, SegmentCompare< T, Compare > > , Compare, PairFirst< const std::pair< const Segment< T, Compare >, Tp > > >::erase ( iterator  pos)
inlineinherited

erase value pointed to by pos

Since:
New in yat 0.8
iterator theplu::yat::utility::SegmentTree< std::map< Segment< T, Compare >, Tp, SegmentCompare< T, Compare > > , Compare, PairFirst< const std::pair< const Segment< T, Compare >, Tp > > >::find ( const element_type element)
inherited
Returns:
iterator pointing to value containing element

If no value contains element, end() is returned.

const_iterator theplu::yat::utility::SegmentTree< std::map< Segment< T, Compare >, Tp, SegmentCompare< T, Compare > > , Compare, PairFirst< const std::pair< const Segment< T, Compare >, Tp > > >::find ( const element_type vt) const
inherited
Returns:
const iterator pointing to value containing element

If no value contains element, end() is returned.

Returns:
an iterator pointing to the Segment that contains vt. If no Segment contains vt, end() is returned.
std::pair<iterator, bool> theplu::yat::utility::SegmentTree< std::map< Segment< T, Compare >, Tp, SegmentCompare< T, Compare > > , Compare, PairFirst< const std::pair< const Segment< T, Compare >, Tp > > >::insert ( const value_type value)
inherited

insert value

if value does not overlap with container, insert segment; otherwise do nothing.

Returns:
a pair where pair.first points to the inserted value or if value was not inserted it points to a value in container that overlaps with value; pair.second is true if value was inserted.
key_compare theplu::yat::utility::SegmentTree< std::map< Segment< T, Compare >, Tp, SegmentCompare< T, Compare > > , Compare, PairFirst< const std::pair< const Segment< T, Compare >, Tp > > >::key_comp ( void  ) const
inlineinherited
Returns:
Comparison functor to compare two keys (Segment)
iterator theplu::yat::utility::SegmentTree< std::map< Segment< T, Compare >, Tp, SegmentCompare< T, Compare > > , Compare, PairFirst< const std::pair< const Segment< T, Compare >, Tp > > >::lower_bound ( const element_type element)
inherited

similar to lower_bound in std::set and std::map

Returns:
iterator pointing to first value whose key overlaps with element or is greater than element.
const_iterator theplu::yat::utility::SegmentTree< std::map< Segment< T, Compare >, Tp, SegmentCompare< T, Compare > > , Compare, PairFirst< const std::pair< const Segment< T, Compare >, Tp > > >::lower_bound ( const element_type element) const
inherited

similar to lower_bound in std::set and std::map

Returns:
const iterator pointing to first value whose key overlaps with element or is greater than element.
std::pair<iterator, iterator> theplu::yat::utility::SegmentTree< std::map< Segment< T, Compare >, Tp, SegmentCompare< T, Compare > > , Compare, PairFirst< const std::pair< const Segment< T, Compare >, Tp > > >::overlap_range ( const key_type segment)
inlineprotectedinherited

pair.first first (smallest) segment that overlaps with segment and pair.second first (smallest) segment that does not overlap with segment.

size_type theplu::yat::utility::SegmentTree< std::map< Segment< T, Compare >, Tp, SegmentCompare< T, Compare > > , Compare, PairFirst< const std::pair< const Segment< T, Compare >, Tp > > >::size ( void  ) const
inlineinherited
Returns:
number of values in container
iterator theplu::yat::utility::SegmentTree< std::map< Segment< T, Compare >, Tp, SegmentCompare< T, Compare > > , Compare, PairFirst< const std::pair< const Segment< T, Compare >, Tp > > >::upper_bound ( const element_type element)
inherited
Returns:
iterator pointing to first segment that is greater than segment.
const_iterator theplu::yat::utility::SegmentTree< std::map< Segment< T, Compare >, Tp, SegmentCompare< T, Compare > > , Compare, PairFirst< const std::pair< const Segment< T, Compare >, Tp > > >::upper_bound ( const element_type element) const
inherited

similar to upper_bound in std::set and std::map

Returns:
iterator pointing to first value whose key is greater than element.
value_compare theplu::yat::utility::SegmentTree< std::map< Segment< T, Compare >, Tp, SegmentCompare< T, Compare > > , Compare, PairFirst< const std::pair< const Segment< T, Compare >, Tp > > >::value_comp ( void  ) const
inlineinherited
Returns:
the value_compare object used by the class to sort values

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

Generated on Mon Nov 11 2013 09:41:46 for yat by  doxygen 1.8.1