30 #ifndef PXFOUNDATION_PXFLAGS_H 31 #define PXFOUNDATION_PXFLAGS_H 72 template <
typename enumtype,
typename storagetype = u
int32_t>
135 #define PX_FLAGS_OPERATORS(enumtype, storagetype) \ 136 PX_CUDA_CALLABLE PX_INLINE PxFlags<enumtype, storagetype> operator|(enumtype a, enumtype b) \ 138 PxFlags<enumtype, storagetype> r(a); \ 142 PX_CUDA_CALLABLE PX_INLINE PxFlags<enumtype, storagetype> operator&(enumtype a, enumtype b) \ 144 PxFlags<enumtype, storagetype> r(a); \ 148 PX_CUDA_CALLABLE PX_INLINE PxFlags<enumtype, storagetype> operator~(enumtype a) \ 150 return ~PxFlags<enumtype, storagetype>(a); \ 153 #define PX_FLAGS_TYPEDEF(x, y) \ 154 typedef PxFlags<x::Enum, y> x##s; \ 155 PX_FLAGS_OPERATORS(x::Enum, y) 157 template <
typename enumtype,
typename storagetype>
163 template <
typename enumtype,
typename storagetype>
166 mBits =
static_cast<storagetype
>(e);
169 template <
typename enumtype,
typename storagetype>
175 template <
typename enumtype,
typename storagetype>
181 template <
typename enumtype,
typename storagetype>
184 return (mBits & static_cast<storagetype>(e)) ==
static_cast<storagetype
>(e);
187 template <
typename enumtype,
typename storagetype>
190 mBits =
static_cast<storagetype
>(e);
194 template <
typename enumtype,
typename storagetype>
197 return mBits ==
static_cast<storagetype
>(e);
200 template <
typename enumtype,
typename storagetype>
203 return mBits == f.
mBits;
206 template <
typename enumtype,
typename storagetype>
209 return bool(*
this) == b;
212 template <
typename enumtype,
typename storagetype>
215 return mBits !=
static_cast<storagetype
>(e);
218 template <
typename enumtype,
typename storagetype>
221 return mBits != f.
mBits;
224 template <
typename enumtype,
typename storagetype>
227 mBits =
static_cast<storagetype
>(e);
231 template <
typename enumtype,
typename storagetype>
238 template <
typename enumtype,
typename storagetype>
241 mBits |=
static_cast<storagetype
>(e);
245 template <
typename enumtype,
typename storagetype>
253 template <
typename enumtype,
typename storagetype>
261 template <
typename enumtype,
typename storagetype>
270 template <
typename enumtype,
typename storagetype>
273 mBits &=
static_cast<storagetype
>(e);
277 template <
typename enumtype,
typename storagetype>
285 template <
typename enumtype,
typename storagetype>
289 out.
mBits &=
static_cast<storagetype
>(e);
293 template <
typename enumtype,
typename storagetype>
302 template <
typename enumtype,
typename storagetype>
305 mBits ^=
static_cast<storagetype
>(e);
309 template <
typename enumtype,
typename storagetype>
317 template <
typename enumtype,
typename storagetype>
321 out.
mBits ^=
static_cast<storagetype
>(e);
325 template <
typename enumtype,
typename storagetype>
334 template <
typename enumtype,
typename storagetype>
338 out.
mBits = storagetype(~mBits);
342 template <
typename enumtype,
typename storagetype>
345 return mBits ? true :
false;
348 template <
typename enumtype,
typename storagetype>
351 return static_cast<uint8_t
>(mBits);
354 template <
typename enumtype,
typename storagetype>
357 return static_cast<uint16_t
>(mBits);
360 template <
typename enumtype,
typename storagetype>
363 return static_cast<uint32_t
>(mBits);
366 template <
typename enumtype,
typename storagetype>
369 mBits &= ~static_cast<storagetype>(e);
376 #endif // #ifndef PXFOUNDATION_PXFLAGS_H Definition: GuContactBuffer.h:37
PX_CUDA_CALLABLE PX_INLINE bool operator!=(enumtype e) const
PX_CUDA_CALLABLE PX_INLINE bool operator==(enumtype e) const
PX_CUDA_CALLABLE PX_INLINE PxFlags(const PxEMPTY)
Definition: PxFlags.h:78
storagetype mBits
Definition: PxFlags.h:130
PX_CUDA_CALLABLE PX_INLINE bool isSet(enumtype e) const
PX_CUDA_CALLABLE PX_INLINE PxFlags(void)
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype > operator~(void) const
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype > & operator^=(enumtype e)
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype > operator|(enumtype e) const
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype > operator &(enumtype e) const
storagetype InternalType
Definition: PxFlags.h:76
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)
PxEMPTY
Definition: Px.h:70
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype > & set(enumtype e)
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype > & operator|=(enumtype e)
PX_CUDA_CALLABLE PX_INLINE void clear(enumtype e)
friend PX_INLINE PxFlags< enumtype, storagetype > operator &(enumtype a, PxFlags< enumtype, storagetype > &b)
Definition: PxFlags.h:122
Container for bitfield flag variables associated with a specific enum type.
Definition: PxFlags.h:73
#define PX_INLINE
Definition: PxPreprocessor.h:336
#define PX_CUDA_CALLABLE
Definition: PxPreprocessor.h:460
PX_CUDA_CALLABLE PX_INLINE PxFlags< enumtype, storagetype > operator^(enumtype e) const