// Activities that should be processed last are kept in a different // ActivityQueue, and later appended to the end of the maCurrentActivitiesWaiting // on the beginning of ActivitiesQueue::process()
maCurrentTailActivitiesWaiting.push_back( pActivity );
// If there are activities to be processed last append them to the end of the ActivitiesQueue
maCurrentActivitiesWaiting.insert( maCurrentActivitiesWaiting.end(),
maCurrentTailActivitiesWaiting.begin(),
maCurrentTailActivitiesWaiting.end() );
maCurrentTailActivitiesWaiting.clear();
// accumulate time lag for all activities, and lag time // base if necessary: double fLag = 0.0; for ( constauto& rxActivity : maCurrentActivitiesWaiting )
fLag = std::max<double>( fLag, rxActivity->calcTimeLag() ); if (fLag > 0.0)
{
mpTimer->adjustTimer( -fLag );
}
// process list of activities while( !maCurrentActivitiesWaiting.empty() )
{ // process topmost activity
ActivitySharedPtr pActivity( maCurrentActivitiesWaiting.front() );
maCurrentActivitiesWaiting.pop_front();
bool bReinsert( false );
try
{ // fire up activity
bReinsert = pActivity->perform();
} catch( uno::RuntimeException& )
{ throw;
} catch( uno::Exception& )
{ // catch anything here, we don't want // to leave this scope under _any_ // circumstance. Although, do _not_ // reinsert an activity that threw // once.
// NOTE: we explicitly don't catch(...) here, // since this will also capture segmentation // violations and the like. In such a case, we // still better let our clients now...
TOOLS_WARN_EXCEPTION( "slideshow", "" );
} catch( SlideShowException& )
{ // catch anything here, we don't want // to leave this scope under _any_ // circumstance. Although, do _not_ // reinsert an activity that threw // once.
// NOTE: we explicitly don't catch(...) here, // since this will also capture segmentation // violations and the like. In such a case, we // still better let our clients now...
SAL_WARN("slideshow", "::presentation::internal::ActivitiesQueue: Activity threw a SlideShowException, removing from ring" );
}
if( !maCurrentActivitiesReinsert.empty() )
{ // reinsert all processed, but not finished // activities back to waiting queue. With swap(), // we kill two birds with one stone: we reuse the // list nodes, and we clear the // maCurrentActivitiesReinsert list
maCurrentActivitiesWaiting.swap( maCurrentActivitiesReinsert );
}
}
void ActivitiesQueue::processDequeued()
{ // notify all dequeued activities from last round for( constauto& pActivity : maDequeuedActivities )
pActivity->dequeued();
maDequeuedActivities.clear();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.