FrontPanel API 5.3.6
Loading...
Searching...
No Matches
OpalKelly::FrontPanelManager::CallbackInfo Struct Reference

Helper used for device monitoring by FrontPanelManager. More...

Public Member Functions

bool IsUsed () const
 Returns true if callback is used (only ever the case under Linux).
 

Public Attributes

int fd
 File descriptor to monitor, valid if StartMonitoring() succeeded.
 
void(* callback )(void *)
 The function to call when this descriptor becomes readable.
 
void * param
 The parameter to pass to the callback above.
 

Detailed Description

This is currently only used under Linux but defined everywhere to minimize the number of preprocessor checks. An object of this type must be passed to StartMonitoring() and if, after its successful return, its IsUsed() method returns true, the caller must ensure that callback specified in it is called whenever there is any input available on fd.

Implementation note: In GUI applications this is typically done by simply adding the file descriptor to the list of the descriptors monitored by the main loop. If this is impossible, or if the main application doesn't use an event loop at all, the file descriptor must be polled, at some interval, and the callback called manually.


Copyright (c) 2005-2024 Opal Kelly Incorporated