5 #ifndef GAUDIKERNEL_VECTORMAP_H
6 #define GAUDIKERNEL_VECTORMAP_H 1
107 class KEYCOMPARE=std::less<const KEY> ,
108 class ALLOCATOR=std::allocator<std::pair<KEY,VALUE> >
139 typedef std::vector<value_type,allocator_type>
_vector ;
149 typedef typename _vector::const_iterator
iterator ;
177 {
return this->key_compare::operator() ( k1 , k2 ) ; }
232 if (
end() == pos ) {
return 0 ; }
246 return last - first ;
269 template <
class TYPE>
273 for ( ; first != last ; ++first ) { res +=
erase ( *first ) ; }
368 if (
end() == result ||
compare( value.first , result -> first ) )
369 { result =
m_vct.insert ( result , value ) ; found = false ; }
385 if ( pos !=
end() &&
compare ( *pos , value ) &&
386 ( pos ==
end() - 1 ||
387 ( !
compare ( value , *( pos + 1 ) )
388 &&
compare ( *( pos + 1 ) , value ) ) ) )
413 template <
class PAIRS>
417 {
for ( ; first != last ; ++first ) {
insert ( *first ) ; } }
426 template <
class KEYS,
class VALUES>
void insert
430 {
for ( ; kf != kl ; ++kf, ++vf ) {
insert ( *kf , *vf ) ; } }
460 if (
end() != res &&
compare ( key , res->first ) )
481 {
return end() ==
find ( key ) ? 0 : 1 ; }
522 {
return right < left ; }
525 {
return !( left == right ) ; }
528 {
return !( left < right ) ; }
531 {
return !( right < left ) ; }
567 if (
end() == result ||
compare ( key , result -> first ) )
572 else { result->second = mapped ; }
606 {
return update ( val.first , val.second ) ; }
643 if (
end() == res ) {
return s_default ; }
678 {
return (*
this)( key ) ; }
729 template <
class INPUT>
733 :
m_vct ( first , last , alloc )
745 if ( &right ==
this ) {
return *this ; }
763 friend std::ostream&
operator<<
764 ( std::ostream& str ,
const VectorMap& ) {
return str ; }
772 {
update ( it->first , it->second ) ; }
777 template <
class K1,
class K2,
class K3,
class K4>
781 right.
begin() ; right.
end() != it ; ++it )
782 {
update ( it->first , it->second ) ; }
796 if ( index >=
size() )
799 std::advance ( it , index ) ;
809 if ( index >=
size() )
812 std::advance ( it , index ) ;
825 template <
class TYPE1,
class TYPE2>
827 const TYPE2& obj2 )
const
829 return compare() ( obj1 , obj2 ) ;
835 return std::lower_bound
843 std::advance ( result , std::distance (
begin() , p ) ) ;
851 std::advance ( result , std::distance (
m_vct.begin() , p ) ) ;
879 { left.
swap( right ) ; }
901 const std::string& input ) ;
915 const std::string& input ) ;
925 #endif // GAUDIKERNEL_MAPS_H