17#include <peak/dll_interface/peak_dll_interface_util.hpp>
139 friend ClassCreator<EventController>;
154 : m_backendHandle(eventControllerHandle)
164 return QueryRawInformationFromCInterfaceFunction([&](int32_t* dataType, uint8_t* buffer,
size_t* bufferSize) {
166 m_backendHandle, infoCommand, dataType, buffer, bufferSize);
172 return QueryNumericFromCInterfaceFunction<size_t>([&](
size_t* numEventsInQueue) {
179 return QueryNumericFromCInterfaceFunction<uint64_t>([&](uint64_t* numEventsFired) {
186 return QueryNumericFromCInterfaceFunction<size_t>([&](
size_t* eventMaxSize) {
193 return QueryNumericFromCInterfaceFunction<size_t>([&](
size_t* eventDataMaxSize) {
200 auto eventHandle = QueryNumericFromCInterfaceFunction<PEAK_EVENT_HANDLE>(
205 return std::make_unique<ClassCreator<Event>>(eventHandle);
210 CallAndCheckCInterfaceFunction(
216 CallAndCheckCInterfaceFunction(
223 QueryNumericFromCInterfaceFunction<PEAK_EVENT_TYPE>([&](
PEAK_EVENT_TYPE* controlledEventType) {
225 m_backendHandle, controlledEventType);
Encapsulates the GenTL event functionality associated with one GenTL Event handle.
Definition peak_event_controller.hpp:38
void FlushEvents()
Discards all events in queue.
Definition peak_event_controller.hpp:214
EventType ControlledEventType() const
Returns the controlled event type.
Definition peak_event_controller.hpp:220
std::unique_ptr< Event > WaitForEvent(Timeout timeout_ms)
Blocking wait for an event.
Definition peak_event_controller.hpp:198
RawInformation Info(int32_t infoCommand) const
Delivers information based on the given GenTL info command.
Definition peak_event_controller.hpp:162
EventController & operator=(const EventController &other)=delete
size_t EventDataMaxSize() const
Returns the maximum size of the data of an event in bytes.
Definition peak_event_controller.hpp:191
~EventController()
Definition peak_event_controller.hpp:157
void KillWait()
Terminates a wait for an event.
Definition peak_event_controller.hpp:208
size_t NumEventsInQueue() const
Returns the number of events in queue.
Definition peak_event_controller.hpp:170
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:184
uint64_t NumEventsFired() const
Returns the number of fired events.
Definition peak_event_controller.hpp:177
EventController(EventController &&other)=delete
Represents a timeout value in milliseconds.
Definition peak_timeout.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:32
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:467
int32_t PEAK_EVENT_TYPE
Definition peak_backend.h:168
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:463
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_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)
Tells the given event controller to kill a wait for an event.
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