15#include <peak/dll_interface/peak_dll_interface_util.hpp>
39 ,
public std::enable_shared_from_this<ProducerLibrary>
61 static std::shared_ptr<ProducerLibrary>
Open(
const std::string& ctiPath);
74 std::string
Key()
const;
88 std::shared_ptr<SystemDescriptor>
System()
const;
91 friend ClassCreator<ProducerLibrary>;
95 void Initialize()
const override;
96 mutable std::shared_ptr<SystemDescriptor> m_system;
112 auto producerLibraryHandle = QueryNumericFromCInterfaceFunction<PEAK_PRODUCER_LIBRARY_HANDLE>(
115 ctiPath.c_str(), ctiPath.size() + 1, _producerLibraryHandle);
118 return std::make_shared<ClassCreator<ProducerLibrary>>(producerLibraryHandle);
122 : m_backendHandle(producerLibraryHandle)
124 , m_key(QueryStringFromCInterfaceFunction([&](char* key, size_t* keySize) {
141 InitializeIfNecessary();
146inline void ProducerLibrary::Initialize()
const
148 auto systemDescriptorHandle = QueryNumericFromCInterfaceFunction<PEAK_SYSTEM_DESCRIPTOR_HANDLE>(
153 m_system = std::make_shared<ClassCreator<SystemDescriptor>>(
154 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:129
std::string Key() const
Returns the unique key.
Definition peak_producer_library.hpp:134
ProducerLibrary & operator=(const ProducerLibrary &other)=delete
ProducerLibrary(ProducerLibrary &&other)=delete
static std::shared_ptr< ProducerLibrary > Open(const std::string &ctiPath)
Opens the given producer library (CTI).
Definition peak_producer_library.hpp:110
std::shared_ptr< SystemDescriptor > System() const
Returns the system descriptor.
Definition peak_producer_library.hpp:139
The "core" namespace contains the direct GenAPI and GenTL wrapper.
Definition peak_buffer.hpp:34
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition peak_dynamic_loader.h:35
struct PEAK_SYSTEM_DESCRIPTOR * PEAK_SYSTEM_DESCRIPTOR_HANDLE
Definition peak_backend.h:369
struct PEAK_PRODUCER_LIBRARY * PEAK_PRODUCER_LIBRARY_HANDLE
Definition peak_backend.h:365
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_C_ABI_PREFIX
Definition peak_dll_defines.h:16