33 |
|
#ifndef UTILS_LOCALINDEXMANAGER_HPP |
34 |
|
#define UTILS_LOCALINDEXMANAGER_HPP |
35 |
|
#include <algorithm> |
36 |
+ |
#include <iostream> |
37 |
|
#include <cassert> |
38 |
|
#include <list> |
39 |
|
#include <utility> |
48 |
|
class IndexListContainer{ |
49 |
|
public: |
50 |
|
static const unsigned int MAX_INTEGER = 2147483647; |
51 |
< |
typedef IndexListContainerIterator IndexListContainerIterator; |
51 |
> |
typedef std::list<std::pair<unsigned int, unsigned int> >::iterator IndexListContainerIterator; |
52 |
|
|
53 |
|
|
54 |
|
IndexListContainer(unsigned int minIndex = 0, unsigned int maxIndex = MAX_INTEGER) |
55 |
< |
:minIndex_(minIndex) maxIndex_(maxIndex) { |
55 |
> |
:minIndex_(minIndex), maxIndex_(maxIndex) { |
56 |
|
|
57 |
< |
indexContainer_.push_back(make_pair(minIndex, maxIndex)); |
57 |
> |
indexContainer_.push_back(std::make_pair(minIndex, maxIndex)); |
58 |
|
} |
59 |
|
|
60 |
|
unsigned int pop() { |
94 |
|
* @param endIndex |
95 |
|
*/ |
96 |
|
void insert(unsigned int beginIndex, unsigned int endIndex) { |
97 |
< |
IndexListContainerIterator insertPos = internalInsert(index, index, indexContainer_.begin()); |
97 |
> |
IndexListContainerIterator insertPos = internalInsert(beginIndex, endIndex, indexContainer_.begin()); |
98 |
|
merge(insertPos); |
99 |
|
} |
100 |
|
|
236 |
|
} |
237 |
|
|
238 |
|
} |
239 |
< |
unsgined int minIndex_; |
239 |
> |
unsigned int minIndex_; |
240 |
|
unsigned int maxIndex_; |
241 |
|
std::list<std::pair<unsigned int, unsigned int> > indexContainer_; |
242 |
|
}; |