本文整理汇总了C++中BitSet32::has_bit方法的典型用法代码示例。如果您正苦于以下问题:C++ BitSet32::has_bit方法的具体用法?C++ BitSet32::has_bit怎么用?C++ BitSet32::has_bit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitSet32
的用法示例。
在下文中一共展示了BitSet32::has_bit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ClearPointers
void VelocityTracker::ClearPointers(BitSet32 id_bits) {
BitSet32 remaining_id_bits(current_pointer_id_bits_.value & ~id_bits.value);
current_pointer_id_bits_ = remaining_id_bits;
if (active_pointer_id_ >= 0 && id_bits.has_bit(active_pointer_id_)) {
active_pointer_id_ = !remaining_id_bits.is_empty()
? remaining_id_bits.first_marked_bit()
: -1;
}
strategy_->ClearPointers(id_bits);
}
示例2: AddMovement
void VelocityTracker::AddMovement(const TimeTicks& event_time,
BitSet32 id_bits,
const PointerXY* positions) {
while (id_bits.count() > MAX_POINTERS)
id_bits.clear_last_marked_bit();
if ((current_pointer_id_bits_.value & id_bits.value) &&
(event_time - last_event_time_) >=
base::TimeDelta::FromMilliseconds(kAssumePointerMoveStoppedTimeMs)) {
// We have not received any movements for too long. Assume that all pointers
// have stopped.
strategy_->Clear();
}
last_event_time_ = event_time;
current_pointer_id_bits_ = id_bits;
if (active_pointer_id_ < 0 || !id_bits.has_bit(active_pointer_id_))
active_pointer_id_ = id_bits.is_empty() ? -1 : id_bits.first_marked_bit();
strategy_->AddMovement(event_time, id_bits, positions);
}