IDS peak genericC++  v1.4.1
peak_module_descriptor.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 
13 
15 #include <peak/dll_interface/peak_dll_interface_util.hpp>
16 
17 #include <cstddef>
18 #include <string>
19 
20 
21 namespace peak
22 {
23 namespace core
24 {
25 
31 {
32 public:
33  ModuleDescriptor() = default;
34  virtual ~ModuleDescriptor() = default;
35  ModuleDescriptor(const ModuleDescriptor& other) = delete;
36  ModuleDescriptor& operator=(const ModuleDescriptor& other) = delete;
37  ModuleDescriptor(ModuleDescriptor&& other) = delete;
38  ModuleDescriptor& operator=(ModuleDescriptor&& other) = delete;
39 
49  std::string ID() const;
50 
51 protected:
53 };
54 
55 } /* namespace core */
56 } /* namespace peak */
57 
58 /* Implementation */
59 namespace peak
60 {
61 namespace core
62 {
63 
64 inline std::string ModuleDescriptor::ID() const
65 {
66  auto moduleDescriptorHandle = ModuleDescriptorHandle();
67 
68  return QueryStringFromCInterfaceFunction([&](char* id, size_t* idSize) {
69  return PEAK_C_ABI_PREFIX PEAK_ModuleDescriptor_GetID(moduleDescriptorHandle, id, idSize);
70  });
71 }
72 
73 } /* namespace core */
74 } /* namespace peak */
virtual ~ModuleDescriptor()=default
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition: peak_dynamic_loader.h:32
ModuleDescriptor & operator=(const ModuleDescriptor &other)=delete
struct PEAK_MODULE_DESCRIPTOR * PEAK_MODULE_DESCRIPTOR_HANDLE
Definition: peak_backend.h:397
The base class for all openable modules.
Definition: peak_module_descriptor.hpp:30
#define PEAK_C_ABI_PREFIX
Definition: peak_dll_defines.h:16
std::string ID() const
Returns the ID of the described module.
Definition: peak_module_descriptor.hpp:64
PEAK_C_API PEAK_ModuleDescriptor_GetID(PEAK_MODULE_DESCRIPTOR_HANDLE moduleDescriptorHandle, char *id, size_t *idSize)
Asks the given module descriptor for its ID.
virtual PEAK_MODULE_DESCRIPTOR_HANDLE ModuleDescriptorHandle() const =0