SubscriptionHandle.h
Go to the documentation of this file.
1#pragma once
2
4
6{
7
8 class MemoryListener;
9
11 {
12 friend class MemoryListener;
13
14 public:
17
18 /**
19 * @brief Assignment operator.
20 *
21 * @note Intentional call by value, since this leverages the move constructor. See
22 * https://stackoverflow.com/a/11540204 (section "Move assignment operators").
23 */
25
26 friend void swap(SubscriptionHandle& first, SubscriptionHandle& second);
27
28 void release();
29
30 private:
31 SubscriptionHandle(MemoryListener* memoryListener, const MemoryID& memoryID, long id);
32
33 private:
34 bool valid = false;
35 MemoryListener* memoryListener = nullptr;
36 MemoryID memoryID;
37 long id = 0;
38 };
39
41 {
42 public:
45
46 /**
47 * @brief Assignment operator.
48 *
49 * @note Intentional call by value, since this leverages the move constructor. See
50 * https://stackoverflow.com/a/11540204 (section "Move assignment operators").
51 */
53
55
56 private:
57 SubscriptionHandle handle;
58 };
59
60 void swap(SubscriptionHandle& first, SubscriptionHandle& second);
61
62} // namespace armarx::armem::client::util
Handles update signals from the memory system and distributes it to its subsribers.
ScopedSubscriptionHandle & operator=(SubscriptionHandle handle)
Assignment operator.
friend void swap(SubscriptionHandle &first, SubscriptionHandle &second)
SubscriptionHandle & operator=(SubscriptionHandle other)
Assignment operator.
void swap(SubscriptionHandle &first, SubscriptionHandle &second)