summaryrefslogtreecommitdiff
path: root/include/erebos/storage.h
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2021-02-21 22:16:21 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2021-02-23 22:12:41 +0100
commitc3d6046b25ef0786b8d2919dfa9db4eb05114501 (patch)
tree19af178d6305c3a83859b7d5b07dbc9b1af3aea5 /include/erebos/storage.h
parent52db636c108ab0a16ba0ccf8df55cf28142a230c (diff)
Sync service
Diffstat (limited to 'include/erebos/storage.h')
-rw-r--r--include/erebos/storage.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/erebos/storage.h b/include/erebos/storage.h
index 75b8139..7ec73ab 100644
--- a/include/erebos/storage.h
+++ b/include/erebos/storage.h
@@ -507,12 +507,16 @@ class WatchedHead : public Head<T>
friend class Head<T>;
WatchedHead(const Head<T> & h, int watcherId):
Head<T>(h), watcherId(watcherId) {}
+ int watcherId;
+
+public:
WatchedHead(WatchedHead<T> && h):
Head<T>(h), watcherId(h.watcherId)
{ h.watcherId = -1; }
- int watcherId;
-public:
+ WatchedHead<T> & operator=(WatchedHead<T> && h)
+ { watcherId = h.watcherId; h.watcherId = -1; return *this; }
+
WatchedHead<T> & operator=(const Head<T> & h) {
if (Head<T>::id() != h.id())
throw std::runtime_error("WatchedHead ID mismatch");