PxFlags< enumtype, storagetype > Class Template Reference

Container for bitfield flag variables associated with a specific enum type. More...

#include <PxFlags.h>

Collaboration diagram for PxFlags< enumtype, storagetype >:

Public Types

typedef storagetype InternalType
 

Public Member Functions

PX_CUDA_CALLABLE PX_INLINE PxFlags (const PxEMPTY)
 
PX_CUDA_CALLABLE PX_INLINE PxFlags (void)
 
PX_CUDA_CALLABLE PX_INLINE PxFlags (enumtype e)
 
PX_CUDA_CALLABLE PX_INLINE PxFlags (const PxFlags< enumtype, storagetype > &f)
 
PX_CUDA_CALLABLE PX_INLINE PxFlags (storagetype b)
 
PX_CUDA_CALLABLE PX_INLINE bool isSet (enumtype e) const
 
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype > & set (enumtype e)
 
PX_CUDA_CALLABLE PX_INLINE bool operator== (enumtype e) const
 
PX_CUDA_CALLABLE PX_INLINE bool operator== (const PxFlags< enumtype, storagetype > &f) const
 
PX_CUDA_CALLABLE PX_INLINE bool operator== (bool b) const
 
PX_CUDA_CALLABLE PX_INLINE bool operator!= (enumtype e) const
 
PX_CUDA_CALLABLE PX_INLINE bool operator!= (const PxFlags< enumtype, storagetype > &f) const
 
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype > & operator= (const PxFlags< enumtype, storagetype > &f)
 
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype > & operator= (enumtype e)
 
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype > & operator|= (enumtype e)
 
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype > & operator|= (const PxFlags< enumtype, storagetype > &f)
 
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype > operator| (enumtype e) const
 
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype > operator| (const PxFlags< enumtype, storagetype > &f) const
 
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype > & operator &= (enumtype e)
 
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype > & operator &= (const PxFlags< enumtype, storagetype > &f)
 
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype > operator & (enumtype e) const
 
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype > operator & (const PxFlags< enumtype, storagetype > &f) const
 
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype > & operator^= (enumtype e)
 
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype > & operator^= (const PxFlags< enumtype, storagetype > &f)
 
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype > operator^ (enumtype e) const
 
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype > operator^ (const PxFlags< enumtype, storagetype > &f) const
 
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype > operator~ (void) const
 
PX_CUDA_CALLABLE PX_INLINE operator bool (void) const
 
PX_CUDA_CALLABLE PX_INLINE operator uint8_t (void) const
 
PX_CUDA_CALLABLE PX_INLINE operator uint16_t (void) const
 
PX_CUDA_CALLABLE PX_INLINE operator uint32_t (void) const
 
PX_CUDA_CALLABLE PX_INLINE void clear (enumtype e)
 

Private Attributes

storagetype mBits
 

Friends

PX_INLINE PxFlags< enumtype, storagetype > operator & (enumtype a, PxFlags< enumtype, storagetype > &b)
 

Detailed Description

template<typename enumtype, typename storagetype = uint32_t>
class PxFlags< enumtype, storagetype >

Container for bitfield flag variables associated with a specific enum type.

This allows for type safe manipulation for bitfields.

Example

enum that defines each bit... struct MyEnum { enum Enum { eMAN = 1, eBEAR = 2, ePIG = 4, }; };

implements some convenient global operators. PX_FLAGS_OPERATORS(MyEnum::Enum, uint8_t);

PxFlags<MyEnum::Enum, uint8_t> myFlags; myFlags |= MyEnum::eMAN; myFlags |= MyEnum::eBEAR | MyEnum::ePIG; if(myFlags & MyEnum::eBEAR) { doSomething(); }

Member Typedef Documentation

◆ InternalType

template<typename enumtype, typename storagetype = uint32_t>
typedef storagetype PxFlags< enumtype, storagetype >::InternalType

Constructor & Destructor Documentation

◆ PxFlags() [1/5]

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype >::PxFlags ( const PxEMPTY  )
inlineexplicit

◆ PxFlags() [2/5]

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype >::PxFlags ( void  )

◆ PxFlags() [3/5]

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype >::PxFlags ( enumtype  e)

◆ PxFlags() [4/5]

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype >::PxFlags ( const PxFlags< enumtype, storagetype > &  f)

◆ PxFlags() [5/5]

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype >::PxFlags ( storagetype  b)
explicit

Member Function Documentation

