forked from mavlink/MAVSDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
device_plugin_container.h.in
76 lines (60 loc) · 1.97 KB
/
device_plugin_container.h.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#pragma once
#include <vector>
${INCLUDES_STRING}
namespace dronecore {
class DeviceImpl;
class PluginImplBase;
${FORWARD_DECLARATION_STRING}
/**
* @brief The DevicePluginContainer contains all plugins for a device.
*
* The content of the DevicePluginContainer is auto-generated at compile time.
* Plugins such as Action or Telemetry are included so that they can be accessed
* using `DroneCore::device().action()...`
*/
class DevicePluginContainer
{
public:
/**
* @private Constructor of DevicePluginContainer called internally.
*
* A device inheriting from DevicePluginContainer is created internally and can be accessed
* using `DroneCore::device()`.
*
* @param impl device implementation internal
*/
explicit DevicePluginContainer(DeviceImpl *impl);
/**
* @private Destructor of DevicePluginContainer called internally.
*
* The destructor of a DevicePluginContainer does not need to be called by any consumer of the
* API. Instead the device will be cleaned up when DroneCore is destroyed.
*/
virtual ~DevicePluginContainer();
${PLUGIN_GET_STRING}
/**
* @brief Copy constructor (object is not copyable).
*/
DevicePluginContainer(const DevicePluginContainer &) = delete;
/**
* @brief Equality operator (object is not copyable).
*/
const DevicePluginContainer &operator=(const DevicePluginContainer &) = delete;
protected:
/** @private internal use only. */
void construct_plugins(DeviceImpl *impl);
/** @private internal use only. */
void destruct_plugins();
/** @private internal use only. */
void init_plugins();
/** @private internal use only. */
void deinit_plugins();
/** @private internal use only. */
void enable_plugins();
/** @private internal use only. */
void disable_plugins();
${PLUGIN_MEMBER_STRING}
/** @private internal use only. */
std::vector<PluginImplBase *> _plugin_impl_list {};
};
} // namespace dronecore