LLVM  13.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
llvm::ImmutableMap< KeyT, ValT, ValInfo > Class Template Reference

#include "llvm/ADT/ImmutableMap.h"

Collaboration diagram for llvm::ImmutableMap< KeyT, ValT, ValInfo >:
Collaboration graph
[legend]

Classes

class  Factory
 
class  iterator
 

Public Types

using value_type = typename ValInfo::value_type
 
using value_type_ref = typename ValInfo::value_type_ref
 
using key_type = typename ValInfo::key_type
 
using key_type_ref = typename ValInfo::key_type_ref
 
using data_type = typename ValInfo::data_type
 
using data_type_ref = typename ValInfo::data_type_ref
 
using TreeTy = ImutAVLTree< ValInfo >
 

Public Member Functions

 ImmutableMap (const TreeTy *R)
 Constructs a map from a pointer to a tree root. More...
 
bool contains (key_type_ref K) const
 
bool operator== (const ImmutableMap &RHS) const
 
bool operator!= (const ImmutableMap &RHS) const
 
TreeTygetRoot () const
 
TreeTygetRootWithoutRetain () const
 
void manualRetain ()
 
void manualRelease ()
 
bool isEmpty () const
 
template<typename Callback >
void foreach (Callback &C)
 
template<typename Callback >
void foreach ()
 
void verify () const
 
iterator begin () const
 
iterator end () const
 
data_typelookup (key_type_ref K) const
 
value_typegetMaxElement () const
 getMaxElement - Returns the <key,value> pair in the ImmutableMap for which key is the highest in the ordering of keys in the map. More...
 
unsigned getHeight () const
 
void Profile (FoldingSetNodeID &ID) const
 

Static Public Member Functions

static void Profile (FoldingSetNodeID &ID, const ImmutableMap &M)
 

Protected Attributes

IntrusiveRefCntPtr< TreeTyRoot
 

Detailed Description

template<typename KeyT, typename ValT, typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
class llvm::ImmutableMap< KeyT, ValT, ValInfo >

Definition at line 62 of file ImmutableMap.h.

Member Typedef Documentation

◆ data_type

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
using llvm::ImmutableMap< KeyT, ValT, ValInfo >::data_type = typename ValInfo::data_type

Definition at line 68 of file ImmutableMap.h.

◆ data_type_ref

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
using llvm::ImmutableMap< KeyT, ValT, ValInfo >::data_type_ref = typename ValInfo::data_type_ref

Definition at line 69 of file ImmutableMap.h.

◆ key_type

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
using llvm::ImmutableMap< KeyT, ValT, ValInfo >::key_type = typename ValInfo::key_type

Definition at line 66 of file ImmutableMap.h.

◆ key_type_ref

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
using llvm::ImmutableMap< KeyT, ValT, ValInfo >::key_type_ref = typename ValInfo::key_type_ref

Definition at line 67 of file ImmutableMap.h.

◆ TreeTy

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
using llvm::ImmutableMap< KeyT, ValT, ValInfo >::TreeTy = ImutAVLTree<ValInfo>

Definition at line 70 of file ImmutableMap.h.

◆ value_type

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
using llvm::ImmutableMap< KeyT, ValT, ValInfo >::value_type = typename ValInfo::value_type

Definition at line 64 of file ImmutableMap.h.

◆ value_type_ref

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
using llvm::ImmutableMap< KeyT, ValT, ValInfo >::value_type_ref = typename ValInfo::value_type_ref

Definition at line 65 of file ImmutableMap.h.

Constructor & Destructor Documentation

◆ ImmutableMap()

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
llvm::ImmutableMap< KeyT, ValT, ValInfo >::ImmutableMap ( const TreeTy R)
inlineexplicit

Constructs a map from a pointer to a tree root.

In general one should use a Factory object to create maps instead of directly invoking the constructor, but there are cases where make this constructor public is useful.

Definition at line 80 of file ImmutableMap.h.

Referenced by llvm::ImmutableMap< KeyT, ValT, ValInfo >::Factory::add(), llvm::ImmutableMap< KeyT, ValT, ValInfo >::Factory::getEmptyMap(), and llvm::ImmutableMap< KeyT, ValT, ValInfo >::Factory::remove().

Member Function Documentation

◆ begin()

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
iterator llvm::ImmutableMap< KeyT, ValT, ValInfo >::begin ( ) const
inline

Definition at line 202 of file ImmutableMap.h.

References llvm::ImmutableMap< KeyT, ValT, ValInfo >::Root.

◆ contains()

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
bool llvm::ImmutableMap< KeyT, ValT, ValInfo >::contains ( key_type_ref  K) const
inline

Definition at line 113 of file ImmutableMap.h.

References llvm::ImmutableMap< KeyT, ValT, ValInfo >::Root.

◆ end()

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
iterator llvm::ImmutableMap< KeyT, ValT, ValInfo >::end ( ) const
inline

