CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
cmsutil::UnsortedDumbVectorMap< K, V > Class Template Reference

#include <OtherHashMaps.h>

Public Types

typedef std::vector
< value_type >::const_iterator 
const_iterator
 
typedef std::vector
< value_type >::iterator 
iterator
 
typedef std::pair< K, V > value_type
 

Public Member Functions

const_iterator begin () const
 
iterator begin ()
 
void clear ()
 
bool empty () const
 
const_iterator end () const
 
iterator end ()
 
V & operator[] (const K &k)
 
 UnsortedDumbVectorMap ()
 

Private Attributes

std::vector< value_typedata_
 

Detailed Description

template<typename K, typename V>
class cmsutil::UnsortedDumbVectorMap< K, V >

Definition at line 304 of file OtherHashMaps.h.

Member Typedef Documentation

template<typename K , typename V >
typedef std::vector<value_type>::const_iterator cmsutil::UnsortedDumbVectorMap< K, V >::const_iterator

Definition at line 307 of file OtherHashMaps.h.

template<typename K , typename V >
typedef std::vector<value_type>::iterator cmsutil::UnsortedDumbVectorMap< K, V >::iterator

Definition at line 308 of file OtherHashMaps.h.

template<typename K , typename V >
typedef std::pair<K,V> cmsutil::UnsortedDumbVectorMap< K, V >::value_type

Definition at line 306 of file OtherHashMaps.h.

Constructor & Destructor Documentation

template<typename K , typename V >
cmsutil::UnsortedDumbVectorMap< K, V >::UnsortedDumbVectorMap ( )
inline

Definition at line 326 of file OtherHashMaps.h.

326 {}

Member Function Documentation

template<typename K , typename V >
const_iterator cmsutil::UnsortedDumbVectorMap< K, V >::begin ( void  ) const
inline

Definition at line 312 of file OtherHashMaps.h.

References cmsutil::UnsortedDumbVectorMap< K, V >::data_.

312 { return data_.begin(); }
std::vector< value_type > data_
template<typename K , typename V >
iterator cmsutil::UnsortedDumbVectorMap< K, V >::begin ( void  )
inline

Definition at line 314 of file OtherHashMaps.h.

References cmsutil::UnsortedDumbVectorMap< K, V >::data_.

314 { return data_.begin(); }
std::vector< value_type > data_
template<typename K , typename V >
void cmsutil::UnsortedDumbVectorMap< K, V >::clear ( void  )
inline

Definition at line 310 of file OtherHashMaps.h.

References cmsutil::UnsortedDumbVectorMap< K, V >::data_.

310 { data_.clear(); }
std::vector< value_type > data_
template<typename K , typename V >
bool cmsutil::UnsortedDumbVectorMap< K, V >::empty ( void  ) const
inline

Definition at line 311 of file OtherHashMaps.h.

References cmsutil::UnsortedDumbVectorMap< K, V >::data_.

311 { return data_.empty(); }
std::vector< value_type > data_
template<typename K , typename V >
const_iterator cmsutil::UnsortedDumbVectorMap< K, V >::end ( void  ) const
inline

Definition at line 313 of file OtherHashMaps.h.

References cmsutil::UnsortedDumbVectorMap< K, V >::data_.

313 { return data_.end(); }
std::vector< value_type > data_
template<typename K , typename V >
iterator cmsutil::UnsortedDumbVectorMap< K, V >::end ( void  )
inline

Definition at line 315 of file OtherHashMaps.h.

References cmsutil::UnsortedDumbVectorMap< K, V >::data_.

315 { return data_.end(); }
std::vector< value_type > data_
template<typename K , typename V >
V& cmsutil::UnsortedDumbVectorMap< K, V >::operator[] ( const K &  k)
inline

Definition at line 317 of file OtherHashMaps.h.

References cmsutil::UnsortedDumbVectorMap< K, V >::data_.

317  {
318  for (typename std::vector<value_type>::iterator it = data_.begin(), ed = data_.end(); it != ed; ++it) {
319  if (it->first == k) return it->second;
320  }
321  data_.push_back(value_type(k,V()));
322  return data_.back().second;
323  }
std::vector< value_type > data_

Member Data Documentation

template<typename K , typename V >
std::vector<value_type> cmsutil::UnsortedDumbVectorMap< K, V >::data_
private