llvm::StringMap< ValueTy, AllocatorTy > Class Template Reference

StringMap - This is an unconventional map that is specialized for handling keys that are "strings", which are basically ranges of bytes. More...

#include <StringMap.h>

Inheritance diagram for llvm::StringMap< ValueTy, AllocatorTy >:
llvm::StringMapImpl

List of all members.

Public Types

typedef ReferenceAdder
< AllocatorTy >::result 
AllocatorRefTy
typedef ReferenceAdder< const
AllocatorTy >::result 
AllocatorCRefTy
typedef const char * key_type
typedef ValueTy mapped_type
typedef StringMapEntry< ValueTy > value_type
typedef size_t size_type
typedef StringMapConstIterator
< ValueTy > 
const_iterator
typedef StringMapIterator
< ValueTy > 
iterator

Public Member Functions

 StringMap ()
 StringMap (unsigned InitialSize)
 StringMap (AllocatorTy A)
 StringMap (const StringMap &RHS)
void operator= (const StringMap &RHS)
AllocatorRefTy getAllocator ()
AllocatorCRefTy getAllocator () const
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
iterator find (StringRef Key)
const_iterator find (StringRef Key) const
ValueTy lookup (StringRef Key) const
 lookup - Return the entry for the specified key, or a default
ValueTy & operator[] (StringRef Key)
size_type count (StringRef Key) const
bool insert (MapEntryTy *KeyValue)
 insert - Insert the specified key/value pair into the map.
void clear ()
template<typename InitTy >
MapEntryTyGetOrCreateValue (StringRef Key, InitTy Val)
 GetOrCreateValue - Look up the specified key in the table.
MapEntryTyGetOrCreateValue (StringRef Key)
void remove (MapEntryTy *KeyValue)
 remove - Remove the specified key/value pair from the map, but do not erase it.
void erase (iterator I)
bool erase (StringRef Key)
 ~StringMap ()

Private Types

typedef StringMapEntry< ValueTy > MapEntryTy

Private Attributes

AllocatorTy Allocator

Detailed Description

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
class llvm::StringMap< ValueTy, AllocatorTy >

StringMap - This is an unconventional map that is specialized for handling keys that are "strings", which are basically ranges of bytes.

This does some funky memory allocation and hashing things to make it extremely efficient, storing the string data *after* the value in the map.


Member Typedef Documentation

template<typename ValueTy , typename AllocatorTy = MallocAllocator>
typedef ReferenceAdder<const AllocatorTy>::result llvm::StringMap< ValueTy, AllocatorTy >::AllocatorCRefTy
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
typedef ReferenceAdder<AllocatorTy>::result llvm::StringMap< ValueTy, AllocatorTy >::AllocatorRefTy
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
typedef StringMapConstIterator<ValueTy> llvm::StringMap< ValueTy, AllocatorTy >::const_iterator
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
typedef StringMapIterator<ValueTy> llvm::StringMap< ValueTy, AllocatorTy >::iterator
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
typedef const char* llvm::StringMap< ValueTy, AllocatorTy >::key_type
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
typedef StringMapEntry<ValueTy> llvm::StringMap< ValueTy, AllocatorTy >::MapEntryTy [private]
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
typedef ValueTy llvm::StringMap< ValueTy, AllocatorTy >::mapped_type
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
typedef size_t llvm::StringMap< ValueTy, AllocatorTy >::size_type
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
typedef StringMapEntry<ValueTy> llvm::StringMap< ValueTy, AllocatorTy >::value_type

Constructor & Destructor Documentation

