SubscriptionHandle.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
RobotAPI/libraries/armem/core/MemoryID.h
>
4
5
namespace
armarx::armem::client::util
6
{
7
8
class
MemoryListener;
9
10
class
SubscriptionHandle
11
{
12
friend
class
MemoryListener
;
13
14
public
:
15
SubscriptionHandle
();
16
SubscriptionHandle
(
SubscriptionHandle
&& other);
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
*/
24
SubscriptionHandle
&
operator=
(
SubscriptionHandle
other);
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
40
class
ScopedSubscriptionHandle
41
{
42
public
:
43
ScopedSubscriptionHandle
();
44
ScopedSubscriptionHandle
(
SubscriptionHandle
&& handle);
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
*/
52
ScopedSubscriptionHandle
&
operator=
(
SubscriptionHandle
handle);
53
54
~ScopedSubscriptionHandle
();
55
56
private
:
57
SubscriptionHandle
handle;
58
};
59
60
void
swap
(
SubscriptionHandle
& first,
SubscriptionHandle
& second);
61
62
}
// namespace armarx::armem::client::util
armarx::armem::client::util::SubscriptionHandle::operator=
SubscriptionHandle & operator=(SubscriptionHandle other)
Assignment operator.
Definition:
SubscriptionHandle.cpp:28
armarx::armem::client::util::ScopedSubscriptionHandle::ScopedSubscriptionHandle
ScopedSubscriptionHandle()
Definition:
SubscriptionHandle.cpp:40
MemoryID.h
armarx::armem::client::util::swap
void swap(SubscriptionHandle &first, SubscriptionHandle &second)
Definition:
SubscriptionHandle.cpp:66
armarx::armem::MemoryID
A memory ID.
Definition:
MemoryID.h:47
armarx::armem::client::util::SubscriptionHandle
Definition:
SubscriptionHandle.h:10
armarx::armem::client::util::ScopedSubscriptionHandle
Definition:
SubscriptionHandle.h:40
armarx::armem::client::util::ScopedSubscriptionHandle::operator=
ScopedSubscriptionHandle & operator=(SubscriptionHandle handle)
Assignment operator.
Definition:
SubscriptionHandle.cpp:50
armarx::armem::client::util::ScopedSubscriptionHandle::~ScopedSubscriptionHandle
~ScopedSubscriptionHandle()
Definition:
SubscriptionHandle.cpp:56
armarx::armem::client::util::SubscriptionHandle::swap
friend void swap(SubscriptionHandle &first, SubscriptionHandle &second)
armarx::armem::client::util::MemoryListener
Handles update signals from the memory system and distributes it to its subsribers.
Definition:
MemoryListener.h:25
armarx::armem::client::util::SubscriptionHandle::release
void release()
Definition:
SubscriptionHandle.cpp:35
armarx::armem::index::memoryID
const MemoryID memoryID
Definition:
memory_ids.cpp:29
armarx::armem::client::util
Definition:
MemoryListener.cpp:13
armarx::armem::client::util::SubscriptionHandle::SubscriptionHandle
SubscriptionHandle()
Definition:
SubscriptionHandle.cpp:14
RobotAPI
libraries
armem
client
util
SubscriptionHandle.h
Generated on Sat Oct 12 2024 09:14:08 for armarx_documentation by
1.8.17