17#include <peak/dll_interface/peak_dll_interface_util.hpp>
191 friend ClassCreator<EventController>;
206 : m_backendHandle(eventControllerHandle)
216 return QueryRawInformationFromCInterfaceFunction([&](int32_t* dataType, uint8_t* buffer,
size_t* bufferSize) {
218 m_backendHandle, infoCommand, dataType, buffer, bufferSize);
224 return QueryNumericFromCInterfaceFunction<size_t>([&](
size_t* numEventsInQueue) {
231 return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* numEventsFired) {
238 return QueryNumericFromCInterfaceFunction<size_t>([&](
size_t* eventMaxSize) {
245 return QueryNumericFromCInterfaceFunction<size_t>([&](
size_t* eventDataMaxSize) {
252 auto eventHandle = QueryNumericFromCInterfaceFunction<PEAK_EVENT_HANDLE>(
257 return std::make_unique<ClassCreator<Event>>(eventHandle);
262 CallAndCheckCInterfaceFunction(
268 CallAndCheckCInterfaceFunction(
274 CallAndCheckCInterfaceFunction(
281 QueryNumericFromCInterfaceFunction<PEAK_EVENT_TYPE>([&](
PEAK_EVENT_TYPE* controlledEventType) {
283 m_backendHandle, controlledEventType);
void FlushEvents()
Discards all events in queue.
Definition peak_event_controller.hpp:272
EventType ControlledEventType() const
Returns the controlled event type.
Definition peak_event_controller.hpp:278
std::unique_ptr< Event > WaitForEvent(Timeout timeout_ms)
Blocking wait for an event.
Definition peak_event_controller.hpp:250
RawInformation Info(int32_t infoCommand) const
Delivers information based on the given GenTL info command.
Definition peak_event_controller.hpp:214
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:266
size_t EventDataMaxSize() const
Returns the maximum size of the data of an event in bytes.
Definition peak_event_controller.hpp:243
~EventController()
Destroys the EventController and unregisters the event.
Definition peak_event_controller.hpp:209
void KillWait()
Cancels a pending WaitForEvent call.
Definition peak_event_controller.hpp:260
size_t NumEventsInQueue() const
Returns the number of events in queue.
Definition peak_event_controller.hpp:222
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:236
uint64_t NumEventsFired() const
Returns the number of fired events.
Definition peak_event_controller.hpp:229
EventController(EventController &&other)=delete
Represents a timeout value in milliseconds.
Definition peak_timeout.hpp:32
EventType
Different types of events.
Definition peak_event.hpp:36
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: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