◆ clear()

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE void PxFlags< enumtype, storagetype >::clear ( enumtype  e)

◆ isSet()

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE bool PxFlags< enumtype, storagetype >::isSet ( enumtype  e) const

◆ operator &() [1/2]

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE PxFlags<enumtype, storagetype> PxFlags< enumtype, storagetype >::operator& ( enumtype  e) const

◆ operator &() [2/2]

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE PxFlags<enumtype, storagetype> PxFlags< enumtype, storagetype >::operator& ( const PxFlags< enumtype, storagetype > &  f) const

◆ operator &=() [1/2]

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE PxFlags<enumtype, storagetype>& PxFlags< enumtype, storagetype >::operator&= ( enumtype  e)

◆ operator &=() [2/2]

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE PxFlags<enumtype, storagetype>& PxFlags< enumtype, storagetype >::operator&= ( const PxFlags< enumtype, storagetype > &  f)

◆ operator bool()

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype >::operator bool ( void  ) const

◆ operator uint16_t()

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype >::operator uint16_t ( void  ) const

◆ operator uint32_t()

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype >::operator uint32_t ( void  ) const

◆ operator uint8_t()

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype >::operator uint8_t ( void  ) const

◆ operator!=() [1/2]

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE bool PxFlags< enumtype, storagetype >::operator!= ( enumtype  e) const

◆ operator!=() [2/2]

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE bool PxFlags< enumtype, storagetype >::operator!= ( const PxFlags< enumtype, storagetype > &  f) const

◆ operator=() [1/2]

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE PxFlags<enumtype, storagetype>& PxFlags< enumtype, storagetype >::operator= ( const PxFlags< enumtype, storagetype > &  f)

◆ operator=() [2/2]

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE PxFlags<enumtype, storagetype>& PxFlags< enumtype, storagetype >::operator= ( enumtype  e)

◆ operator==() [1/3]

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE bool PxFlags< enumtype, storagetype >::operator== ( enumtype  e) const

◆ operator==() [2/3]

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE bool PxFlags< enumtype, storagetype >::operator== ( const PxFlags< enumtype, storagetype > &  f) const

◆ operator==() [3/3]

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE bool PxFlags< enumtype, storagetype >::operator== ( bool  b) const

◆ operator^() [1/2]

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE PxFlags<enumtype, storagetype> PxFlags< enumtype, storagetype >::operator^ ( enumtype  e) const

◆ operator^() [2/2]

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE PxFlags<enumtype, storagetype> PxFlags< enumtype, storagetype >::operator^ ( const PxFlags< enumtype, storagetype > &  f) const

◆ operator^=() [1/2]

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE PxFlags<enumtype, storagetype>& PxFlags< enumtype, storagetype >::operator^= ( enumtype  e)

◆ operator^=() [2/2]

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE PxFlags<enumtype, storagetype>& PxFlags< enumtype, storagetype >::operator^= ( const PxFlags< enumtype, storagetype > &  f)

◆ operator|() [1/2]

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE PxFlags<enumtype, storagetype> PxFlags< enumtype, storagetype >::operator| ( enumtype  e) const

◆ operator|() [2/2]

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE PxFlags<enumtype, storagetype> PxFlags< enumtype, storagetype >::operator| ( const PxFlags< enumtype, storagetype > &  f) const

◆ operator|=() [1/2]

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE PxFlags<enumtype, storagetype>& PxFlags< enumtype, storagetype >::operator|= ( enumtype  e)

◆ operator|=() [2/2]

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE PxFlags<enumtype, storagetype>& PxFlags< enumtype, storagetype >::operator|= ( const PxFlags< enumtype, storagetype > &  f)

◆ operator~()

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE PxFlags<enumtype, storagetype> PxFlags< enumtype, storagetype >::operator~ ( void  ) const

◆ set()

template<typename enumtype, typename storagetype = uint32_t>
PX_CUDA_CALLABLE PX_INLINE PxFlags<enumtype, storagetype>& PxFlags< enumtype, storagetype >::set ( enumtype  e)

Friends And Related Function Documentation

◆ operator &

template<typename enumtype, typename storagetype = uint32_t>
PX_INLINE PxFlags<enumtype, storagetype> operator& ( enumtype  a,
PxFlags< enumtype, storagetype > &  b 
)
friend

Member Data Documentation

◆ mBits

template<typename enumtype, typename storagetype = uint32_t>
storagetype PxFlags< enumtype, storagetype >::mBits
private

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