source: trunk/yat/utility/SegmentMap.h @ 2703

Last change on this file since 2703 was 2703, checked in by Peter, 11 years ago

merge release 0.8.1 into trunk

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.6 KB
Line 
1#ifndef theplu_yat_utility_segment_map
2#define theplu_yat_utility_segment_map
3
4// $Id: SegmentMap.h 2703 2012-03-12 06:43:10Z peter $
5
6/*
7  Copyright (C) 2010, 2012 Peter Johansson
8
9  This file is part of the yat library, http://dev.thep.lu.se/yat
10
11  The yat library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU General Public License as
13  published by the Free Software Foundation; either version 3 of the
14  License, or (at your option) any later version.
15
16  The yat library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20
21  You should have received a copy of the GNU General Public License
22  along with yat. If not, see <http://www.gnu.org/licenses/>.
23*/
24
25#include "Segment.h"
26#include "SegmentTree.h"
27#include "stl_utility.h"
28
29#include <map>
30
31namespace theplu {
32namespace yat {
33namespace utility {
34
35  /**
36     \brief a map of Segments
37
38     A map with key Segment. The Segments cannot overlap.
39
40     \since new in yat 0.7
41   */
42  template<typename T, typename Tp, class Compare = std::less<T> >
43  class SegmentMap
44    : public SegmentTree<std::map<Segment<T, Compare>, Tp,
45                                  SegmentCompare<T, Compare> >,
46                   Compare,
47                   PairFirst<const std::pair<const Segment<T, Compare>, Tp> > >
48  {
49  public:
50    /// mapped type
51    typedef Tp mapped_type;
52
53    /**
54       \brief creates a set with no segments
55     */
56    SegmentMap(void) {}
57
58  private:
59    // using compiler generated copying
60    //SegmentMap(const SegmentMap&);
61    //SegmentMap& operator=(const SegmentMap&);
62  };
63
64}}}
65#endif
Note: See TracBrowser for help on using the repository browser.