IDS peak genericC++ v1.17.0
Loading...
Searching...
No Matches
peak_library.hpp
Go to the documentation of this file.
1
6
7#pragma once
8
10
12
13
19namespace peak
20{
21
29class Library final
30{
31public:
54 static void Initialize();
55
77 static void Close();
78
80
91
92private:
93 Library() = delete;
94 ~Library() = delete;
95 Library(const Library& other) = delete;
96 Library& operator=(const Library& other) = delete;
97 Library(Library&& other) = delete;
98 Library& operator=(Library&& other) = delete;
99};
100
101} /* namespace peak */
102
104#include <peak/dll_interface/peak_dll_interface_util.hpp>
106
107
108/* Implementation */
109namespace peak
110{
112{
113 CallAndCheckCInterfaceFunction([] { return PEAK_C_ABI_PREFIX PEAK_Library_Initialize(); });
114
115 DeviceManager::LifetimeTracker<>::Create();
116}
117
118inline void Library::Close()
119{
120 DeviceManager::LifetimeTracker<>::Destroy();
121
122 CallAndCheckCInterfaceFunction([] { return PEAK_C_ABI_PREFIX PEAK_Library_Close(); });
123}
124
126{
127 uint32_t versionMajor = QueryNumericFromCInterfaceFunction<uint32_t>(
129 uint32_t versionMinor = QueryNumericFromCInterfaceFunction<uint32_t>(
131 uint32_t versionPatch = QueryNumericFromCInterfaceFunction<uint32_t>(
133
134 return { versionMajor, versionMinor, versionPatch };
135}
136} /* namespace peak */
static void Initialize()
Initializes the IDS peak genericAPI library.
Definition peak_library.hpp:111
static void Close()
Closes the IDS peak genericAPI library and cleans up any resources that are still in use.
Definition peak_library.hpp:118
static PEAK_COMMON_NO_DISCARD core::Version Version()
Returns the library version.
Definition peak_library.hpp:125
Implements versioning functionality.
Definition peak_version.hpp:33
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition peak_buffer.hpp:29
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_GetVersionPatch(uint32_t *libraryVersionPatch)
Asks for the patch component of the library version.
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.
#define PEAK_COMMON_NO_DISCARD
Definition peak_common_defines.h:89
#define PEAK_C_ABI_PREFIX
Definition peak_dll_defines.h:13