IDS peak genericC++ v1.13.0
Loading...
Searching...
No Matches
peak_library.hpp
Go to the documentation of this file.
1
10
11#pragma once
12
13
15
21namespace peak
22{
23
31class Library final
32{
33public:
56 static void Initialize();
57
79 static void Close();
80
82
92 static core::Version Version();
93
94private:
95 Library() = delete;
96 ~Library() = delete;
97 Library(const Library& other) = delete;
98 Library& operator=(const Library& other) = delete;
99 Library(Library&& other) = delete;
100 Library& operator=(Library&& other) = delete;
101};
102
103} /* namespace peak */
104
106#include <peak/dll_interface/peak_dll_interface_util.hpp>
108
109
110/* Implementation */
111namespace peak
112{
114 {
115 CallAndCheckCInterfaceFunction([] { return PEAK_C_ABI_PREFIX PEAK_Library_Initialize(); });
116
117 DeviceManager::LifetimeTracker<>::Create();
118 }
119
120 inline void Library::Close()
121 {
122 DeviceManager::LifetimeTracker<>::Destroy();
123
124 CallAndCheckCInterfaceFunction([] { return PEAK_C_ABI_PREFIX PEAK_Library_Close(); });
125 }
126
128 {
129 uint32_t versionMajor = QueryNumericFromCInterfaceFunction<uint32_t>(
131 uint32_t versionMinor = QueryNumericFromCInterfaceFunction<uint32_t>(
133 uint32_t versionSubminor = QueryNumericFromCInterfaceFunction<uint32_t>(
135
136 return {versionMajor, versionMinor, versionSubminor};
137 }
138} /* namespace peak */
static void Initialize()
Initializes the IDS peak genericAPI library.
Definition peak_library.hpp:113
static void Close()
Closes the IDS peak genericAPI library and cleans up any resources that are still in use.
Definition peak_library.hpp:120
static core::Version Version()
Returns the library version.
Definition peak_library.hpp:127
Implements versioning functionality.
Definition peak_version.hpp:35
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition peak_dynamic_loader.h:33
PEAK_C_API PEAK_Library_Close()
Closes the IDS peak genericAPI library and cleans up any resources that are still in use.
PEAK_C_API PEAK_Library_GetVersionMinor(uint32_t *libraryVersionMinor)
Asks for the minor component of the library version.
PEAK_C_API PEAK_Library_Initialize()
Initializes the IDS peak genericAPI library.
PEAK_C_API PEAK_Library_GetVersionMajor(uint32_t *libraryVersionMajor)
Asks for the major component of the library version.
PEAK_C_API PEAK_Library_GetVersionSubminor(uint32_t *libraryVersionSubminor)
Asks for the subminor component of the library version.
#define PEAK_C_ABI_PREFIX
Definition peak_dll_defines.h:16