17 #include <peak/dll_interface/peak_dll_interface_util.hpp> 33 class ProducerLibrary;
53 std::string
Key()
const;
138 std::string
TLType()
const;
224 friend ClassCreator<SystemDescriptor>;
229 std::weak_ptr<ProducerLibrary> m_parentLibrary;
230 std::weak_ptr<System> m_openedSystem;
246 : m_backendHandle(systemDescriptorHandle)
247 , m_parentLibrary(parentLibrary)
248 , m_key(QueryStringFromCInterfaceFunction([&](
char* key,
size_t* keySize) {
260 return QueryRawInformationFromCInterfaceFunction([&](int32_t* dataType, uint8_t* buffer,
size_t* bufferSize) {
262 m_backendHandle, infoCommand, dataType, buffer, bufferSize);
268 return QueryStringFromCInterfaceFunction([&](
char* displayName,
size_t* displayNameSize) {
270 m_backendHandle, displayName, displayNameSize);
276 return QueryStringFromCInterfaceFunction([&](
char* vendorName,
size_t* vendorNameSize) {
283 return QueryStringFromCInterfaceFunction([&](
char* modelName,
size_t* modelNameSize) {
290 return QueryStringFromCInterfaceFunction([&](
char* version,
size_t* versionSize) {
297 return QueryStringFromCInterfaceFunction([&](
char* tlType,
size_t* tlTypeSize) {
304 return QueryStringFromCInterfaceFunction([&](
char* ctiFileName,
size_t* ctiFileNameSize) {
306 m_backendHandle, ctiFileName, ctiFileNameSize);
312 return QueryStringFromCInterfaceFunction([&](
char* ctiFullPath,
size_t* ctiFullPathSize) {
314 m_backendHandle, ctiFullPath, ctiFullPathSize);
320 return QueryNumericFromCInterfaceFunction<uint32_t>([&](uint32_t* gentlVersionMajor) {
327 return QueryNumericFromCInterfaceFunction<uint32_t>([&](uint32_t* gentlVersionMinor) {
335 QueryNumericFromCInterfaceFunction<PEAK_CHARACTER_ENCODING>(
338 m_backendHandle, characterEncoding);
344 return LockOrThrow(m_parentLibrary);
349 auto systemHandle = QueryNumericFromCInterfaceFunction<PEAK_SYSTEM_HANDLE>(
354 auto system = std::make_shared<ClassCreator<System>>(systemHandle, m_parentLibrary);
355 m_openedSystem = system;
361 return LockOrThrowOpenedModule(m_openedSystem);
366 auto moduleDescriptorHandle = QueryNumericFromCInterfaceFunction<PEAK_MODULE_DESCRIPTOR_HANDLE>(
369 m_backendHandle, _moduleDescriptorHandle);
372 return moduleDescriptorHandle;
std::shared_ptr< System > OpenedSystem() const
Returns the System that was opened with this SystemDescriptor.
Definition: peak_system_descriptor.hpp:359
std::string Key() const
Returns the unique key.
Definition: peak_system_descriptor.hpp:253
PEAK_C_API PEAK_SystemDescriptor_GetCTIFullPath(PEAK_SYSTEM_DESCRIPTOR_HANDLE systemDescriptorHandle, char *ctiFullPath, size_t *ctiFullPathSize)
Asks the given system descriptor for its parent CTI's full path.
PEAK_C_API PEAK_SystemDescriptor_GetGenTLVersionMinor(PEAK_SYSTEM_DESCRIPTOR_HANDLE systemDescriptorHandle, uint32_t *gentlVersionMinor)
Asks the given system descriptor for the minor component of its GenTL version.
PEAK_C_API PEAK_SystemDescriptor_GetTLType(PEAK_SYSTEM_DESCRIPTOR_HANDLE systemDescriptorHandle, char *tlType, size_t *tlTypeSize)
Asks the given system descriptor for its TL type.
PEAK_C_API PEAK_SystemDescriptor_GetCharacterEncoding(PEAK_SYSTEM_DESCRIPTOR_HANDLE systemDescriptorHandle, PEAK_CHARACTER_ENCODING *characterEncoding)
Asks the given system descriptor for its character encoding.
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition: peak_dynamic_loader.h:32
PEAK_C_API PEAK_SystemDescriptor_GetCTIFileName(PEAK_SYSTEM_DESCRIPTOR_HANDLE systemDescriptorHandle, char *ctiFileName, size_t *ctiFileNameSize)
Asks the given system descriptor for its parent CTI's file name.
~SystemDescriptor() override=default
PEAK_C_API PEAK_SystemDescriptor_GetInfo(PEAK_SYSTEM_DESCRIPTOR_HANDLE systemDescriptorHandle, int32_t infoCommand, int32_t *infoDataType, uint8_t *info, size_t *infoSize)
Asks the given system descriptor for an information based on a specific command.
PEAK_C_API PEAK_SystemDescriptor_GetVersion(PEAK_SYSTEM_DESCRIPTOR_HANDLE systemDescriptorHandle, char *version, size_t *versionSize)
Asks the given system descriptor for its version.
Encapsulates the GenTL functions associated with the GenTL System module's ID.
Definition: peak_system_descriptor.hpp:42
PEAK_C_API PEAK_SystemDescriptor_ToModuleDescriptor(PEAK_SYSTEM_DESCRIPTOR_HANDLE systemDescriptorHandle, PEAK_MODULE_DESCRIPTOR_HANDLE *moduleDescriptorHandle)
Casts the given system descriptor to a module descriptor.
std::shared_ptr< ProducerLibrary > ParentLibrary() const
Returns the parent library.
Definition: peak_system_descriptor.hpp:342
int32_t PEAK_CHARACTER_ENCODING
Definition: peak_backend.h:90
uint32_t GenTLVersionMajor() const
Returns the GenTL major version of the GenTL producer library this system belongs to...
Definition: peak_system_descriptor.hpp:318
std::shared_ptr< System > OpenSystem()
Opens the system.
Definition: peak_system_descriptor.hpp:347
PEAK_C_API PEAK_SystemDescriptor_OpenSystem(PEAK_SYSTEM_DESCRIPTOR_HANDLE systemDescriptorHandle, PEAK_SYSTEM_HANDLE *systemHandle)
Opens the system being associated with the given system descriptor.
struct PEAK_MODULE_DESCRIPTOR * PEAK_MODULE_DESCRIPTOR_HANDLE
Definition: peak_backend.h:397
std::string CTIFileName() const
Returns the file name of the GenTL producer library this system belongs to.
Definition: peak_system_descriptor.hpp:302
SystemDescriptor()=delete
PEAK_C_API PEAK_SystemDescriptor_GetVendorName(PEAK_SYSTEM_DESCRIPTOR_HANDLE systemDescriptorHandle, char *vendorName, size_t *vendorNameSize)
Asks the given system descriptor for its vendor name.
PEAK_C_API PEAK_SystemDescriptor_GetKey(PEAK_SYSTEM_DESCRIPTOR_HANDLE systemDescriptorHandle, char *key, size_t *keySize)
Asks the given system descriptor for its key.
std::string VendorName() const
Returns the vendor name.
Definition: peak_system_descriptor.hpp:274
SystemDescriptor & operator=(const SystemDescriptor &other)=delete
PEAK_C_API PEAK_SystemDescriptor_GetGenTLVersionMajor(PEAK_SYSTEM_DESCRIPTOR_HANDLE systemDescriptorHandle, uint32_t *gentlVersionMajor)
Asks the given system descriptor for the major component of its GenTL version.
std::string TLType() const
Returns the TL (transport layer) type.
Definition: peak_system_descriptor.hpp:295
The base class for all openable modules.
Definition: peak_module_descriptor.hpp:30
struct PEAK_SYSTEM * PEAK_SYSTEM_HANDLE
Definition: peak_backend.h:353
struct PEAK_SYSTEM_DESCRIPTOR * PEAK_SYSTEM_DESCRIPTOR_HANDLE
Definition: peak_backend.h:349
RawInformation Info(int32_t infoCommand) const
Delivers information based on the given GenTL info command.
Definition: peak_system_descriptor.hpp:258
PEAK_C_API PEAK_SystemDescriptor_GetDisplayName(PEAK_SYSTEM_DESCRIPTOR_HANDLE systemDescriptorHandle, char *displayName, size_t *displayNameSize)
Asks the given system descriptor for its display name.
std::string CTIFullPath() const
Returns the full path of the GenTL producer library this system belongs to.
Definition: peak_system_descriptor.hpp:310
CharacterEncoding
Possible character encodings.
Definition: peak_common_system_enums.hpp:24
#define PEAK_C_ABI_PREFIX
Definition: peak_dll_defines.h:16
uint32_t GenTLVersionMinor() const
Returns the GenTL minor version of the GenTL producer library this system belongs to...
Definition: peak_system_descriptor.hpp:325
peak::core::CharacterEncoding CharacterEncoding() const
Returns the character encoding of the GenTL producer library this system belongs to.
Definition: peak_system_descriptor.hpp:332
PEAK_C_API PEAK_SystemDescriptor_GetModelName(PEAK_SYSTEM_DESCRIPTOR_HANDLE systemDescriptorHandle, char *modelName, size_t *modelNameSize)
Asks the given system descriptor for its model name.
std::string Version() const
Returns the version.
Definition: peak_system_descriptor.hpp:288
std::string DisplayName() const
Returns the display name.
Definition: peak_system_descriptor.hpp:266
std::string ModelName() const
Returns the model name.
Definition: peak_system_descriptor.hpp:281