15 #include <peak/dll_interface/peak_dll_interface_util.hpp> 38 ,
public std::enable_shared_from_this<ProducerLibrary>
60 static std::shared_ptr<ProducerLibrary>
Open(
const std::string& ctiPath);
73 std::string
Key()
const;
87 std::shared_ptr<SystemDescriptor>
System()
const;
90 friend ClassCreator<ProducerLibrary>;
94 void Initialize()
const override;
95 mutable std::shared_ptr<SystemDescriptor> m_system;
111 auto producerLibraryHandle = QueryNumericFromCInterfaceFunction<PEAK_PRODUCER_LIBRARY_HANDLE>(
114 ctiPath.c_str(), ctiPath.size() + 1, _producerLibraryHandle);
117 return std::make_shared<ClassCreator<ProducerLibrary>>(producerLibraryHandle);
121 : m_backendHandle(producerLibraryHandle)
123 , m_key(QueryStringFromCInterfaceFunction([&](
char* key,
size_t* keySize) {
140 InitializeIfNecessary();
145 inline void ProducerLibrary::Initialize()
const 147 auto systemDescriptorHandle = QueryNumericFromCInterfaceFunction<PEAK_SYSTEM_DESCRIPTOR_HANDLE>(
152 m_system = std::make_shared<ClassCreator<SystemDescriptor>>(
153 systemDescriptorHandle, std::const_pointer_cast<
ProducerLibrary>(shared_from_this()));
~ProducerLibrary() override
Definition: peak_producer_library.hpp:128
struct PEAK_PRODUCER_LIBRARY * PEAK_PRODUCER_LIBRARY_HANDLE
Definition: peak_backend.h:347
static std::shared_ptr< ProducerLibrary > Open(const std::string &ctiPath)
Opens the given producer library (CTI).
Definition: peak_producer_library.hpp:109
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition: peak_dynamic_loader.h:32
std::string Key() const
Returns the unique key.
Definition: peak_producer_library.hpp:133
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.
ProducerLibrary & operator=(const ProducerLibrary &other)=delete
std::shared_ptr< SystemDescriptor > System() const
Returns the system descriptor.
Definition: peak_producer_library.hpp:138
struct PEAK_SYSTEM_DESCRIPTOR * PEAK_SYSTEM_DESCRIPTOR_HANDLE
Definition: peak_backend.h:351
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
Represents a GenTL producer library (CTI).
Definition: peak_producer_library.hpp:36