aboutsummaryrefslogtreecommitdiffstats
path: root/src/UpdateQueue.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-17 21:34:36 +0200
committerMax Kellermann <max@duempel.org>2013-10-17 21:45:53 +0200
commitd44880dfa99197a8c1f4b65416470e6ffbe534f6 (patch)
treed1f0fdf941adb11802c8b7ae8811b707c3ac5794 /src/UpdateQueue.hxx
parent0c63632cc2354e662da67453043a039efb65ae28 (diff)
downloadmpd-d44880dfa99197a8c1f4b65416470e6ffbe534f6.tar.gz
mpd-d44880dfa99197a8c1f4b65416470e6ffbe534f6.tar.xz
mpd-d44880dfa99197a8c1f4b65416470e6ffbe534f6.zip
UpdateGlue: handle update id management
Add UpdateQueueItem::id to keep track of the id in every item. Replaces thhe hack in update_queue_push().
Diffstat (limited to '')
-rw-r--r--src/UpdateQueue.hxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/UpdateQueue.hxx b/src/UpdateQueue.hxx
index 80c15f600..2769cc589 100644
--- a/src/UpdateQueue.hxx
+++ b/src/UpdateQueue.hxx
@@ -26,19 +26,21 @@
struct UpdateQueueItem {
std::string path_utf8;
+ unsigned id;
bool discard;
- UpdateQueueItem() = default;
- UpdateQueueItem(const char *_path, bool _discard)
- :path_utf8(_path), discard(_discard) {}
+ UpdateQueueItem():id(0) {}
+ UpdateQueueItem(const char *_path, bool _discard,
+ unsigned _id)
+ :path_utf8(_path), id(_id), discard(_discard) {}
bool IsDefined() const {
- return !path_utf8.empty();
+ return id != 0;
}
};
-unsigned
-update_queue_push(const char *path, bool discard, unsigned base);
+bool
+update_queue_push(const char *path, bool discard, unsigned id);
UpdateQueueItem
update_queue_shift();