Lines Matching refs:shift

127      * \param shift DO NO USE. used internally
132 static constexpr Flag minMask(Flag maxValue, int shift=sizeof(Flag) * 4) {
135 return shift ? minMask<Flag>(Flag(maxValue | (maxValue >> shift)), shift >> 1) : maxValue;
141 * This method helps around the C-language limitation, when left-shift of a negative value with
144 * \param value value to shift
145 * \param shift amount of shift
149 static constexpr IntFlag lshift(Flag value, int shift) {
150 return shift ? value << shift : value;
156 * Determines whether mask can be combined with base-mask for a given left shift.
161 * \param shift desired left shift to be used for mask
162 * \param baseShift left shift used by T or 0 if T is not flagged by Flag
169 Flag mask, IntFlag baseMask, Flag sharedMask, int shift,
172 // verify that shift is valid and mask can be shifted
173 shift >= 0 && (mask & topBits<Flag>(shift)) == 0 &&
178 // if sharing masks, shift must be the base's shift.
182 shift == baseShift) :
186 (mask & (effectiveMask >> shift)) == 0);
191 * Calculates the minimum (left) shift required to combine a mask with the mask of an
197 * \param baseShift left shift used by T
200 * \return a non-negative minimum left shift value if mask can be combined with baseMask,
211 // if sharing masks, shift must be base's shift. verify that shared mask is part of
212 // base mask and mask, and that desired mask still fits with base's shift value
214 (canCombine(mask, baseMask, sharedMask, baseShift /* shift */,
217 // otherwise, see if 0-shift works
228 * Helper method that increments a non-negative (shift) value.
232 * \param shift (shift) value to increment
234 * \return original shift if it was negative; otherwise, the shift incremented by one.
236 static constexpr int incShift(int shift) {
237 return shift + (shift >= 0);
272 static constexpr int shift = 0; ///<left shift of flags in a potentially flagged class
277 * Type support utility that calculates the minimum (left) shift required to combine a mask
289 /// minimum (left) shift required, or -1 if masks cannot be combined
292 mask_of<T, Flag>::shift, mask_of<T, Flag>::effective_value);
312 mask_of<T, Flag>::shift, mask_of<T, Flag>::effective_value);
323 static constexpr int shift = T::sFlagShift;
337 * \param MASK mask for the bits used in flag (before any shift)
340 * \param SHIFT optional left shift for MASK to combine with T's mask (or -1, if masks should not
355 static constexpr int sFlagShift = SHIFT > 0 ? SHIFT : 0; ///< the left shift applied to flags
373 * flags for a particular mask and left shift.
376 * \param shift left shifts to use
380 inline constexpr IntFlag getFlagsHelper(IntFlag mask, int shift) const {
381 return (mFlags >> shift) & mask;
386 * in the bitmask using a particulare left shift.
389 * \param shift left shifts to use
393 inline void setFlagsHelper(IntFlag mask, int shift, IntFlag flags) {
394 mFlags = Flag((mFlags & ~(mask << shift)) | ((flags & mask) << shift));
463 static constexpr int sFlagShift = SHIFT; ///< the left shift applied to the flags