template<typename ValueTy , typename AllocatorTy = MallocAllocator>
llvm::StringMap< ValueTy, AllocatorTy >::StringMap (  )  [inline]
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
llvm::StringMap< ValueTy, AllocatorTy >::StringMap ( unsigned  InitialSize  )  [inline, explicit]
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
llvm::StringMap< ValueTy, AllocatorTy >::StringMap ( AllocatorTy  A  )  [inline, explicit]
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
llvm::StringMap< ValueTy, AllocatorTy >::StringMap ( const StringMap< ValueTy, AllocatorTy > &  RHS  )  [inline, explicit]
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
llvm::StringMap< ValueTy, AllocatorTy >::~StringMap (  )  [inline]

Member Function Documentation

template<typename ValueTy , typename AllocatorTy = MallocAllocator>
const_iterator llvm::StringMap< ValueTy, AllocatorTy >::begin (  )  const [inline]
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
iterator llvm::StringMap< ValueTy, AllocatorTy >::begin (  )  [inline]
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
void llvm::StringMap< ValueTy, AllocatorTy >::clear (  )  [inline]
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
size_type llvm::StringMap< ValueTy, AllocatorTy >::count ( StringRef  Key  )  const [inline]
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
const_iterator llvm::StringMap< ValueTy, AllocatorTy >::end (  )  const [inline]
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
iterator llvm::StringMap< ValueTy, AllocatorTy >::end (  )  [inline]
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
bool llvm::StringMap< ValueTy, AllocatorTy >::erase ( StringRef  Key  )  [inline]
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
void llvm::StringMap< ValueTy, AllocatorTy >::erase ( iterator  I  )  [inline]
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
const_iterator llvm::StringMap< ValueTy, AllocatorTy >::find ( StringRef  Key  )  const [inline]
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
iterator llvm::StringMap< ValueTy, AllocatorTy >::find ( StringRef  Key  )  [inline]
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
AllocatorCRefTy llvm::StringMap< ValueTy, AllocatorTy >::getAllocator (  )  const [inline]
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
AllocatorRefTy llvm::StringMap< ValueTy, AllocatorTy >::getAllocator (  )  [inline]
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
MapEntryTy& llvm::StringMap< ValueTy, AllocatorTy >::GetOrCreateValue ( StringRef  Key  )  [inline]
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
template<typename InitTy >
MapEntryTy& llvm::StringMap< ValueTy, AllocatorTy >::GetOrCreateValue ( StringRef  Key,
InitTy  Val 
) [inline]

GetOrCreateValue - Look up the specified key in the table.

If a value exists, return it. Otherwise, default construct a value, insert it, and return.

template<typename ValueTy , typename AllocatorTy = MallocAllocator>
bool llvm::StringMap< ValueTy, AllocatorTy >::insert ( MapEntryTy KeyValue  )  [inline]

insert - Insert the specified key/value pair into the map.

If the key already exists in the map, return false and ignore the request, otherwise insert it and return true.

template<typename ValueTy , typename AllocatorTy = MallocAllocator>
ValueTy llvm::StringMap< ValueTy, AllocatorTy >::lookup ( StringRef  Key  )  const [inline]

lookup - Return the entry for the specified key, or a default

constructed value if no such entry exists.

template<typename ValueTy , typename AllocatorTy = MallocAllocator>
void llvm::StringMap< ValueTy, AllocatorTy >::operator= ( const StringMap< ValueTy, AllocatorTy > &  RHS  )  [inline]
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
ValueTy& llvm::StringMap< ValueTy, AllocatorTy >::operator[] ( StringRef  Key  )  [inline]
template<typename ValueTy , typename AllocatorTy = MallocAllocator>
void llvm::StringMap< ValueTy, AllocatorTy >::remove ( MapEntryTy KeyValue  )  [inline]

remove - Remove the specified key/value pair from the map, but do not erase it.

This aborts if the key is not in the map.


Member Data Documentation

template<typename ValueTy , typename AllocatorTy = MallocAllocator>
AllocatorTy llvm::StringMap< ValueTy, AllocatorTy >::Allocator [private]

The documentation for this class was generated from the following file:

Generated on 2 Nov 2013 for Galois by  doxygen 1.6.1