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