1#ifndef _snl_fei_MapContig_hpp_
2#define _snl_fei_MapContig_hpp_
18template<
typename VAL_TYPE>
58 int* keysPtr =
mapPtr_->keysPtr_;
63 if (keysPtr[
offset_] >= first)
break;
138template<
typename VAL_TYPE>
140 : keys_(lastKey-firstKey+1),
142 values_(lastKey-firstKey+1),
144 len_(lastKey-firstKey+1)
147 for(
int i=0; i<
len_; ++i) {
155template<
typename VAL_TYPE>
159 values_(src.values_),
168template<
typename VAL_TYPE>
173template<
typename VAL_TYPE>
179template<
typename VAL_TYPE>
185template<
typename VAL_TYPE>
186inline std::pair<typename MapContig<VAL_TYPE>::iterator,
bool>
189 int localkey = val.first - first_;
190 if (localkey < 0 || localkey >= len_) {
191 return( std::pair<iterator,bool>(m_end_,
false) );
194 valuesPtr_[localkey] = val.second;
196 return( std::pair<iterator,bool>(iterator(localkey,
this),
true));
199template<
typename VAL_TYPE>
200inline typename MapContig<VAL_TYPE>::iterator
204 int offset = pos.offset_;
205 if (offset < 0 || offset >=len_ || pos == m_end_) {
206 offset = val.first - first_;
207 if (offset < 0 || offset >= len_) {
212 valuesPtr_[offset] = val.second;
214 return( iterator(offset,
this) );
217template<
typename VAL_TYPE>
220 int localkey = key - first_;
221 if (localkey < 0 || localkey >= len_) {
228template<
typename VAL_TYPE>
231 int localkey = key - first_;
232 if (localkey < 0 || localkey >= len_) {
239template<
typename VAL_TYPE>
MapContig< VAL_TYPE > * mapPtr_
bool operator!=(const iterator &rhs)
iterator(int offset, MapContig< VAL_TYPE > *mapPtr)
iterator & operator=(const iterator &src)
bool operator==(const iterator &rhs)
MapContig(int firstKey, int lastKey)
std::vector< VAL_TYPE > values_
std::pair< iterator, bool > insert(value_type val)
iterator lower_bound(int key)
std::pair< int, VAL_TYPE > value_type
iterator insert(iterator &pos, value_type val)
MapContig(const MapContig< VAL_TYPE > &src)