MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
mim::Pool< T > Class Template Reference

Maintains PooledSets within a fe::Arena and unifies them in a absl::flat_hash_set. More...

#include <mim/util/pool.h>

Inheritance diagram for mim::Pool< T >:
[legend]

Public Member Functions

Construction & Destruction
Pooloperator= (const Pool &)=delete
 
 Pool ()=default
 
 Pool (const Pool &)=delete
 
 Pool (Pool &&other)
 
Set Operations
Note
All operations do not modify the input set(s); they create a new PooledSet.
PooledSet< T > singleton (T elem)
 
PooledSet< T > merge (PooledSet< T > a, PooledSet< T > b)
 Yields $a \cup b$.
 
PooledSet< T > insert (PooledSet< T > a, const T &elem)
 Yields $a \cup \{elem\}$.
 
PooledSet< T > erase (PooledSet< T > set, const T &elem)
 Yields $a \setminus b$.
 
bool has_intersection (PooledSet< T > a, PooledSet< T > b)
 Is $a \cup b \neq \emptyset$?
 

Friends

void swap (Pool &p1, Pool &p2) noexcept
 

Detailed Description

template<class T>
class mim::Pool< T >

Maintains PooledSets within a fe::Arena and unifies them in a absl::flat_hash_set.

Definition at line 105 of file pool.h.

Constructor & Destructor Documentation

◆ Pool() [1/3]

template<class T >
mim::Pool< T >::Pool ( )
default

◆ Pool() [2/3]

template<class T >
mim::Pool< T >::Pool ( const Pool< T > & )
delete

◆ Pool() [3/3]

template<class T >
mim::Pool< T >::Pool ( Pool< T > && other)
inline

Definition at line 115 of file pool.h.

References mim::Pool< T >::swap.

Member Function Documentation

◆ erase()

template<class T >
PooledSet< T > mim::Pool< T >::erase ( PooledSet< T > set,
const T & elem )
inlinenodiscard

◆ has_intersection()

template<class T >
bool mim::Pool< T >::has_intersection ( PooledSet< T > a,
PooledSet< T > b )
inlinenodiscard

Is $a \cup b \neq \emptyset$?

Definition at line 177 of file pool.h.

References mim::PooledSet< T >::begin(), and mim::PooledSet< T >::end().

◆ insert()

template<class T >
PooledSet< T > mim::Pool< T >::insert ( PooledSet< T > a,
const T & elem )
inlinenodiscard

Yields $a \cup \{elem\}$.

Definition at line 160 of file pool.h.

References mim::Pool< T >::merge(), and mim::Pool< T >::singleton().

◆ merge()

template<class T >
PooledSet< T > mim::Pool< T >::merge ( PooledSet< T > a,
PooledSet< T > b )
inlinenodiscard

Yields $a \cup b$.

Definition at line 132 of file pool.h.

References mim::PooledSet< T >::begin(), mim::PooledSet< T >::end(), and mim::PooledSet< T >::size().

Referenced by mim::Pool< T >::insert().

◆ operator=()

template<class T >
Pool & mim::Pool< T >::operator= ( const Pool< T > & )
delete

◆ singleton()

template<class T >
PooledSet< T > mim::Pool< T >::singleton ( T elem)
inlinenodiscard

Create a PooledSet wih a single element: $\{elem\}$.

Definition at line 125 of file pool.h.

Referenced by mim::Pool< T >::insert().

Friends And Related Symbol Documentation

◆ swap

template<class T >
void swap ( Pool< T > & p1,
Pool< T > & p2 )
friend

Definition at line 194 of file pool.h.

Referenced by mim::Pool< T >::Pool().


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