IDS peak genericC++  v1.7.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;
84 
86  std::string DisplayName() const;
87 
89  std::string VendorName() const;
90 
92  std::string ModelName() const;
93 
95  std::string Version() const;
96 
98  std::string TLType() const;
99 
101  std::string CTIFileName() const;
102 
104  std::string CTIFullPath() const;
105 
107  uint32_t GenTLVersionMajor() const;
108 
110  uint32_t GenTLVersionMinor() const;
111 
114 
129  void UpdateInterfaces(Timeout timeout_ms);
130 
140  std::vector<std::shared_ptr<InterfaceDescriptor>> Interfaces() const;
141 
143  std::shared_ptr<ProducerLibrary> ParentLibrary() const;
144 
160 
173 
189 
202 
203 private:
204  struct InterfaceFoundCallbackContainer
205  {
206  std::weak_ptr<System> System_;
208  };
209  static void PEAK_CALL_CONV InterfaceFoundCallbackCWrapper(
210  PEAK_INTERFACE_DESCRIPTOR_HANDLE foundInterface, void* context);
211  static void PEAK_CALL_CONV InterfaceLostCallbackCWrapper(
212  const char* lostInterfaceId, size_t lostInterfaceIdSize, void* context);
213  std::shared_ptr<InterfaceDescriptor> GetOrAddFoundInterface(PEAK_INTERFACE_DESCRIPTOR_HANDLE foundInterface);
214 
215  PEAK_MODULE_HANDLE ModuleHandle() const override;
216  PEAK_EVENT_SUPPORTING_MODULE_HANDLE EventSupportingModuleHandle() const override;
217 
218  void InitializeUpdateMechanismIfNecessary();
219 
220  friend ClassCreator<System>;
221  System(PEAK_SYSTEM_HANDLE systemHandle, const std::weak_ptr<ProducerLibrary>& parentLibrary);
222  PEAK_SYSTEM_HANDLE m_backendHandle;
223 
224  std::weak_ptr<ProducerLibrary> m_parentLibrary;
225 
226  std::unique_ptr<TCallbackManager<PEAK_INTERFACE_FOUND_CALLBACK_HANDLE, InterfaceFoundCallbackContainer>>
227  m_interfaceFoundCallbackManager;
228  std::unique_ptr<TCallbackManager<PEAK_INTERFACE_LOST_CALLBACK_HANDLE, InterfaceLostCallback>>
229  m_interfaceLostCallbackManager;
230 
231  std::vector<std::shared_ptr<InterfaceDescriptor>> m_interfaces;
232  std::unordered_map<std::string, std::shared_ptr<InterfaceDescriptor>> m_interfacesByKey;
233  std::unordered_map<std::string, std::string> m_interfacesKeyById;
234  mutable std::mutex m_interfacesMutex;
235  std::once_flag m_updateMechanismInitializedFlag;
236 
237  std::string m_key;
238 };
239 
240 } /* namespace core */
241 } /* namespace peak */
242 
243 /* Implementation */
244 namespace peak
245 {
246 namespace core
247 {
248 
249 inline System::System(PEAK_SYSTEM_HANDLE systemHandle, const std::weak_ptr<ProducerLibrary>& parentLibrary)
250  : m_backendHandle(systemHandle)
251  , m_parentLibrary(parentLibrary)
252  , m_interfaceFoundCallbackManager()
253  , m_interfaceLostCallbackManager()
254  , m_key(QueryStringFromCInterfaceFunction([&](char* key, size_t* keySize) {
255  return PEAK_C_ABI_PREFIX PEAK_System_GetKey(systemHandle, key, keySize);
256  }))
257 {
258  m_interfaceFoundCallbackManager =
259  std::make_unique<TCallbackManager<PEAK_INTERFACE_FOUND_CALLBACK_HANDLE, InterfaceFoundCallbackContainer>>(
260  [&](void* callbackContext) {
261  return QueryNumericFromCInterfaceFunction<PEAK_INTERFACE_FOUND_CALLBACK_HANDLE>(
262  [&](PEAK_INTERFACE_FOUND_CALLBACK_HANDLE* interfaceFoundCallbackHandle) {
264  InterfaceFoundCallbackCWrapper, callbackContext, interfaceFoundCallbackHandle);
265  });
266  },
267  [&](PEAK_INTERFACE_FOUND_CALLBACK_HANDLE callbackHandle) {
268  CallAndCheckCInterfaceFunction([&] {
270  m_backendHandle, callbackHandle);
271  });
272  });
273 
274  m_interfaceLostCallbackManager =
275  std::make_unique<TCallbackManager<PEAK_INTERFACE_LOST_CALLBACK_HANDLE, InterfaceLostCallback>>(
276  [&](void* callbackContext) {
277  return QueryNumericFromCInterfaceFunction<PEAK_INTERFACE_LOST_CALLBACK_HANDLE>(
278  [&](PEAK_INTERFACE_LOST_CALLBACK_HANDLE* interfaceLostCallbackHandle) {
280  InterfaceLostCallbackCWrapper, callbackContext, interfaceLostCallbackHandle);
281  });
282  },
283  [&](PEAK_INTERFACE_LOST_CALLBACK_HANDLE callbackHandle) {
284  CallAndCheckCInterfaceFunction([&] {
286  m_backendHandle, callbackHandle);
287  });
288  });
289 }
290 
292 {
293  try
294  {
295  m_interfaceFoundCallbackManager->UnregisterAllCallbacks();
296  m_interfaceLostCallbackManager->UnregisterAllCallbacks();
297  }
298  catch (const Exception&)
299  {}
300 
301  (void)PEAK_C_ABI_PREFIX PEAK_System_Destruct(m_backendHandle);
302 }
303 
304 inline std::string System::Key() const
305 {
306  return m_key;
307 }
308 
309 inline RawInformation System::Info(int32_t infoCommand) const
310 {
311  return QueryRawInformationFromCInterfaceFunction([&](int32_t* dataType, uint8_t* buffer, size_t* bufferSize) {
312  return PEAK_C_ABI_PREFIX PEAK_System_GetInfo(m_backendHandle, infoCommand, dataType, buffer, bufferSize);
313  });
314 }
315 
316 inline std::string System::ID() const
317 {
318  return QueryStringFromCInterfaceFunction([&](char* id, size_t* idSize) {
319  return PEAK_C_ABI_PREFIX PEAK_System_GetID(m_backendHandle, id, idSize);
320  });
321 }
322 
323 inline std::string System::DisplayName() const
324 {
325  return QueryStringFromCInterfaceFunction([&](char* displayName, size_t* displayNameSize) {
326  return PEAK_C_ABI_PREFIX PEAK_System_GetDisplayName(m_backendHandle, displayName, displayNameSize);
327  });
328 }
329 
330 inline std::string System::VendorName() const
331 {
332  return QueryStringFromCInterfaceFunction([&](char* vendorName, size_t* vendorNameSize) {
333  return PEAK_C_ABI_PREFIX PEAK_System_GetVendorName(m_backendHandle, vendorName, vendorNameSize);
334  });
335 }
336 
337 inline std::string System::ModelName() const
338 {
339  return QueryStringFromCInterfaceFunction([&](char* modelName, size_t* modelNameSize) {
340  return PEAK_C_ABI_PREFIX PEAK_System_GetModelName(m_backendHandle, modelName, modelNameSize);
341  });
342 }
343 
344 inline std::string System::Version() const
345 {
346  return QueryStringFromCInterfaceFunction([&](char* version, size_t* versionSize) {
347  return PEAK_C_ABI_PREFIX PEAK_System_GetVersion(m_backendHandle, version, versionSize);
348  });
349 }
350 
351 inline std::string System::TLType() const
352 {
353  return QueryStringFromCInterfaceFunction([&](char* tlType, size_t* tlTypeSize) {
354  return PEAK_C_ABI_PREFIX PEAK_System_GetTLType(m_backendHandle, tlType, tlTypeSize);
355  });
356 }
357 
358 inline std::string System::CTIFileName() const
359 {
360  return QueryStringFromCInterfaceFunction([&](char* ctiFileName, size_t* ctiFileNameSize) {
361  return PEAK_C_ABI_PREFIX PEAK_System_GetCTIFileName(m_backendHandle, ctiFileName, ctiFileNameSize);
362  });
363 }
364 
365 inline std::string System::CTIFullPath() const
366 {
367  return QueryStringFromCInterfaceFunction([&](char* ctiFullPath, size_t* ctiFullPathSize) {
368  return PEAK_C_ABI_PREFIX PEAK_System_GetCTIFullPath(m_backendHandle, ctiFullPath, ctiFullPathSize);
369  });
370 }
371 
372 inline uint32_t System::GenTLVersionMajor() const
373 {
374  return QueryNumericFromCInterfaceFunction<uint32_t>([&](uint32_t* gentlVersionMajor) {
375  return PEAK_C_ABI_PREFIX PEAK_System_GetGenTLVersionMajor(m_backendHandle, gentlVersionMajor);
376  });
377 }
378 
379 inline uint32_t System::GenTLVersionMinor() const
380 {
381  return QueryNumericFromCInterfaceFunction<uint32_t>([&](uint32_t* gentlVersionMinor) {
382  return PEAK_C_ABI_PREFIX PEAK_System_GetGenTLVersionMinor(m_backendHandle, gentlVersionMinor);
383  });
384 }
385 
387 {
388  return static_cast<peak::core::CharacterEncoding>(
389  QueryNumericFromCInterfaceFunction<PEAK_CHARACTER_ENCODING>(
390  [&](PEAK_CHARACTER_ENCODING* characterEncoding) {
391  return PEAK_C_ABI_PREFIX PEAK_System_GetCharacterEncoding(m_backendHandle, characterEncoding);
392  }));
393 }
394 
395 inline void System::UpdateInterfaces(Timeout timeout_ms)
396 {
397  InitializeUpdateMechanismIfNecessary();
398 
399  CallAndCheckCInterfaceFunction(
400  [&] { return PEAK_C_ABI_PREFIX PEAK_System_UpdateInterfaces(m_backendHandle, timeout_ms); });
401 }
402 
403 inline std::vector<std::shared_ptr<InterfaceDescriptor>> System::Interfaces() const
404 {
405  std::lock_guard<std::mutex> lock(m_interfacesMutex);
406  return m_interfaces;
407 }
408 
409 inline std::shared_ptr<ProducerLibrary> System::ParentLibrary() const
410 {
411  return LockOrThrow(m_parentLibrary);
412 }
413 
415  const System::InterfaceFoundCallback& callback)
416 {
417  return reinterpret_cast<InterfaceFoundCallbackHandle>(
418  m_interfaceFoundCallbackManager->RegisterCallback(InterfaceFoundCallbackContainer{ shared_from_this(),
419  [callback](const std::shared_ptr<InterfaceDescriptor>& foundInterface) { callback(foundInterface); } }));
420 }
421 
423 {
424  m_interfaceFoundCallbackManager->UnregisterCallback(
425  reinterpret_cast<PEAK_INTERFACE_FOUND_CALLBACK_HANDLE>(callbackHandle));
426 }
427 
429  const System::InterfaceLostCallback& callback)
430 {
431  return reinterpret_cast<InterfaceLostCallbackHandle>(m_interfaceLostCallbackManager->RegisterCallback(callback));
432 }
433 
435 {
436  m_interfaceLostCallbackManager->UnregisterCallback(
437  reinterpret_cast<PEAK_INTERFACE_LOST_CALLBACK_HANDLE>(callbackHandle));
438 }
439 
440 inline void PEAK_CALL_CONV System::InterfaceFoundCallbackCWrapper(
441  PEAK_INTERFACE_DESCRIPTOR_HANDLE foundInterface, void* context)
442 {
443  auto callbackContainer = static_cast<InterfaceFoundCallbackContainer*>(context);
444 
445  auto interfaceDescriptor = callbackContainer->System_.lock()->GetOrAddFoundInterface(foundInterface);
446 
447  callbackContainer->Callback(interfaceDescriptor);
448 }
449 
450 inline void PEAK_CALL_CONV System::InterfaceLostCallbackCWrapper(
451  const char* lostInterfaceId, size_t lostInterfaceIdSize, void* context)
452 {
453  auto callback = static_cast<System::InterfaceLostCallback*>(context);
454 
455  callback->operator()(std::string(lostInterfaceId, lostInterfaceIdSize - 1));
456 }
457 
458 inline std::shared_ptr<InterfaceDescriptor> System::GetOrAddFoundInterface(
459  PEAK_INTERFACE_DESCRIPTOR_HANDLE foundInterface)
460 {
461  std::lock_guard<std::mutex> lock(m_interfacesMutex);
462 
463  const auto interfaceKey = QueryStringFromCInterfaceFunction([&](char* key, size_t* keySize) {
464  return PEAK_C_ABI_PREFIX PEAK_InterfaceDescriptor_GetKey(foundInterface, key, keySize);
465  });
466  auto keyInterfacePairIterator = m_interfacesByKey.find(interfaceKey);
467  if (keyInterfacePairIterator == m_interfacesByKey.end())
468  {
469  auto interfaceDescriptor = std::static_pointer_cast<InterfaceDescriptor>(
470  std::make_shared<ClassCreator<InterfaceDescriptor>>(
471  foundInterface, std::weak_ptr<System>{ shared_from_this() }));
472  m_interfaces.emplace_back(interfaceDescriptor);
473  m_interfacesByKey.emplace(interfaceKey, interfaceDescriptor);
474  m_interfacesKeyById.emplace(interfaceDescriptor->ID(), interfaceKey);
475 
476  return interfaceDescriptor;
477  }
478 
479  return keyInterfacePairIterator->second;
480 }
481 
482 inline PEAK_MODULE_HANDLE System::ModuleHandle() const
483 {
484  auto moduleHandle = QueryNumericFromCInterfaceFunction<PEAK_MODULE_HANDLE>(
485  [&](PEAK_MODULE_HANDLE* _moduleHandle) {
486  return PEAK_C_ABI_PREFIX PEAK_System_ToModule(m_backendHandle, _moduleHandle);
487  });
488 
489  return moduleHandle;
490 }
491 
492 inline PEAK_EVENT_SUPPORTING_MODULE_HANDLE System::EventSupportingModuleHandle() const
493 {
494  auto eventSupportingModuleHandle = QueryNumericFromCInterfaceFunction<PEAK_EVENT_SUPPORTING_MODULE_HANDLE>(
495  [&](PEAK_EVENT_SUPPORTING_MODULE_HANDLE* _eventSupportingModuleHandle) {
497  m_backendHandle, _eventSupportingModuleHandle);
498  });
499 
500  return eventSupportingModuleHandle;
501 }
502 
503 inline void System::InitializeUpdateMechanismIfNecessary()
504 {
505  std::call_once(m_updateMechanismInitializedFlag, [&] {
506  (void)RegisterInterfaceFoundCallback([](const std::shared_ptr<InterfaceDescriptor>&) {
507  // Registering an empty callback is enough since InterfaceFoundCallbackCWrapper() handles everything else.
508  });
509  (void)RegisterInterfaceLostCallback([&](const std::string& lostInterfaceId) {
510  std::lock_guard<std::mutex> lock(m_interfacesMutex);
511  const auto lostInterfaceKey = m_interfacesKeyById.at(lostInterfaceId);
512  m_interfaces.erase(std::remove_if(std::begin(m_interfaces), std::end(m_interfaces),
513  [lostInterfaceKey](const std::shared_ptr<InterfaceDescriptor>& interface_) {
514  return interface_->Key() == lostInterfaceKey;
515  }),
516  std::end(m_interfaces));
517  m_interfacesByKey.erase(lostInterfaceKey);
518  m_interfacesKeyById.erase(lostInterfaceId);
519  });
520  });
521 }
522 
523 } /* namespace core */
524 } /* 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:422
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:359
std::shared_ptr< ProducerLibrary > ParentLibrary() const
Returns the parent library.
Definition: peak_system.hpp:409
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:459
InterfaceFoundCallbackHandle RegisterInterfaceFoundCallback(const InterfaceFoundCallback &callback)
Registers a callback for signaling a found interface.
Definition: peak_system.hpp:414
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:403
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:316
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:337
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:304
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:372
std::string DisplayName() const
Returns the display name.
Definition: peak_system.hpp:323
RawInformation Info(int32_t infoCommand) const
Delivers information based on the given GenTL info command.
Definition: peak_system.hpp:309
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:428
uint32_t GenTLVersionMinor() const
Returns the GenTL minor version of the GenTL producer library this system belongs to...
Definition: peak_system.hpp:379
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:358
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:351
struct PEAK_SYSTEM * PEAK_SYSTEM_HANDLE
Definition: peak_backend.h:355
void UpdateInterfaces(Timeout timeout_ms)
Searches for interfaces.
Definition: peak_system.hpp:395
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:330
~System() override
Definition: peak_system.hpp:291
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:403
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:386
std::string CTIFullPath() const
Returns the full path of the GenTL producer library this system belongs to.
Definition: peak_system.hpp:365
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:434
PEAK_INTERFACE_LOST_CALLBACK * PEAK_INTERFACE_LOST_CALLBACK_HANDLE
Definition: peak_backend.h:493
PEAK_INTERFACE_FOUND_CALLBACK * PEAK_INTERFACE_FOUND_CALLBACK_HANDLE
Definition: peak_backend.h:491
std::string Version() const
Returns the version.
Definition: peak_system.hpp:344
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.