Definition at line 203 of file ImmutableMap.h.

◆ foreach() [1/2]

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
template<typename Callback >
void llvm::ImmutableMap< KeyT, ValT, ValInfo >::foreach ( )
inline

Definition at line 174 of file ImmutableMap.h.

References llvm::ImmutableMap< KeyT, ValT, ValInfo >::Root.

◆ foreach() [2/2]

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
template<typename Callback >
void llvm::ImmutableMap< KeyT, ValT, ValInfo >::foreach ( Callback &  C)
inline

Definition at line 166 of file ImmutableMap.h.

References llvm::ImmutableMap< KeyT, ValT, ValInfo >::Root.

◆ getHeight()

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
unsigned llvm::ImmutableMap< KeyT, ValT, ValInfo >::getHeight ( ) const
inline

Definition at line 225 of file ImmutableMap.h.

References llvm::ImmutableMap< KeyT, ValT, ValInfo >::Root.

◆ getMaxElement()

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
value_type* llvm::ImmutableMap< KeyT, ValT, ValInfo >::getMaxElement ( ) const
inline

getMaxElement - Returns the <key,value> pair in the ImmutableMap for which key is the highest in the ordering of keys in the map.

This method returns NULL if the map is empty.

Definition at line 217 of file ImmutableMap.h.

References llvm::ImmutableMap< KeyT, ValT, ValInfo >::Root.

◆ getRoot()

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
TreeTy* llvm::ImmutableMap< KeyT, ValT, ValInfo >::getRoot ( ) const
inline

Definition at line 126 of file ImmutableMap.h.

References llvm::ImmutableMap< KeyT, ValT, ValInfo >::Root.

◆ getRootWithoutRetain()

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
TreeTy* llvm::ImmutableMap< KeyT, ValT, ValInfo >::getRootWithoutRetain ( ) const
inline

Definition at line 131 of file ImmutableMap.h.

References llvm::ImmutableMap< KeyT, ValT, ValInfo >::Root.

◆ isEmpty()

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
bool llvm::ImmutableMap< KeyT, ValT, ValInfo >::isEmpty ( ) const
inline

Definition at line 141 of file ImmutableMap.h.

References llvm::ImmutableMap< KeyT, ValT, ValInfo >::Root.

◆ lookup()

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
data_type* llvm::ImmutableMap< KeyT, ValT, ValInfo >::lookup ( key_type_ref  K) const
inline

Definition at line 205 of file ImmutableMap.h.

References llvm::ImmutableMap< KeyT, ValT, ValInfo >::Root, and T.

◆ manualRelease()

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
void llvm::ImmutableMap< KeyT, ValT, ValInfo >::manualRelease ( )
inline

Definition at line 137 of file ImmutableMap.h.

References llvm::ImmutableMap< KeyT, ValT, ValInfo >::Root.

◆ manualRetain()

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
void llvm::ImmutableMap< KeyT, ValT, ValInfo >::manualRetain ( )
inline

Definition at line 133 of file ImmutableMap.h.

References llvm::ImmutableMap< KeyT, ValT, ValInfo >::Root.

◆ operator!=()

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
bool llvm::ImmutableMap< KeyT, ValT, ValInfo >::operator!= ( const ImmutableMap< KeyT, ValT, ValInfo > &  RHS) const
inline

Definition at line 121 of file ImmutableMap.h.

References llvm::ImmutableMap< KeyT, ValT, ValInfo >::Root.

◆ operator==()

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
bool llvm::ImmutableMap< KeyT, ValT, ValInfo >::operator== ( const ImmutableMap< KeyT, ValT, ValInfo > &  RHS) const
inline

Definition at line 117 of file ImmutableMap.h.

References llvm::ImmutableMap< KeyT, ValT, ValInfo >::Root.

◆ Profile() [1/2]

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
void llvm::ImmutableMap< KeyT, ValT, ValInfo >::Profile ( FoldingSetNodeID ID) const
inline

◆ Profile() [2/2]

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
static void llvm::ImmutableMap< KeyT, ValT, ValInfo >::Profile ( FoldingSetNodeID ID,
const ImmutableMap< KeyT, ValT, ValInfo > &  M 
)
inlinestatic

Definition at line 227 of file ImmutableMap.h.

References M.

Referenced by llvm::ImmutableMap< KeyT, ValT, ValInfo >::Profile().

◆ verify()

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
void llvm::ImmutableMap< KeyT, ValT, ValInfo >::verify ( ) const
inline

Definition at line 185 of file ImmutableMap.h.

References llvm::ImmutableMap< KeyT, ValT, ValInfo >::Root.

Member Data Documentation

◆ Root

template<typename KeyT , typename ValT , typename ValInfo = ImutKeyValueInfo<KeyT,ValT>>
IntrusiveRefCntPtr<TreeTy> llvm::ImmutableMap< KeyT, ValT, ValInfo >::Root
protected

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