IDS peak genericC++  v1.6.2
peak_system.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 
13 
17 #include <peak/dll_interface/peak_dll_interface_util.hpp>
18 #include <peak/generic/peak_t_callback_manager.hpp>
21 
22 #include <unordered_map>
23 #include <cstddef>
24 #include <cstdint>
25 #include <functional>
26 #include <memory>
27 #include <mutex>
28 #include <string>
29 #include <vector>
30 
31 
32 namespace peak
33 {
34 namespace core
35 {
36 
37 class ProducerLibrary;
38 
39 struct InterfaceFoundCallbackContainer;
40 
48 class System
49  : public EventSupportingModule
50  , public std::enable_shared_from_this<System>
51 {
52 public:
54  using InterfaceFoundCallback = std::function<void(const std::shared_ptr<InterfaceDescriptor>& foundInterface)>;
58  using InterfaceLostCallback = std::function<void(const std::string& lostInterfaceId)>;
61 
62  System() = delete;
63  ~System() override;
64  System(const System& other) = delete;
65  System& operator=(const System& other) = delete;
66  System(System&& other) = delete;
67  System& operator=(System&& other) = delete;
68 
70  std::string Key() const;
71 
73  RawInformation Info(int32_t infoCommand) const;
83  std::string ID() const;
85  std::string DisplayName() const;
87  std::string VendorName() const;
89  std::string ModelName() const;
91  std::string Version() const;
93  std::string TLType() const;
95  std::string CTIFileName() const;
97  std::string CTIFullPath() const;
99  uint32_t GenTLVersionMajor() const;
101  uint32_t GenTLVersionMinor() const;
104 
119  void UpdateInterfaces(Timeout timeout_ms);
129  std::vector<std::shared_ptr<InterfaceDescriptor>> Interfaces() const;
131  std::shared_ptr<ProducerLibrary> ParentLibrary() const;
132 
187 
188 private:
189  struct InterfaceFoundCallbackContainer
190  {
191  std::weak_ptr<System> _System;
193  };
194  static void PEAK_CALL_CONV InterfaceFoundCallbackCWrapper(
195  PEAK_INTERFACE_DESCRIPTOR_HANDLE foundInterface, void* context);
196  static void PEAK_CALL_CONV InterfaceLostCallbackCWrapper(
197  const char* lostInterfaceId, size_t lostInterfaceIdSize, void* context);
198  std::shared_ptr<InterfaceDescriptor> GetOrAddFoundInterface(PEAK_INTERFACE_DESCRIPTOR_HANDLE foundInterface);
199 
200  PEAK_MODULE_HANDLE ModuleHandle() const override;
201  PEAK_EVENT_SUPPORTING_MODULE_HANDLE EventSupportingModuleHandle() const override;
202 
203  void InitializeUpdateMechanismIfNecessary();
204 
205  friend ClassCreator<System>;
206  System(PEAK_SYSTEM_HANDLE systemHandle, const std::weak_ptr<ProducerLibrary>& parentLibrary);
207  PEAK_SYSTEM_HANDLE m_backendHandle;
208 
209  std::weak_ptr<ProducerLibrary> m_parentLibrary;
210 
211  std::unique_ptr<TCallbackManager<PEAK_INTERFACE_FOUND_CALLBACK_HANDLE, InterfaceFoundCallbackContainer>>
212  m_interfaceFoundCallbackManager;
213  std::unique_ptr<TCallbackManager<PEAK_INTERFACE_LOST_CALLBACK_HANDLE, InterfaceLostCallback>>
214  m_interfaceLostCallbackManager;
215 
216  std::vector<std::shared_ptr<InterfaceDescriptor>> m_interfaces;
217  std::unordered_map<std::string, std::shared_ptr<InterfaceDescriptor>> m_interfacesByKey;
218  std::unordered_map<std::string, std::string> m_interfacesKeyById;
219  mutable std::mutex m_interfacesMutex;
220  std::once_flag m_updateMechanismInitializedFlag;
221 
222  std::string m_key;
223 };
224 
225 } /* namespace core */
226 } /* namespace peak */
227 
228 /* Implementation */
229 namespace peak
230 {
231 namespace core
232 {
233 
234 inline System::System(PEAK_SYSTEM_HANDLE systemHandle, const std::weak_ptr<ProducerLibrary>& parentLibrary)
235  : m_backendHandle(systemHandle)
236  , m_parentLibrary(parentLibrary)
237  , m_interfaceFoundCallbackManager()
238  , m_interfaceLostCallbackManager()
239  , m_key(QueryStringFromCInterfaceFunction([&](char* key, size_t* keySize) {
240  return PEAK_C_ABI_PREFIX PEAK_System_GetKey(systemHandle, key, keySize);
241  }))
242 {
243  m_interfaceFoundCallbackManager =
244  std::make_unique<TCallbackManager<PEAK_INTERFACE_FOUND_CALLBACK_HANDLE, InterfaceFoundCallbackContainer>>(
245  [&](void* callbackContext) {
246  return QueryNumericFromCInterfaceFunction<PEAK_INTERFACE_FOUND_CALLBACK_HANDLE>(
247  [&](PEAK_INTERFACE_FOUND_CALLBACK_HANDLE* interfaceFoundCallbackHandle) {
249  InterfaceFoundCallbackCWrapper, callbackContext, interfaceFoundCallbackHandle);
250  });
251  },
252  [&](PEAK_INTERFACE_FOUND_CALLBACK_HANDLE callbackHandle) {
253  CallAndCheckCInterfaceFunction([&] {
255  m_backendHandle, callbackHandle);
256  });
257  });
258 
259  m_interfaceLostCallbackManager =
260  std::make_unique<TCallbackManager<PEAK_INTERFACE_LOST_CALLBACK_HANDLE, InterfaceLostCallback>>(
261  [&](void* callbackContext) {
262  return QueryNumericFromCInterfaceFunction<PEAK_INTERFACE_LOST_CALLBACK_HANDLE>(
263  [&](PEAK_INTERFACE_LOST_CALLBACK_HANDLE* interfaceLostCallbackHandle) {
265  InterfaceLostCallbackCWrapper, callbackContext, interfaceLostCallbackHandle);
266  });
267  },
268  [&](PEAK_INTERFACE_LOST_CALLBACK_HANDLE callbackHandle) {
269  CallAndCheckCInterfaceFunction([&] {
271  m_backendHandle, callbackHandle);
272  });
273  });
274 }
275 
277 {
278  try
279  {
280  m_interfaceFoundCallbackManager->UnregisterAllCallbacks();
281  m_interfaceLostCallbackManager->UnregisterAllCallbacks();
282  }
283  catch (const Exception&)
284  {}
285 
286  (void)PEAK_C_ABI_PREFIX PEAK_System_Destruct(m_backendHandle);
287 }
288 
289 inline std::string System::Key() const
290 {
291  return m_key;
292 }
293 
294 inline RawInformation System::Info(int32_t infoCommand) const
295 {
296  return QueryRawInformationFromCInterfaceFunction([&](int32_t* dataType, uint8_t* buffer, size_t* bufferSize) {
297  return PEAK_C_ABI_PREFIX PEAK_System_GetInfo(m_backendHandle, infoCommand, dataType, buffer, bufferSize);
298  });
299 }
300 
301 inline std::string System::ID() const
302 {
303  return QueryStringFromCInterfaceFunction([&](char* id, size_t* idSize) {
304  return PEAK_C_ABI_PREFIX PEAK_System_GetID(m_backendHandle, id, idSize);
305  });
306 }
307 
308 inline std::string System::DisplayName() const
309 {
310  return QueryStringFromCInterfaceFunction([&](char* displayName, size_t* displayNameSize) {
311  return PEAK_C_ABI_PREFIX PEAK_System_GetDisplayName(m_backendHandle, displayName, displayNameSize);
312  });
313 }
314 
315 inline std::string System::VendorName() const
316 {
317  return QueryStringFromCInterfaceFunction([&](char* vendorName, size_t* vendorNameSize) {
318  return PEAK_C_ABI_PREFIX PEAK_System_GetVendorName(m_backendHandle, vendorName, vendorNameSize);
319  });
320 }
321 
322 inline std::string System::ModelName() const
323 {
324  return QueryStringFromCInterfaceFunction([&](char* modelName, size_t* modelNameSize) {
325  return PEAK_C_ABI_PREFIX PEAK_System_GetModelName(m_backendHandle, modelName, modelNameSize);
326  });
327 }
328 
329 inline std::string System::Version() const
330 {
331  return QueryStringFromCInterfaceFunction([&](char* version, size_t* versionSize) {
332  return PEAK_C_ABI_PREFIX PEAK_System_GetVersion(m_backendHandle, version, versionSize);
333  });
334 }
335 
336 inline std::string System::TLType() const
337 {
338  return QueryStringFromCInterfaceFunction([&](char* tlType, size_t* tlTypeSize) {
339  return PEAK_C_ABI_PREFIX PEAK_System_GetTLType(m_backendHandle, tlType, tlTypeSize);
340  });
341 }
342 
343 inline std::string System::CTIFileName() const
344 {
345  return QueryStringFromCInterfaceFunction([&](char* ctiFileName, size_t* ctiFileNameSize) {
346  return PEAK_C_ABI_PREFIX PEAK_System_GetCTIFileName(m_backendHandle, ctiFileName, ctiFileNameSize);
347  });
348 }
349 
350 inline std::string System::CTIFullPath() const
351 {
352  return QueryStringFromCInterfaceFunction([&](char* ctiFullPath, size_t* ctiFullPathSize) {
353  return PEAK_C_ABI_PREFIX PEAK_System_GetCTIFullPath(m_backendHandle, ctiFullPath, ctiFullPathSize);
354  });
355 }
356 
357 inline uint32_t System::GenTLVersionMajor() const
358 {
359  return QueryNumericFromCInterfaceFunction<uint32_t>([&](uint32_t* gentlVersionMajor) {
360  return PEAK_C_ABI_PREFIX PEAK_System_GetGenTLVersionMajor(m_backendHandle, gentlVersionMajor);
361  });
362 }
363 
364 inline uint32_t System::GenTLVersionMinor() const
365 {
366  return QueryNumericFromCInterfaceFunction<uint32_t>([&](uint32_t* gentlVersionMinor) {
367  return PEAK_C_ABI_PREFIX PEAK_System_GetGenTLVersionMinor(m_backendHandle, gentlVersionMinor);
368  });
369 }
370 
372 {
373  return static_cast<peak::core::CharacterEncoding>(
374  QueryNumericFromCInterfaceFunction<PEAK_CHARACTER_ENCODING>(
375  [&](PEAK_CHARACTER_ENCODING* characterEncoding) {
376  return PEAK_C_ABI_PREFIX PEAK_System_GetCharacterEncoding(m_backendHandle, characterEncoding);
377  }));
378 }
379 
380 inline void System::UpdateInterfaces(Timeout timeout_ms)
381 {
382  InitializeUpdateMechanismIfNecessary();
383 
384  CallAndCheckCInterfaceFunction(
385  [&] { return PEAK_C_ABI_PREFIX PEAK_System_UpdateInterfaces(m_backendHandle, timeout_ms); });
386 }
387 
388 inline std::vector<std::shared_ptr<InterfaceDescriptor>> System::Interfaces() const
389 {
390  std::lock_guard<std::mutex> lock(m_interfacesMutex);
391  return m_interfaces;
392 }
393 
394 inline std::shared_ptr<ProducerLibrary> System::ParentLibrary() const
395 {
396  return LockOrThrow(m_parentLibrary);
397 }
398 
400  const System::InterfaceFoundCallback& callback)
401 {
402  return reinterpret_cast<InterfaceFoundCallbackHandle>(
403  m_interfaceFoundCallbackManager->RegisterCallback(InterfaceFoundCallbackContainer{ shared_from_this(),
404  [callback](const std::shared_ptr<InterfaceDescriptor>& foundInterface) { callback(foundInterface); } }));
405 }
406 
408 {
409  m_interfaceFoundCallbackManager->UnregisterCallback(
410  reinterpret_cast<PEAK_INTERFACE_FOUND_CALLBACK_HANDLE>(callbackHandle));
411 }
412 
414  const System::InterfaceLostCallback& callback)
415 {
416  return reinterpret_cast<InterfaceLostCallbackHandle>(m_interfaceLostCallbackManager->RegisterCallback(callback));
417 }
418 
420 {
421  m_interfaceLostCallbackManager->UnregisterCallback(
422  reinterpret_cast<PEAK_INTERFACE_LOST_CALLBACK_HANDLE>(callbackHandle));
423 }
424 
425 inline void PEAK_CALL_CONV System::InterfaceFoundCallbackCWrapper(
426  PEAK_INTERFACE_DESCRIPTOR_HANDLE foundInterface, void* context)
427 {
428  auto callbackContainer = static_cast<InterfaceFoundCallbackContainer*>(context);
429 
430  auto interfaceDescriptor = callbackContainer->_System.lock()->GetOrAddFoundInterface(foundInterface);
431 
432  callbackContainer->Callback(interfaceDescriptor);
433 }
434 
435 inline void PEAK_CALL_CONV System::InterfaceLostCallbackCWrapper(
436  const char* lostInterfaceId, size_t lostInterfaceIdSize, void* context)
437 {
438  auto callback = static_cast<System::InterfaceLostCallback*>(context);
439 
440  callback->operator()(std::string(lostInterfaceId, lostInterfaceIdSize - 1));
441 }
442 
443 inline std::shared_ptr<InterfaceDescriptor> System::GetOrAddFoundInterface(
444  PEAK_INTERFACE_DESCRIPTOR_HANDLE foundInterface)
445 {
446  std::lock_guard<std::mutex> lock(m_interfacesMutex);
447 
448  const auto interfaceKey = QueryStringFromCInterfaceFunction([&](char* key, size_t* keySize) {
449  return PEAK_C_ABI_PREFIX PEAK_InterfaceDescriptor_GetKey(foundInterface, key, keySize);
450  });
451  auto keyInterfacePairIterator = m_interfacesByKey.find(interfaceKey);
452  if (keyInterfacePairIterator == m_interfacesByKey.end())
453  {
454  auto interfaceDescriptor = std::static_pointer_cast<InterfaceDescriptor>(
455  std::make_shared<ClassCreator<InterfaceDescriptor>>(
456  foundInterface, std::weak_ptr<System>{ shared_from_this() }));
457  m_interfaces.emplace_back(interfaceDescriptor);
458  m_interfacesByKey.emplace(interfaceKey, interfaceDescriptor);
459  m_interfacesKeyById.emplace(interfaceDescriptor->ID(), interfaceKey);
460 
461  return interfaceDescriptor;
462  }
463 
464  return keyInterfacePairIterator->second;
465 }
466 
467 inline PEAK_MODULE_HANDLE System::ModuleHandle() const
468 {
469  auto moduleHandle = QueryNumericFromCInterfaceFunction<PEAK_MODULE_HANDLE>(
470  [&](PEAK_MODULE_HANDLE* _moduleHandle) {
471  return PEAK_C_ABI_PREFIX PEAK_System_ToModule(m_backendHandle, _moduleHandle);
472  });
473 
474  return moduleHandle;
475 }
476 
477 inline PEAK_EVENT_SUPPORTING_MODULE_HANDLE System::EventSupportingModuleHandle() const
478 {
479  auto eventSupportingModuleHandle = QueryNumericFromCInterfaceFunction<PEAK_EVENT_SUPPORTING_MODULE_HANDLE>(
480  [&](PEAK_EVENT_SUPPORTING_MODULE_HANDLE* _eventSupportingModuleHandle) {
482  m_backendHandle, _eventSupportingModuleHandle);
483  });
484 
485  return eventSupportingModuleHandle;
486 }
487 
488 inline void System::InitializeUpdateMechanismIfNecessary()
489 {
490  std::call_once(m_updateMechanismInitializedFlag, [&] {
491  (void)RegisterInterfaceFoundCallback([](const std::shared_ptr<InterfaceDescriptor>&) {
492  // Registering an empty callback is enough since InterfaceFoundCallbackCWrapper() handles everything else.
493  });
494  (void)RegisterInterfaceLostCallback([&](const std::string& lostInterfaceId) {
495  std::lock_guard<std::mutex> lock(m_interfacesMutex);
496  const auto lostInterfaceKey = m_interfacesKeyById.at(lostInterfaceId);
497  m_interfaces.erase(std::remove_if(std::begin(m_interfaces), std::end(m_interfaces),
498  [lostInterfaceKey](const std::shared_ptr<InterfaceDescriptor>& interface_) {
499  return interface_->Key() == lostInterfaceKey;
500  }),
501  std::end(m_interfaces));
502  m_interfacesByKey.erase(lostInterfaceKey);
503  m_interfacesKeyById.erase(lostInterfaceId);
504  });
505  });
506 }
507 
508 } /* namespace core */
509 } /* namespace peak */
Encapsulates the GenTL functions associated with a GenTL Interface module&#39;s ID.
Definition: peak_interface_descriptor.hpp:39
PEAK_C_API PEAK_System_GetCTIFullPath(PEAK_SYSTEM_HANDLE systemHandle, char *ctiFullPath, size_t *ctiFullPathSize)
Asks the given system for its parent CTI&#39;s full path.
PEAK_C_API PEAK_System_GetCharacterEncoding(PEAK_SYSTEM_HANDLE systemHandle, PEAK_CHARACTER_ENCODING *characterEncoding)
Asks the given system for its character encoding.
PEAK_C_API PEAK_System_GetCTIFileName(PEAK_SYSTEM_HANDLE systemHandle, char *ctiFileName, size_t *ctiFileNameSize)
Asks the given system for its parent CTI&#39;s file name.
void UnregisterInterfaceFoundCallback(InterfaceFoundCallbackHandle callbackHandle)
Unregisters a interface found callback.
Definition: peak_system.hpp:407
PEAK_C_API PEAK_System_UnregisterInterfaceLostCallback(PEAK_SYSTEM_HANDLE systemHandle, PEAK_INTERFACE_LOST_CALLBACK_HANDLE callbackHandle)
Unregisters the interface-lost callback with the given handle from the given system.
PEAK_C_API PEAK_System_RegisterInterfaceLostCallback(PEAK_SYSTEM_HANDLE systemHandle, PEAK_INTERFACE_LOST_CALLBACK callback, void *callbackContext, PEAK_INTERFACE_LOST_CALLBACK_HANDLE *callbackHandle)
Registers a callback signaling a lost interface at the given system.
struct PEAK_INTERFACE_DESCRIPTOR * PEAK_INTERFACE_DESCRIPTOR_HANDLE
Definition: peak_backend.h:357
std::shared_ptr< ProducerLibrary > ParentLibrary() const
Returns the parent library.
Definition: peak_system.hpp:394
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition: peak_dynamic_loader.h:32
PEAK_C_API PEAK_System_GetVendorName(PEAK_SYSTEM_HANDLE systemHandle, char *vendorName, size_t *vendorNameSize)
Asks the given system for its vendor name.
struct PEAK_EVENT_SUPPORTING_MODULE * PEAK_EVENT_SUPPORTING_MODULE_HANDLE
Definition: peak_backend.h:457
InterfaceFoundCallbackHandle RegisterInterfaceFoundCallback(const InterfaceFoundCallback &callback)
Registers a callback for signaling a found interface.
Definition: peak_system.hpp:399
InterfaceFoundCallback * InterfaceFoundCallbackHandle
Definition: peak_system.hpp:56
PEAK_C_API PEAK_System_GetTLType(PEAK_SYSTEM_HANDLE systemHandle, char *tlType, size_t *tlTypeSize)
Asks the given system for its TL type.
std::vector< std::shared_ptr< InterfaceDescriptor > > Interfaces() const
Returns the interface list.
Definition: peak_system.hpp:388
PEAK_C_API PEAK_System_RegisterInterfaceFoundCallback(PEAK_SYSTEM_HANDLE systemHandle, PEAK_INTERFACE_FOUND_CALLBACK callback, void *callbackContext, PEAK_INTERFACE_FOUND_CALLBACK_HANDLE *callbackHandle)
Registers a callback signaling a found interface at the given system.
int32_t PEAK_CHARACTER_ENCODING
Definition: peak_backend.h:90
std::string ID() const
Returns the ID.
Definition: peak_system.hpp:301
std::function< void(const std::shared_ptr< InterfaceDescriptor > &foundInterface)> InterfaceFoundCallback
Definition: peak_system.hpp:54
PEAK_C_API PEAK_System_UnregisterInterfaceFoundCallback(PEAK_SYSTEM_HANDLE systemHandle, PEAK_INTERFACE_FOUND_CALLBACK_HANDLE callbackHandle)
Unregisters the interface-found callback with the given handle from the given system.
PEAK_C_API PEAK_System_GetKey(PEAK_SYSTEM_HANDLE systemHandle, char *key, size_t *keySize)
Asks the given system for its key.
PEAK_C_API PEAK_System_ToModule(PEAK_SYSTEM_HANDLE systemHandle, PEAK_MODULE_HANDLE *moduleHandle)
Casts the given system to a module.
Represents a GenTL System module.
Definition: peak_system.hpp:48
std::string ModelName() const
Returns the model name.
Definition: peak_system.hpp:322
PEAK_C_API PEAK_System_GetGenTLVersionMinor(PEAK_SYSTEM_HANDLE systemHandle, uint32_t *gentlVersionMinor)
Asks the given system for the minor component of its GenTL version.
PEAK_C_API PEAK_System_GetDisplayName(PEAK_SYSTEM_HANDLE systemHandle, char *displayName, size_t *displayNameSize)
Asks the given system for its display name.
std::string Key() const
Returns the unique key.
Definition: peak_system.hpp:289
PEAK_C_API PEAK_System_GetInfo(PEAK_SYSTEM_HANDLE systemHandle, int32_t infoCommand, int32_t *infoDataType, uint8_t *info, size_t *infoSize)
Asks the given system for an information based on a specific command.
uint32_t GenTLVersionMajor() const
Returns the GenTL major version of the GenTL producer library this system belongs to...
Definition: peak_system.hpp:357
std::string DisplayName() const
Returns the display name.
Definition: peak_system.hpp:308
RawInformation Info(int32_t infoCommand) const
Delivers information based on the given GenTL info command.
Definition: peak_system.hpp:294
PEAK_C_API PEAK_System_GetGenTLVersionMajor(PEAK_SYSTEM_HANDLE systemHandle, uint32_t *gentlVersionMajor)
Asks the given system for the major component of its GenTL version.
InterfaceLostCallbackHandle RegisterInterfaceLostCallback(const InterfaceLostCallback &callback)
Registers a callback for signaling a lost interface.
Definition: peak_system.hpp:413
uint32_t GenTLVersionMinor() const
Returns the GenTL minor version of the GenTL producer library this system belongs to...
Definition: peak_system.hpp:364
Represents a timeout value in milliseconds.
Definition: peak_timeout.hpp:30
std::string CTIFileName() const
Returns the file name of the GenTL producer library this system belongs to.
Definition: peak_system.hpp:343
PEAK_C_API PEAK_System_ToEventSupportingModule(PEAK_SYSTEM_HANDLE systemHandle, PEAK_EVENT_SUPPORTING_MODULE_HANDLE *eventSupportingModuleHandle)
Casts the given system to an event-supporting module.
std::string TLType() const
Returns the TL (transport layer) type.
Definition: peak_system.hpp:336
struct PEAK_SYSTEM * PEAK_SYSTEM_HANDLE
Definition: peak_backend.h:353
void UpdateInterfaces(Timeout timeout_ms)
Searches for interfaces.
Definition: peak_system.hpp:380
The base class for all exceptions thrown by the library.
Definition: peak_exception.hpp:25
std::string VendorName() const
Returns the vendor name.
Definition: peak_system.hpp:315
~System() override
Definition: peak_system.hpp:276
CharacterEncoding
Possible character encodings.
Definition: peak_common_system_enums.hpp:24
#define PEAK_CALL_CONV
Definition: peak_dynamic_loader.h:29
#define PEAK_C_ABI_PREFIX
Definition: peak_dll_defines.h:16
System & operator=(const System &other)=delete
PEAK_C_API PEAK_System_GetVersion(PEAK_SYSTEM_HANDLE systemHandle, char *version, size_t *versionSize)
Asks the given system for its version.
PEAK_C_API PEAK_InterfaceDescriptor_GetKey(PEAK_INTERFACE_DESCRIPTOR_HANDLE interfaceDescriptorHandle, char *key, size_t *keySize)
Asks the given interface descriptor for its key.
PEAK_C_API PEAK_System_GetID(PEAK_SYSTEM_HANDLE systemHandle, char *id, size_t *idSize)
Asks the given system for its ID.
The struct returned by all raw information functions.
Definition: peak_common_structs.hpp:24
struct PEAK_MODULE * PEAK_MODULE_HANDLE
Definition: peak_backend.h:401
PEAK_C_API PEAK_System_Destruct(PEAK_SYSTEM_HANDLE systemHandle)
Destroys the given system.
std::function< void(const std::string &lostInterfaceId)> InterfaceLostCallback
Definition: peak_system.hpp:58
peak::core::CharacterEncoding CharacterEncoding() const
Returns the character encoding of the GenTL producer library this system belongs to.
Definition: peak_system.hpp:371
std::string CTIFullPath() const
Returns the full path of the GenTL producer library this system belongs to.
Definition: peak_system.hpp:350
The base class for all modules being able to raise events.
Definition: peak_event_supporting_module.hpp:33
void UnregisterInterfaceLostCallback(InterfaceLostCallbackHandle callbackHandle)
Unregisters a interface lost callback.
Definition: peak_system.hpp:419
PEAK_INTERFACE_LOST_CALLBACK * PEAK_INTERFACE_LOST_CALLBACK_HANDLE
Definition: peak_backend.h:489
PEAK_INTERFACE_FOUND_CALLBACK * PEAK_INTERFACE_FOUND_CALLBACK_HANDLE
Definition: peak_backend.h:487
std::string Version() const
Returns the version.
Definition: peak_system.hpp:329
PEAK_C_API PEAK_System_UpdateInterfaces(PEAK_SYSTEM_HANDLE systemHandle, uint64_t timeout_ms)
Tells the given system to update its interfaces with the given timeout.
InterfaceLostCallback * InterfaceLostCallbackHandle
Definition: peak_system.hpp:60
PEAK_C_API PEAK_System_GetModelName(PEAK_SYSTEM_HANDLE systemHandle, char *modelName, size_t *modelNameSize)
Asks the given system for its model name.