PxFlags< enumtype, storagetype > Class Template Reference
[Foundation]
Container for bitfield flag variables associated with a specific enum type.
More...
#include <PxFlags.h>
![Collaboration graph](classPxFlags__coll__graph.png)
Public Member Functions | |
PX_INLINE | PxFlags (const PxEmpty &) |
PX_INLINE | PxFlags (void) |
PX_INLINE | PxFlags (enumtype e) |
PX_INLINE | PxFlags (const PxFlags< enumtype, storagetype > &f) |
PX_INLINE | PxFlags (storagetype b) |
PX_INLINE bool | operator== (enumtype e) const |
PX_INLINE bool | operator== (const PxFlags< enumtype, storagetype > &f) const |
PX_INLINE bool | operator== (bool b) const |
PX_INLINE bool | operator!= (enumtype e) const |
PX_INLINE bool | operator!= (const PxFlags< enumtype, storagetype > &f) const |
PX_INLINE PxFlags< enumtype, storagetype > & | operator= (enumtype e) |
PX_INLINE PxFlags< enumtype, storagetype > & | operator|= (enumtype e) |
PX_INLINE PxFlags< enumtype, storagetype > & | operator|= (const PxFlags< enumtype, storagetype > &f) |
PX_INLINE PxFlags< enumtype, storagetype > | operator| (enumtype e) const |
PX_INLINE PxFlags< enumtype, storagetype > | operator| (const PxFlags< enumtype, storagetype > &f) const |
PX_INLINE PxFlags< enumtype, storagetype > & | operator&= (enumtype e) |
PX_INLINE PxFlags< enumtype, storagetype > & | operator&= (const PxFlags< enumtype, storagetype > &f) |
PX_INLINE PxFlags< enumtype, storagetype > | operator& (enumtype e) const |
PX_INLINE PxFlags< enumtype, storagetype > | operator& (const PxFlags< enumtype, storagetype > &f) const |
PX_INLINE PxFlags< enumtype, storagetype > & | operator^= (enumtype e) |
PX_INLINE PxFlags< enumtype, storagetype > & | operator^= (const PxFlags< enumtype, storagetype > &f) |
PX_INLINE PxFlags< enumtype, storagetype > | operator^ (enumtype e) const |
PX_INLINE PxFlags< enumtype, storagetype > | operator^ (const PxFlags< enumtype, storagetype > &f) const |
PX_INLINE PxFlags< enumtype, storagetype > | operator~ (void) const |
PX_INLINE | operator bool (void) const |
PX_INLINE | operator PxU8 (void) const |
PX_INLINE | operator PxU16 (void) const |
PX_INLINE | operator PxU32 (void) const |
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 = PxU32>
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, PxU8);
PxFlags<MyEnum::Enum, PxU8> myFlags; myFlags |= MyEnum::eMAN; myFlags |= MyEnum::eBEAR | MyEnum::ePIG; if(myFlags & MyEnum::eBEAR) { doSomething(); }
Constructor & Destructor Documentation
PX_INLINE PxFlags< enumtype, storagetype >::PxFlags | ( | const PxEmpty & | ) | [inline, explicit] |
Friends And Related Function Documentation
PX_INLINE PxFlags<enumtype,storagetype> operator& | ( | enumtype | a, | |
PxFlags< enumtype, storagetype > & | b | |||
) | [friend] |
Member Data Documentation
storagetype PxFlags< enumtype, storagetype >::mBits [private] |
Referenced by PxFlags< enumtype, storagetype >::clear(), PxFlags< enumtype, storagetype >::operator bool(), PxFlags< enumtype, storagetype >::operator PxU16(), PxFlags< enumtype, storagetype >::operator PxU32(), PxFlags< enumtype, storagetype >::operator PxU8(), PxFlags< enumtype, storagetype >::operator!=(), PxFlags< enumtype, storagetype >::operator&(), PxFlags< enumtype, storagetype >::operator&=(), PxFlags< enumtype, storagetype >::operator=(), PxFlags< enumtype, storagetype >::operator==(), PxFlags< enumtype, storagetype >::operator^(), PxFlags< enumtype, storagetype >::operator^=(), PxFlags< enumtype, storagetype >::operator|=(), PxFlags< enumtype, storagetype >::operator~(), and PxFlags< enumtype, storagetype >::PxFlags().
The documentation for this class was generated from the following file:
Copyright © 2008-2012 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com