CMS 3D CMS Logo

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

#include <OtherHashMaps.h>

Classes

class  item_iterator
 
struct  KeyItem
 
struct  ValueItem
 

Public Types

typedef Hasher hasher
 
typedef
SimpleAllocHashMultiMap< K, V,
Hasher, Equals, Alloc > 
map_type
 
typedef item_iterator< ValueItemvalue_iterator
 
typedef boost::mpl::if_
< typename boost::is_pointer
< V >, V, V const & >::type 
value_ref
 

Public Member Functions

void clear (size_t newBucketSize=0)
 
void dump ()
 
bool empty () const
 
void freeRows ()
 
void insert (K const &key, value_ref value)
 
 SimpleAllocHashMultiMap (size_t buckets, size_t keyRowSize, size_t valueRowSize, size_t maxRows=50)
 
value_iterator values (K const &key)
 
 ~SimpleAllocHashMultiMap ()
 

Private Types

typedef Alloc::template rebind
< KeyItem >::other 
KeyItemAllocator
 
typedef Alloc::template rebind
< KeyItem * >::other 
KeyItemPtrAllocator
 
typedef Alloc::template rebind
< ValueItem >::other 
ValueItemAllocator
 

Private Member Functions

 BOOST_MPL_ASSERT ((boost::mpl::and_< boost::has_trivial_destructor< K >, boost::has_trivial_destructor< V > >))
 
KeyItemfind_or_insert_ (K const &key)
 
KeyItempush_back_ (K const &key, KeyItem *next)
 
ValueItempush_back_ (value_ref value, ValueItem *next)
 

Private Attributes

size_t bucketCapacity_
 
KeyItem ** buckets_
 
size_t bucketSize_
 
std::list< KeyItem * >::iterator currentKeyRow_
 
std::list< ValueItem * >::iterator currentValueRow_
 
Equals eq_
 
Hasher hasher_
 
KeyItemAllocator keyAlloc_
 
KeyItemkeyEndMarker_
 
std::list< KeyItem * > keyRows_
 
size_t keyRowSize_
 
size_t maxRows_
 
KeyItemnextKeyItem_
 
ValueItemnextValueItem_
 
KeyItemPtrAllocator ptrAlloc_
 
ValueItemAllocator valueAlloc_
 
ValueItemvalueEndMarker_
 
std::list< ValueItem * > valueRows_
 
size_t valueRowSize_
 

Detailed Description

template<typename K, typename V, typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
class cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >

Definition at line 31 of file OtherHashMaps.h.

Member Typedef Documentation

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
typedef Hasher cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::hasher

Definition at line 35 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
typedef Alloc::template rebind<KeyItem>::other cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::KeyItemAllocator
private

Definition at line 111 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
typedef Alloc::template rebind<KeyItem *>::other cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::KeyItemPtrAllocator
private

Definition at line 112 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
typedef SimpleAllocHashMultiMap<K,V,Hasher,Equals,Alloc> cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::map_type

Definition at line 36 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
typedef item_iterator<ValueItem> cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::value_iterator

Definition at line 106 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
typedef boost::mpl::if_<typename boost::is_pointer<V>, V, V const &>::type cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::value_ref

Definition at line 37 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
typedef Alloc::template rebind<ValueItem>::other cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::ValueItemAllocator
private

Definition at line 113 of file OtherHashMaps.h.

Constructor & Destructor Documentation

template<typename K , typename V , typename Hasher , typename Equals , typename Alloc >
cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::SimpleAllocHashMultiMap ( size_t  buckets,
size_t  keyRowSize,
size_t  valueRowSize,
size_t  maxRows = 50 
)

Definition at line 183 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher , typename Equals , typename Alloc >
cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::~SimpleAllocHashMultiMap ( )

Definition at line 195 of file OtherHashMaps.h.

Member Function Documentation

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::BOOST_MPL_ASSERT ( (boost::mpl::and_< boost::has_trivial_destructor< K >, boost::has_trivial_destructor< V > >)  )
private
template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
void cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::clear ( size_t  newBucketSize = 0)
inline

Definition at line 43 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
void cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::dump ( void  )
inline

Definition at line 140 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
bool cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::empty ( void  ) const
inline

Definition at line 61 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher , typename Equals , typename Alloc >
SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::KeyItem & cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::find_or_insert_ ( K const &  key)
private

Definition at line 262 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher , typename Equals , typename Alloc >
void cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::freeRows ( )

Definition at line 208 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher , typename Equals , typename Alloc >
void cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::insert ( K const &  key,
value_ref  value 
)

Definition at line 279 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher , typename Equals , typename Alloc >
SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::KeyItem * cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::push_back_ ( K const &  key,
KeyItem next 
)
private

Definition at line 229 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher , typename Equals , typename Alloc >
SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::ValueItem * cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::push_back_ ( value_ref  value,
ValueItem next 
)
private

Definition at line 245 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher , typename Equals , typename Alloc >
SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::value_iterator cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::values ( K const &  key)

Definition at line 288 of file OtherHashMaps.h.

Member Data Documentation

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
size_t cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::bucketCapacity_
private

Definition at line 116 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
KeyItem** cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::buckets_
private

Definition at line 117 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
size_t cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::bucketSize_
private

Definition at line 116 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
std::list<KeyItem *>::iterator cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::currentKeyRow_
private

Definition at line 121 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
std::list<ValueItem *>::iterator cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::currentValueRow_
private

Definition at line 126 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
Equals cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::eq_
private

Definition at line 131 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
Hasher cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::hasher_
private

Definition at line 130 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
KeyItemAllocator cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::keyAlloc_
private

Definition at line 132 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
KeyItem * cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::keyEndMarker_
private

Definition at line 122 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
std::list<KeyItem *> cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::keyRows_
private

Definition at line 120 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
size_t cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::keyRowSize_
private

Definition at line 119 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
size_t cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::maxRows_
private

Definition at line 129 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
KeyItem* cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::nextKeyItem_
private

Definition at line 122 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
ValueItem* cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::nextValueItem_
private

Definition at line 127 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
KeyItemPtrAllocator cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::ptrAlloc_
private

Definition at line 134 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
ValueItemAllocator cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::valueAlloc_
private

Definition at line 133 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
ValueItem * cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::valueEndMarker_
private

Definition at line 127 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
std::list<ValueItem *> cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::valueRows_
private

Definition at line 125 of file OtherHashMaps.h.

template<typename K , typename V , typename Hasher = boost::hash<K>, typename Equals = std::equal_to<K>, typename Alloc = std::allocator<V>>
size_t cmsutil::SimpleAllocHashMultiMap< K, V, Hasher, Equals, Alloc >::valueRowSize_
private

Definition at line 124 of file OtherHashMaps.h.