WPILibC++ 2023.4.3
wpi::SmallPtrSetImpl< PtrType > Class Template Reference

A templated base class for SmallPtrSet which provides the typesafe interface that is common across all small sizes. More...

#include </home/runner/work/allwpilib/allwpilib/wpiutil/src/main/native/thirdparty/llvm/include/wpi/SmallPtrSet.h>

Inheritance diagram for wpi::SmallPtrSetImpl< PtrType >:
wpi::SmallPtrSetImplBase wpi::DebugEpochBase wpi::SmallPtrSet< PtrType, SmallSize >

Public Types

using iterator = SmallPtrSetIterator< PtrType >
 
using const_iterator = SmallPtrSetIterator< PtrType >
 
using key_type = ConstPtrType
 
using value_type = PtrType
 
- Public Types inherited from wpi::SmallPtrSetImplBase
using size_type = unsigned
 

Public Member Functions

 SmallPtrSetImpl (const SmallPtrSetImpl &)=delete
 
std::pair< iterator, bool > insert (PtrType Ptr)
 Inserts Ptr if and only if there is no element in the container equal to Ptr. More...
 
iterator insert (iterator, PtrType Ptr)
 Insert the given pointer with an iterator hint that is ignored. More...
 
bool erase (PtrType Ptr)
 erase - If the set contains the specified pointer, remove it and return true, otherwise return false. More...
 
size_type count (ConstPtrType Ptr) const
 count - Return 1 if the specified pointer is in the set, 0 otherwise. More...
 
iterator find (ConstPtrType Ptr) const
 
bool contains (ConstPtrType Ptr) const
 
template<typename IterT >
void insert (IterT I, IterT E)
 
void insert (std::initializer_list< PtrType > IL)
 
iterator begin () const
 
iterator end () const
 
- Public Member Functions inherited from wpi::SmallPtrSetImplBase
SmallPtrSetImplBaseoperator= (const SmallPtrSetImplBase &)=delete
 
LLVM_NODISCARD bool empty () const
 
size_type size () const
 
void clear ()
 
- Public Member Functions inherited from wpi::DebugEpochBase
 DebugEpochBase ()
 
void incrementEpoch ()
 Calling incrementEpoch invalidates all handles pointing into the calling instance. More...
 
 ~DebugEpochBase ()
 The destructor calls incrementEpoch to make use-after-free bugs more likely to crash deterministically. More...
 

Protected Member Functions

 SmallPtrSetImplBase (const void **SmallStorage, const SmallPtrSetImplBase &that)
 
 SmallPtrSetImplBase (const void **SmallStorage, unsigned SmallSize, SmallPtrSetImplBase &&that)
 
 SmallPtrSetImplBase (const void **SmallStorage, unsigned SmallSize)
 
- Protected Member Functions inherited from wpi::SmallPtrSetImplBase
 SmallPtrSetImplBase (const void **SmallStorage, const SmallPtrSetImplBase &that)
 
 SmallPtrSetImplBase (const void **SmallStorage, unsigned SmallSize, SmallPtrSetImplBase &&that)
 
 SmallPtrSetImplBase (const void **SmallStorage, unsigned SmallSize)
 
 ~SmallPtrSetImplBase ()
 
const void ** EndPointer () const
 
std::pair< const void *const *, bool > insert_imp (const void *Ptr)
 insert_imp - This returns true if the pointer was new to the set, false if it was already in the set. More...
 
bool erase_imp (const void *Ptr)
 erase_imp - If the set contains the specified pointer, remove it and return true, otherwise return false. More...
 
const void *const * find_imp (const void *Ptr) const
 Returns the raw pointer needed to construct an iterator. More...
 
void swap (SmallPtrSetImplBase &RHS)
 swap - Swaps the elements of two sets. More...
 
void CopyFrom (const SmallPtrSetImplBase &RHS)
 
void MoveFrom (unsigned SmallSize, SmallPtrSetImplBase &&RHS)
 

Additional Inherited Members

- Static Protected Member Functions inherited from wpi::SmallPtrSetImplBase
static void * getTombstoneMarker ()
 
static void * getEmptyMarker ()
 
- Protected Attributes inherited from wpi::SmallPtrSetImplBase
const void ** SmallArray
 SmallArray - Points to a fixed size set of buckets, used in 'small mode'. More...
 
