Changeset 2355


Ignore:
Timestamp:
Nov 30, 2010, 11:59:49 PM (13 years ago)
Author:
Peter
Message:

added some more types to SegmentSet?'s public interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/SegmentSet.h

    r2296 r2355  
    3737     \brief a set of Segments
    3838
    39      A container that holds a set of Segment. The Segments can not overlap.
     39     A container that holds a set of Segment. The Segments cannot overlap.
    4040
    4141     \since new in yat 0.7
     
    4545  {
    4646  public:
    47     /// value_type
    48     typedef Segment<T, Compare> value_type;
     47    /// element type
     48    typedef T element_type;
     49    /// key_type
     50    typedef Segment<element_type, Compare> key_type;
     51    /// value_type same as key_type
     52    typedef key_type value_type;
     53    /// key_compare
     54    struct key_compare
     55    {
     56      /// return true if lhs.begin() < rhs.begin()
     57      bool operator()(const key_type& lhs, const key_type& rhs) const
     58      { return Compare()(lhs.begin(),rhs.begin()); }
     59    };
     60    /// value_compare is same as key_compare
     61    typedef key_compare value_compare;
     62
    4963  private:
    50     /// \cond
    51     struct Compare_
    52     {
    53       bool operator()(const value_type& lhs, const value_type& rhs) const
    54       { return lhs.begin() < rhs.begin(); }
    55     };
    56     /// \endcond
    57 
    58     typedef std::set<value_type, Compare_> Set_;
     64    typedef std::set<value_type, value_compare> Set_;
    5965
    6066  public:
     
    144150
    145151  private:
    146     std::set<value_type, Compare_> set_;
     152    Set_ set_;
    147153   
    148154    /**
Note: See TracChangeset for help on using the changeset viewer.