IDS peak genericC++  v1.4.1
peak::core::EventController Class Reference

Encapsulates the GenTL event functionality associated with one GenTL Event handle. More...

#include <peak/event/peak_event_controller.hpp>

Public Member Functions

 EventController ()=delete
 
 ~EventController ()
 
 EventController (const EventController &other)=delete
 
EventController & operator= (const EventController &other)=delete
 
 EventController (EventController &&other)=delete
 
EventController & operator= (EventController &&other)=delete
 
RawInformation Info (int32_t infoCommand) const
 Delivers information based on the given GenTL info command. More...
 
size_t NumEventsInQueue () const
 Returns the number of events in queue. More...
 
uint64_t NumEventsFired () const
 Returns the number of fired events. More...
 
size_t EventMaxSize () const
 Returns the maximum size of an event in bytes. More...
 
size_t EventDataMaxSize () const
 Returns the maximum size of the data of an event in bytes. More...
 
std::unique_ptr< Event > WaitForEvent (Timeout timeout_ms)
 Blocking wait for an event. More...
 
void KillWait ()
 Terminates a wait for an event. More...
 
void FlushEvents ()
 Discards all events in queue. More...
 
EventType ControlledEventType () const
 Returns the controlled event type. More...
 

Detailed Description

Encapsulates the GenTL event functionality associated with one GenTL Event handle.

This class is returned by EventSupportingModule::EnableEvents() and acts as a controller for events of the type given to EventSupportingModule::EnableEvents().

Constructor & Destructor Documentation

◆ EventController() [1/3]

peak::core::EventController::EventController ( )
delete

◆ ~EventController()

peak::core::EventController::~EventController ( )
inline

◆ EventController() [2/3]

peak::core::EventController::EventController ( const EventController &  other)
delete

◆ EventController() [3/3]

peak::core::EventController::EventController ( EventController &&  other)
delete

Member Function Documentation

◆ ControlledEventType()

EventType peak::core::EventController::ControlledEventType ( ) const
inline

Returns the controlled event type.

Returns
Controlled event type
Since
1.0

◆ EventDataMaxSize()

size_t peak::core::EventController::EventDataMaxSize ( ) const
inline

Returns the maximum size of the data of an event in bytes.

Returns
Maximum size of the data of an event in bytes.
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ EventMaxSize()

size_t peak::core::EventController::EventMaxSize ( ) const
inline

Returns the maximum size of an event in bytes.

Returns
Maximum size of an event in bytes.
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ FlushEvents()

void peak::core::EventController::FlushEvents ( )
inline

Discards all events in queue.

Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ Info()

RawInformation peak::core::EventController::Info ( int32_t  infoCommand) const
inline

Delivers information based on the given GenTL info command.

Parameters
[in]infoCommandThe GenTL info command.

This function can be used to query information going beyond the predefined info functions, based on the GenTL info commands of the corresponding module.

Example (error handling is omitted):

auto info = object->Info(GenTL::XX_INFO_XX);
// Cast depending on the delivered data type
if (info.dataType == GenTL::INFO_DATATYPE_UINT64)
{
uint64_t uint64Var = *reinterpret_cast<const uint64_t*>(info.data.data());
// Do something with the information
}
else if (infoDataTypeVar == GenTL::INFO_DATATYPE_INT64)
{
...
}
...
Returns
Raw information according to the passed info command
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ KillWait()

void peak::core::EventController::KillWait ( )
inline

Terminates a wait for an event.

Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ NumEventsFired()

uint64_t peak::core::EventController::NumEventsFired ( ) const
inline

Returns the number of fired events.

Returns
Number of fired events
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ NumEventsInQueue()

size_t peak::core::EventController::NumEventsInQueue ( ) const
inline

Returns the number of events in queue.

Returns
Number of events in queue
Since
1.0
Exceptions
InternalErrorExceptionAn internal error has occurred.

◆ operator=() [1/2]

EventController& peak::core::EventController::operator= ( const EventController &  other)
delete

◆ operator=() [2/2]

EventController& peak::core::EventController::operator= ( EventController &&  other)
delete

◆ WaitForEvent()

std::unique_ptr< Event > peak::core::EventController::WaitForEvent ( Timeout  timeout_ms)
inline

Blocking wait for an event.

Parameters
[in]timeout_msThe maximum waiting time in milliseconds. When called with Timeout::INFINITE_TIMEOUT, the function will only return if the event is triggered or KillWait() is called.
Returns
Event
Since
1.0
Exceptions
AbortedExceptionThe wait was aborted
TimeoutExceptionThe function call timed out
InternalErrorExceptionAn internal error has occurred.

The documentation for this class was generated from the following file: