PxFlags
Defined in include/foundation/PxFlags.h
-
template<typename enumtype, typename storagetype = PxU32>
class PxFlags 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, PxU8);
PxFlags<MyEnum::Enum, PxU8> myFlags; myFlags |= MyEnum::eMAN; myFlags |= MyEnum::eBEAR | MyEnum::ePIG; if(myFlags & MyEnum::eBEAR) { doSomething(); }
Public Types
-
typedef storagetype InternalType
Public Functions
-
inline explicit PxFlags(const PxEMPTY)
-
inline PxFlags()
-
inline PxFlags(const PxFlags<enumtype, storagetype> &f)
-
inline explicit PxFlags(storagetype b)
-
inline bool operator==(const PxFlags<enumtype, storagetype> &f) const
-
inline bool operator==(bool b) const
-
inline bool operator!=(const PxFlags<enumtype, storagetype> &f) const
-
inline PxFlags<enumtype, storagetype> &operator=(const PxFlags<enumtype, storagetype> &f)
-
inline PxFlags<enumtype, storagetype> &operator=(enumtype e)
-
inline PxFlags<enumtype, storagetype> &operator|=(enumtype e)
-
inline PxFlags<enumtype, storagetype> &operator|=(const PxFlags<enumtype, storagetype> &f)
-
inline PxFlags<enumtype, storagetype> operator|(enumtype e) const
-
inline PxFlags<enumtype, storagetype> operator|(const PxFlags<enumtype, storagetype> &f) const
-
inline PxFlags<enumtype, storagetype> &operator&=(enumtype e)
-
inline PxFlags<enumtype, storagetype> &operator&=(const PxFlags<enumtype, storagetype> &f)
-
inline PxFlags<enumtype, storagetype> operator&(enumtype e) const
-
inline PxFlags<enumtype, storagetype> operator&(const PxFlags<enumtype, storagetype> &f) const
-
inline PxFlags<enumtype, storagetype> &operator^=(enumtype e)
-
inline PxFlags<enumtype, storagetype> &operator^=(const PxFlags<enumtype, storagetype> &f)
-
inline PxFlags<enumtype, storagetype> operator^(enumtype e) const
-
inline PxFlags<enumtype, storagetype> operator^(const PxFlags<enumtype, storagetype> &f) const
-
inline PxFlags<enumtype, storagetype> operator~() const
-
inline operator bool() const
-
inline PxFlags<enumtype, storagetype> &setAll(enumtype e)
Friends
-
inline friend PxFlags<enumtype, storagetype> operator&(enumtype a, PxFlags<enumtype, storagetype> &b)
-
typedef storagetype InternalType