12#include <peak/dll_interface/peak_dll_interface_util.hpp>
36 ,
public std::enable_shared_from_this<ProducerLibrary>
88 friend ClassCreator<ProducerLibrary>;
92 void Initialize()
const override;
93 mutable std::shared_ptr<SystemDescriptor> m_system;
109 auto producerLibraryHandle = QueryNumericFromCInterfaceFunction<PEAK_PRODUCER_LIBRARY_HANDLE>(
112 ctiPath.c_str(), ctiPath.size() + 1, _producerLibraryHandle);
115 return std::make_shared<ClassCreator<ProducerLibrary>>(producerLibraryHandle);
119 : m_backendHandle(producerLibraryHandle)
121 , m_key(QueryStringFromCInterfaceFunction([&](char* key, size_t* keySize) {
138 InitializeIfNecessary();
143inline void ProducerLibrary::Initialize()
const
145 auto systemDescriptorHandle = QueryNumericFromCInterfaceFunction<PEAK_SYSTEM_DESCRIPTOR_HANDLE>(
150 m_system = std::make_shared<ClassCreator<SystemDescriptor>>(
151 systemDescriptorHandle, std::const_pointer_cast<ProducerLibrary>(shared_from_this()));
ProducerLibrary(const ProducerLibrary &other)=delete
ProducerLibrary & operator=(ProducerLibrary &&other)=delete
~ProducerLibrary() override
Definition peak_producer_library.hpp:126
PEAK_COMMON_NO_DISCARD std::string Key() const
Returns the unique key.
Definition peak_producer_library.hpp:131
ProducerLibrary & operator=(const ProducerLibrary &other)=delete
ProducerLibrary(ProducerLibrary &&other)=delete
static PEAK_COMMON_NO_DISCARD std::shared_ptr< ProducerLibrary > Open(const std::string &ctiPath)
Opens the given producer library (CTI).
Definition peak_producer_library.hpp:107
PEAK_COMMON_NO_DISCARD std::shared_ptr< SystemDescriptor > System() const
Returns the system descriptor.
Definition peak_producer_library.hpp:136
The "core" namespace contains the direct GenAPI and GenTL wrapper.
Definition peak_buffer.hpp:32
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition peak_buffer.hpp:29
struct PEAK_SYSTEM_DESCRIPTOR * PEAK_SYSTEM_DESCRIPTOR_HANDLE
Definition peak_backend.h:367
struct PEAK_PRODUCER_LIBRARY * PEAK_PRODUCER_LIBRARY_HANDLE
Definition peak_backend.h:363
PEAK_C_API PEAK_ProducerLibrary_GetSystem(PEAK_PRODUCER_LIBRARY_HANDLE producerLibraryHandle, PEAK_SYSTEM_DESCRIPTOR_HANDLE *systemDescriptorHandle)
Asks the given producer library for its system descriptor.
PEAK_C_API PEAK_ProducerLibrary_GetKey(PEAK_PRODUCER_LIBRARY_HANDLE producerLibraryHandle, char *key, size_t *keySize)
Asks the given producer library for its key.
PEAK_C_API PEAK_ProducerLibrary_Construct(const char *ctiPath, size_t ctiPathSize, PEAK_PRODUCER_LIBRARY_HANDLE *producerLibraryHandle)
Creates a producer library.
PEAK_C_API PEAK_ProducerLibrary_Destruct(PEAK_PRODUCER_LIBRARY_HANDLE producerLibraryHandle)
Destroys the given producer library.
#define PEAK_COMMON_NO_DISCARD
Definition peak_common_defines.h:89
#define PEAK_C_ABI_PREFIX
Definition peak_dll_defines.h:13