WPILibC++ 2024.3.2
wpi::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > Class Template Reference

PointerIntPair - This class implements a pair of a pointer and small integer. More...

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

Public Member Functions

constexpr PointerIntPair ()=default
 
 PointerIntPair (PointerTy PtrVal, IntType IntVal)
 
 PointerIntPair (PointerTy PtrVal)
 
PointerTy getPointer () const
 
IntType getInt () const
 
void setPointer (PointerTy PtrVal) &
 
void setInt (IntType IntVal) &
 
void initWithPointer (PointerTy PtrVal) &
 
void setPointerAndInt (PointerTy PtrVal, IntType IntVal) &
 
PointerTy const * getAddrOfPointer () const
 
PointerTy * getAddrOfPointer ()
 
void * getOpaqueValue () const
 
void setFromOpaqueValue (void *Val) &
 
bool operator== (const PointerIntPair &RHS) const
 
bool operator!= (const PointerIntPair &RHS) const
 
bool operator< (const PointerIntPair &RHS) const
 
bool operator> (const PointerIntPair &RHS) const
 
bool operator<= (const PointerIntPair &RHS) const
 
bool operator>= (const PointerIntPair &RHS) const
 

Static Public Member Functions

static PointerIntPair getFromOpaqueValue (void *V)
 
static PointerIntPair getFromOpaqueValue (const void *V)
 

Detailed Description

template<typename PointerTy, unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
class wpi::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >

PointerIntPair - This class implements a pair of a pointer and small integer.

It is designed to represent this in the space required by one pointer by bitmangling the integer into the low part of the pointer. This can only be done for small integers: typically up to 3 bits, but it depends on the number of bits available according to PointerLikeTypeTraits for the type.

Note that PointerIntPair always puts the IntVal part in the highest bits possible. For example, PointerIntPair<void*, 1, bool> will put the bit for the bool into bit #2, not bit #0, which allows the low two bits to be used for something else. For example, this allows: PointerIntPair<PointerIntPair<void*, 1, bool>, 1, bool> ... and the two bools will land in different bits.

Constructor & Destructor Documentation

◆ PointerIntPair() [1/3]

template<typename PointerTy , unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
constexpr wpi::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::PointerIntPair ( )
constexprdefault

◆ PointerIntPair() [2/3]

template<typename PointerTy , unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
wpi::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::PointerIntPair ( PointerTy  PtrVal,
IntType  IntVal 
)
inline

◆ PointerIntPair() [3/3]

template<typename PointerTy , unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
wpi::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::PointerIntPair ( PointerTy  PtrVal)
inlineexplicit

Member Function Documentation

◆ getAddrOfPointer() [1/2]

template<typename PointerTy , unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
PointerTy * wpi::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::getAddrOfPointer ( )
inline

◆ getAddrOfPointer() [2/2]

template<typename PointerTy , unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
PointerTy const * wpi::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::getAddrOfPointer ( ) const
inline

◆ getFromOpaqueValue() [1/2]

template<typename PointerTy , unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
static PointerIntPair wpi::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::getFromOpaqueValue ( const void *  V)
inlinestatic

◆ getFromOpaqueValue() [2/2]

template<typename PointerTy , unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
static PointerIntPair wpi::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::getFromOpaqueValue ( void *  V)
inlinestatic

◆ getInt()

template<typename PointerTy , unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
IntType wpi::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::getInt ( ) const
inline

◆ getOpaqueValue()

template<typename PointerTy , unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
void * wpi::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::getOpaqueValue ( ) const
inline

◆ getPointer()

template<typename PointerTy , unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
PointerTy wpi::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::getPointer ( ) const
inline

◆ initWithPointer()

template<typename PointerTy , unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
void wpi::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::initWithPointer ( PointerTy  PtrVal) &
inline

◆ operator!=()

template<typename PointerTy , unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
bool wpi::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::operator!= ( const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &  RHS) const
inline

◆ operator<()

template<typename PointerTy , unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
bool wpi::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::operator< ( const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &  RHS) const
inline

◆ operator<=()

template<typename PointerTy , unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
bool wpi::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::operator<= ( const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &  RHS) const
inline

◆ operator==()

template<typename PointerTy , unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
bool wpi::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::operator== ( const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &  RHS) const
inline

◆ operator>()

template<typename PointerTy , unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
bool wpi::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::operator> ( const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &  RHS) const
inline

◆ operator>=()

template<typename PointerTy , unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
bool wpi::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::operator>= ( const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &  RHS) const
inline

◆ setFromOpaqueValue()

template<typename PointerTy , unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
void wpi::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::setFromOpaqueValue ( void *  Val) &
inline

◆ setInt()

template<typename PointerTy , unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
void wpi::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::setInt ( IntType  IntVal) &
inline

◆ setPointer()

template<typename PointerTy , unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
void wpi::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::setPointer ( PointerTy  PtrVal) &
inline

◆ setPointerAndInt()

template<typename PointerTy , unsigned IntBits, typename IntType = unsigned, typename PtrTraits = PointerLikeTypeTraits<PointerTy>, typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
void wpi::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::setPointerAndInt ( PointerTy  PtrVal,
IntType  IntVal 
) &
inline

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