aboutsummaryrefslogtreecommitdiff
path: root/jobs/mediathumbnailjob.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-03-03 12:29:53 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2017-03-10 13:05:29 +0900
commit22ea325ef03cdc15f2c36b1e0c82c84dec01cfb5 (patch)
treef75509dca94447ce65aec5763c0e89a98f63f70a /jobs/mediathumbnailjob.cpp
parentc8d31ab28db19a7e1f1ca9cf1a35de17158c43fb (diff)
downloadlibquotient-22ea325ef03cdc15f2c36b1e0c82c84dec01cfb5.tar.gz
libquotient-22ea325ef03cdc15f2c36b1e0c82c84dec01cfb5.zip
Use special indices instead of iterators for persistent pointers into timeline + no more discarding read markers to events that haven't arrived yet
When using deque::const_reverse_iterator for read markers and eventsIndex, I didn't realise that insertions into std::deque invalidate iterators (though preserve references and pointers). Therefore, a small TimelineItem class has been introduced that stores an event together with a persistent index that is generated upon insertion into the timeline (timeline.back()+1 for newer events, timeline.front()-1 for older events). Using such indices, we can still reach an event by it's index in constant time, while avoiding a problem with invalidating iterators. While rewriting the code, another problem has been detected with read markers to events that haven't yet arrived to the timeline (in particular, older events). The old code simply discarded such read markers. The new code stores such read markers anyway, so that when that event arrives, it could be matched against the stored last-read-event id.
Diffstat (limited to 'jobs/mediathumbnailjob.cpp')
0 files changed, 0 insertions, 0 deletions