17#include <peak/dll_interface/peak_dll_interface_util.hpp>
190 friend ClassCreator<EventController>;
205 : m_backendHandle(eventControllerHandle)
215 return QueryRawInformationFromCInterfaceFunction([&](int32_t* dataType, uint8_t* buffer,
size_t* bufferSize) {
217 m_backendHandle, infoCommand, dataType, buffer, bufferSize);
223 return QueryNumericFromCInterfaceFunction<size_t>([&](
size_t* numEventsInQueue) {
230 return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* numEventsFired) {
237 return QueryNumericFromCInterfaceFunction<size_t>([&](
size_t* eventMaxSize) {
244 return QueryNumericFromCInterfaceFunction<size_t>([&](
size_t* eventDataMaxSize) {
251 auto eventHandle = QueryNumericFromCInterfaceFunction<PEAK_EVENT_HANDLE>(
256 return std::make_unique<ClassCreator<Event>>(eventHandle);
261 CallAndCheckCInterfaceFunction(
267 CallAndCheckCInterfaceFunction(
273 CallAndCheckCInterfaceFunction(
280 QueryNumericFromCInterfaceFunction<PEAK_EVENT_TYPE>([&](
PEAK_EVENT_TYPE* controlledEventType) {
282 m_backendHandle, controlledEventType);
void FlushEvents()
Discards all events in queue.
Definition peak_event_controller.hpp:271
EventType ControlledEventType() const
Returns the controlled event type.
Definition peak_event_controller.hpp:277
std::unique_ptr< Event > WaitForEvent(Timeout timeout_ms)
Blocking wait for an event.
Definition peak_event_controller.hpp:249
RawInformation Info(int32_t infoCommand) const
Delivers information based on the given GenTL info command.
Definition peak_event_controller.hpp:213
EventController()=delete
Can not be created on its own, instead use EnableEvents.
EventController & operator=(const EventController &other)=delete
void FlushPendingKillWaits()
Flushes the KillWait queue.
Definition peak_event_controller.hpp:265
size_t EventDataMaxSize() const
Returns the maximum size of the data of an event in bytes.
Definition peak_event_controller.hpp:242
~EventController()
Destroys the EventController and unregisters the event.
Definition peak_event_controller.hpp:208
void KillWait()
Cancels a pending WaitForEvent call.
Definition peak_event_controller.hpp:259
size_t NumEventsInQueue() const
Returns the number of events in queue.
Definition peak_event_controller.hpp:221
EventController(const EventController &other)=delete
EventController & operator=(EventController &&other)=delete
size_t EventMaxSize() const
Returns the maximum size of an event in bytes.
Definition peak_event_controller.hpp:235
uint64_t NumEventsFired() const
Returns the number of fired events.
Definition peak_event_controller.hpp:228
EventController(EventController &&other)=delete
Represents a timeout value in milliseconds.
Definition peak_timeout.hpp:31
The "core" namespace contains the direct GenAPI and GenTL wrapper.
Definition peak_buffer.hpp:31
EventType
Different types of events.
Definition peak_event.hpp:35
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition peak_dynamic_loader.h:33
PEAK_C_API PEAK_EventController_FlushEvents(PEAK_EVENT_CONTROLLER_HANDLE eventControllerHandle)
Tells the given event controller to flush all events in queue.
struct PEAK_EVENT * PEAK_EVENT_HANDLE
Definition peak_backend.h:485
int32_t PEAK_EVENT_TYPE
Definition peak_backend.h:185
PEAK_C_API PEAK_EventController_GetEventMaxSize(PEAK_EVENT_CONTROLLER_HANDLE eventControllerHandle, size_t *eventMaxSize)
Asks the event controller for the maximum size of an event.
struct PEAK_EVENT_CONTROLLER * PEAK_EVENT_CONTROLLER_HANDLE
Definition peak_backend.h:481
PEAK_C_API PEAK_EventController_GetEventDataMaxSize(PEAK_EVENT_CONTROLLER_HANDLE eventControllerHandle, size_t *eventDataMaxSize)
Asks the event controller for the maximum size of an event's data.
PEAK_C_API PEAK_EventController_GetInfo(PEAK_EVENT_CONTROLLER_HANDLE eventControllerHandle, int32_t infoCommand, int32_t *infoDataType, uint8_t *info, size_t *infoSize)
Asks the given event controller for an information based on a specific command.
PEAK_C_API PEAK_EventController_FlushPendingKillWaits(PEAK_EVENT_CONTROLLER_HANDLE eventControllerHandle)
Flushes the KillWait queue.
PEAK_C_API PEAK_EventController_WaitForEvent(PEAK_EVENT_CONTROLLER_HANDLE eventControllerHandle, uint64_t timeout_ms, PEAK_EVENT_HANDLE *eventHandle)
Tells the given event controller to wait for an event with the given timeout.
PEAK_C_API PEAK_EventController_GetNumEventsInQueue(PEAK_EVENT_CONTROLLER_HANDLE eventControllerHandle, size_t *numEventsInQueue)
Asks the event controller for its number of events in queue.
PEAK_C_API PEAK_EventController_GetNumEventsFired(PEAK_EVENT_CONTROLLER_HANDLE eventControllerHandle, uint64_t *numEventsFired)
Asks the event controller for its number of fired events.
PEAK_C_API PEAK_EventController_GetControlledEventType(PEAK_EVENT_CONTROLLER_HANDLE eventControllerHandle, PEAK_EVENT_TYPE *controlledEventType)
Asks the event controller for its controlled event type.
PEAK_C_API PEAK_EventController_KillWait(PEAK_EVENT_CONTROLLER_HANDLE eventControllerHandle)
Cancels a pending PEAK_EventController_WaitForEvent call.
PEAK_C_API PEAK_EventController_Destruct(PEAK_EVENT_CONTROLLER_HANDLE eventControllerHandle)
Destroys the given event controller.
#define PEAK_C_ABI_PREFIX
Definition peak_dll_defines.h:16