本文整理汇总了C++中HeapVector::end方法的典型用法代码示例。如果您正苦于以下问题:C++ HeapVector::end方法的具体用法?C++ HeapVector::end怎么用?C++ HeapVector::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HeapVector
的用法示例。
在下文中一共展示了HeapVector::end方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: serviceAnimations
void AnimationTimeline::serviceAnimations(TimingUpdateReason reason)
{
TRACE_EVENT0("blink", "AnimationTimeline::serviceAnimations");
m_lastCurrentTimeInternal = currentTimeInternal();
HeapVector<Member<Animation>> animations;
animations.reserveInitialCapacity(m_animationsNeedingUpdate.size());
for (Animation* animation : m_animationsNeedingUpdate)
animations.append(animation);
std::sort(animations.begin(), animations.end(), Animation::hasLowerPriority);
for (Animation* animation : animations) {
if (!animation->update(reason))
m_animationsNeedingUpdate.remove(animation);
}
ASSERT(m_outdatedAnimationCount == 0);
ASSERT(m_lastCurrentTimeInternal == currentTimeInternal() || (std::isnan(currentTimeInternal()) && std::isnan(m_lastCurrentTimeInternal)));
#if ENABLE(ASSERT)
for (const auto& animation : m_animationsNeedingUpdate)
ASSERT(!animation->outdated());
#endif
}
示例2:
HeapVector<Member<Animation>> AnimationTimeline::getAnimations()
{
HeapVector<Member<Animation>> animations;
for (const auto& animation : m_animations) {
if (animation->effect() && (animation->effect()->isCurrent() || animation->effect()->isInEffect()))
animations.append(animation);
}
std::sort(animations.begin(), animations.end(), compareAnimations);
return animations;
}
示例3: scheduledEventTimerFired
void RTCDTMFSender::scheduledEventTimerFired(TimerBase*) {
if (m_stopped)
return;
HeapVector<Member<Event>> events;
events.swap(m_scheduledEvents);
HeapVector<Member<Event>>::iterator it = events.begin();
for (; it != events.end(); ++it)
dispatchEvent((*it).release());
}
示例4: scheduledEventTimerFired
void RTCDataChannel::scheduledEventTimerFired(Timer<RTCDataChannel>*)
{
HeapVector<Member<Event>> events;
events.swap(m_scheduledEvents);
HeapVector<Member<Event>>::iterator it = events.begin();
for (; it != events.end(); ++it)
dispatchEvent((*it).release());
events.clear();
}
示例5: updateActiveCues
void CueTimeline::updateActiveCues(double movieTime) {
// 4.8.10.8 Playing the media resource
// If the current playback position changes while the steps are running,
// then the user agent must wait for the steps to complete, and then must
// immediately rerun the steps.
if (ignoreUpdateRequests())
return;
HTMLMediaElement& mediaElement = this->mediaElement();
// Don't run the "time marches on" algorithm if the document has been
// detached. This primarily guards against dispatch of events w/
// HTMLTrackElement targets.
if (mediaElement.document().isDetached())
return;
// https://html.spec.whatwg.org/#time-marches-on
// 1 - Let current cues be a list of cues, initialized to contain all the
// cues of all the hidden, showing, or showing by default text tracks of the
// media element (not the disabled ones) whose start times are less than or
// equal to the current playback position and whose end times are greater
// than the current playback position.
CueList currentCues;
// The user agent must synchronously unset [the text track cue active] flag
// whenever ... the media element's readyState is changed back to
// kHaveNothing.
if (mediaElement.getReadyState() != HTMLMediaElement::kHaveNothing &&
mediaElement.webMediaPlayer())
currentCues =
m_cueTree.allOverlaps(m_cueTree.createInterval(movieTime, movieTime));
CueList previousCues;
CueList missedCues;
// 2 - Let other cues be a list of cues, initialized to contain all the cues
// of hidden, showing, and showing by default text tracks of the media
// element that are not present in current cues.
previousCues = m_currentlyActiveCues;
// 3 - Let last time be the current playback position at the time this
// algorithm was last run for this media element, if this is not the first
// time it has run.
double lastTime = m_lastUpdateTime;
double lastSeekTime = mediaElement.lastSeekTime();
// 4 - If the current playback position has, since the last time this
// algorithm was run, only changed through its usual monotonic increase
// during normal playback, then let missed cues be the list of cues in other
// cues whose start times are greater than or equal to last time and whose
// end times are less than or equal to the current playback position.
// Otherwise, let missed cues be an empty list.
if (lastTime >= 0 && lastSeekTime < movieTime) {
CueList potentiallySkippedCues =
m_cueTree.allOverlaps(m_cueTree.createInterval(lastTime, movieTime));
for (CueInterval cue : potentiallySkippedCues) {
// Consider cues that may have been missed since the last seek time.
if (cue.low() > std::max(lastSeekTime, lastTime) &&
cue.high() < movieTime)
missedCues.append(cue);
}
}
m_lastUpdateTime = movieTime;
// 5 - If the time was reached through the usual monotonic increase of the
// current playback position during normal playback, and if the user agent
// has not fired a timeupdate event at the element in the past 15 to 250ms
// and is not still running event handlers for such an event, then the user
// agent must queue a task to fire a simple event named timeupdate at the
// element. (In the other cases, such as explicit seeks, relevant events get
// fired as part of the overall process of changing the current playback
// position.)
if (!mediaElement.seeking() && lastSeekTime < lastTime)
mediaElement.scheduleTimeupdateEvent(true);
// Explicitly cache vector sizes, as their content is constant from here.
size_t missedCuesSize = missedCues.size();
size_t previousCuesSize = previousCues.size();
// 6 - If all of the cues in current cues have their text track cue active
// flag set, none of the cues in other cues have their text track cue active
// flag set, and missed cues is empty, then abort these steps.
bool activeSetChanged = missedCuesSize;
for (size_t i = 0; !activeSetChanged && i < previousCuesSize; ++i) {
if (!currentCues.contains(previousCues[i]) &&
previousCues[i].data()->isActive())
activeSetChanged = true;
}
for (CueInterval currentCue : currentCues) {
// Notify any cues that are already active of the current time to mark
// past and future nodes. Any inactive cues have an empty display state;
// they will be notified of the current time when the display state is
// updated.
if (currentCue.data()->isActive())
//.........这里部分代码省略.........