const void ** CurArray
 CurArray - This is the current set of buckets. More...
 
unsigned CurArraySize
 CurArraySize - The allocated size of CurArray, always a power of two. More...
 
unsigned NumNonEmpty
 Number of elements in CurArray that contain a value or are a tombstone. More...
 
unsigned NumTombstones
 Number of tombstones in CurArray. More...
 

Detailed Description

template<typename PtrType>
class wpi::SmallPtrSetImpl< PtrType >

A templated base class for SmallPtrSet which provides the typesafe interface that is common across all small sizes.

This is particularly useful for passing around between interface boundaries to avoid encoding a particular small size in the interface boundary.

Member Typedef Documentation

◆ const_iterator

template<typename PtrType >
using wpi::SmallPtrSetImpl< PtrType >::const_iterator = SmallPtrSetIterator<PtrType>

◆ iterator

template<typename PtrType >
using wpi::SmallPtrSetImpl< PtrType >::iterator = SmallPtrSetIterator<PtrType>

◆ key_type

template<typename PtrType >
using wpi::SmallPtrSetImpl< PtrType >::key_type = ConstPtrType

◆ value_type

template<typename PtrType >
using wpi::SmallPtrSetImpl< PtrType >::value_type = PtrType

Constructor & Destructor Documentation

◆ SmallPtrSetImpl()

template<typename PtrType >
wpi::SmallPtrSetImpl< PtrType >::SmallPtrSetImpl ( const SmallPtrSetImpl< PtrType > &  )
delete

Member Function Documentation

◆ begin()

template<typename PtrType >
iterator wpi::SmallPtrSetImpl< PtrType >::begin ( ) const
inline

◆ contains()

template<typename PtrType >
bool wpi::SmallPtrSetImpl< PtrType >::contains ( ConstPtrType  Ptr) const
inline

◆ count()

template<typename PtrType >
size_type wpi::SmallPtrSetImpl< PtrType >::count ( ConstPtrType  Ptr) const
inline

count - Return 1 if the specified pointer is in the set, 0 otherwise.

◆ end()

template<typename PtrType >
iterator wpi::SmallPtrSetImpl< PtrType >::end ( ) const
inline

◆ erase()

template<typename PtrType >
bool wpi::SmallPtrSetImpl< PtrType >::erase ( PtrType  Ptr)
inline

erase - If the set contains the specified pointer, remove it and return true, otherwise return false.

◆ find()

template<typename PtrType >
iterator wpi::SmallPtrSetImpl< PtrType >::find ( ConstPtrType  Ptr) const
inline

◆ insert() [1/4]

template<typename PtrType >
iterator wpi::SmallPtrSetImpl< PtrType >::insert ( iterator  ,
PtrType  Ptr 
)
inline

Insert the given pointer with an iterator hint that is ignored.

This is identical to calling insert(Ptr), but allows SmallPtrSet to be used by std::insert_iterator and std::inserter().

◆ insert() [2/4]

template<typename PtrType >
template<typename IterT >
void wpi::SmallPtrSetImpl< PtrType >::insert ( IterT  I,
IterT  E 
)
inline

◆ insert() [3/4]

template<typename PtrType >
std::pair< iterator, bool > wpi::SmallPtrSetImpl< PtrType >::insert ( PtrType  Ptr)
inline

Inserts Ptr if and only if there is no element in the container equal to Ptr.

The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element equal to Ptr.

◆ insert() [4/4]

template<typename PtrType >
void wpi::SmallPtrSetImpl< PtrType >::insert ( std::initializer_list< PtrType >  IL)
inline

◆ SmallPtrSetImplBase() [1/3]

template<typename PtrType >
wpi::SmallPtrSetImplBase::SmallPtrSetImplBase ( const void **  SmallStorage,
const SmallPtrSetImplBase that 
)
protected

◆ SmallPtrSetImplBase() [2/3]

template<typename PtrType >
wpi::SmallPtrSetImplBase::SmallPtrSetImplBase ( const void **  SmallStorage,
unsigned  SmallSize 
)
inlineexplicitprotected

◆ SmallPtrSetImplBase() [3/3]

template<typename PtrType >
wpi::SmallPtrSetImplBase::SmallPtrSetImplBase ( const void **  SmallStorage,
unsigned  SmallSize,
SmallPtrSetImplBase &&  that 
)
protected

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