LLVM API Documentation

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

#include <StringMap.h>

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

Inheritance graph
[legend]
Collaboration diagram for llvm::StringMap< ValueTy, AllocatorTy >:

Collaboration graph
[legend]

List of all members.

Public Types

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)
AllocatorTy & getAllocator ()
const AllocatorTy & getAllocator () const
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
iterator find (const char *KeyStart, const char *KeyEnd)
iterator find (const char *Key)
iterator find (const std::string &Key)
const_iterator find (const char *KeyStart, const char *KeyEnd) const
const_iterator find (const char *Key) const
const_iterator find (const std::string &Key) const
ValueTy & operator[] (const char *Key)
ValueTy & operator[] (const std::string &Key)
size_type count (const char *KeyStart, const char *KeyEnd) const
size_type count (const char *Key) const
size_type count (const std::string &Key) const
bool insert (MapEntryTy *KeyValue)
void clear ()
template<typename InitTy>
StringMapEntry< ValueTy > & GetOrCreateValue (const char *KeyStart, const char *KeyEnd, InitTy Val)
StringMapEntry< ValueTy > & GetOrCreateValue (const char *KeyStart, const char *KeyEnd)
void remove (MapEntryTy *KeyValue)
void erase (iterator I)
bool erase (const char *Key)
bool erase (const std::string &Key)
 ~StringMap ()


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.

Definition at line 236 of file StringMap.h.


Member Typedef Documentation

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
typedef const char* llvm::StringMap< ValueTy, AllocatorTy >::key_type

Definition at line 247 of file StringMap.h.

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

Definition at line 248 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
typedef StringMapEntry<ValueTy> llvm::StringMap< ValueTy, AllocatorTy >::value_type

Definition at line 249 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
typedef size_t llvm::StringMap< ValueTy, AllocatorTy >::size_type

Definition at line 250 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
typedef StringMapConstIterator<ValueTy> llvm::StringMap< ValueTy, AllocatorTy >::const_iterator

Definition at line 252 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
typedef StringMapIterator<ValueTy> llvm::StringMap< ValueTy, AllocatorTy >::iterator

Definition at line 253 of file StringMap.h.


Constructor & Destructor Documentation

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

Definition at line 240 of file StringMap.h.

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

Definition at line 241 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
llvm::StringMap< ValueTy, AllocatorTy >::~StringMap (  )  [inline]

Definition at line 408 of file StringMap.h.


Member Function Documentation

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
AllocatorTy& llvm::StringMap< ValueTy, AllocatorTy >::getAllocator (  )  [inline]

Definition at line 244 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
const AllocatorTy& llvm::StringMap< ValueTy, AllocatorTy >::getAllocator (  )  const [inline]

Definition at line 245 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
iterator llvm::StringMap< ValueTy, AllocatorTy >::begin (  )  [inline]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
iterator llvm::StringMap< ValueTy, AllocatorTy >::end (  )  [inline]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
const_iterator llvm::StringMap< ValueTy, AllocatorTy >::begin (  )  const [inline]

Definition at line 261 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
const_iterator llvm::StringMap< ValueTy, AllocatorTy >::end (  )  const [inline]

Definition at line 264 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
iterator llvm::StringMap< ValueTy, AllocatorTy >::find ( const char *  KeyStart,
const char *  KeyEnd 
) [inline]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
iterator llvm::StringMap< ValueTy, AllocatorTy >::find ( const char *  Key  )  [inline]

Definition at line 273 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
iterator llvm::StringMap< ValueTy, AllocatorTy >::find ( const std::string &  Key  )  [inline]

Definition at line 276 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
const_iterator llvm::StringMap< ValueTy, AllocatorTy >::find ( const char *  KeyStart,
const char *  KeyEnd 
) const [inline]

Definition at line 281 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
const_iterator llvm::StringMap< ValueTy, AllocatorTy >::find ( const char *  Key  )  const [inline]

Definition at line 286 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
const_iterator llvm::StringMap< ValueTy, AllocatorTy >::find ( const std::string &  Key  )  const [inline]

Definition at line 289 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
ValueTy& llvm::StringMap< ValueTy, AllocatorTy >::operator[] ( const char *  Key  )  [inline]

Definition at line 294 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
ValueTy& llvm::StringMap< ValueTy, AllocatorTy >::operator[] ( const std::string &  Key  )  [inline]

Definition at line 298 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
size_type llvm::StringMap< ValueTy, AllocatorTy >::count ( const char *  KeyStart,
const char *  KeyEnd 
) const [inline]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
size_type llvm::StringMap< ValueTy, AllocatorTy >::count ( const char *  Key  )  const [inline]

Definition at line 307 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
size_type llvm::StringMap< ValueTy, AllocatorTy >::count ( const std::string &  Key  )  const [inline]

Definition at line 310 of file StringMap.h.

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.

Definition at line 318 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
void llvm::StringMap< ValueTy, AllocatorTy >::clear (  )  [inline]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
template<typename InitTy>
StringMapEntry<ValueTy>& llvm::StringMap< ValueTy, AllocatorTy >::GetOrCreateValue ( const char *  KeyStart,
const char *  KeyEnd,
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.

Definition at line 354 of file StringMap.h.

Referenced by llvm::StringMap< llvm::StringPool::PooledString >::GetOrCreateValue(), and llvm::StringMap< llvm::StringPool::PooledString >::operator[]().

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
StringMapEntry<ValueTy>& llvm::StringMap< ValueTy, AllocatorTy >::GetOrCreateValue ( const char *  KeyStart,
const char *  KeyEnd 
) [inline]

Definition at line 377 of file StringMap.h.

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.

Definition at line 384 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
void llvm::StringMap< ValueTy, AllocatorTy >::erase ( iterator  I  )  [inline]

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
bool llvm::StringMap< ValueTy, AllocatorTy >::erase ( const char *  Key  )  [inline]

Definition at line 394 of file StringMap.h.

template<typename ValueTy, typename AllocatorTy = MallocAllocator>
bool llvm::StringMap< ValueTy, AllocatorTy >::erase ( const std::string &  Key  )  [inline]

Definition at line 401 of file StringMap.h.


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



This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.