OpFlex Framework  1.7.0
opflex::ofcore::MainLoopAdaptor Class Referenceabstract

An adaptor that allows integrating libopflex with an external main loop. More...

#include <opflex/ofcore/MainLoopAdaptor.h>

Public Member Functions

virtual void runOnce ()=0
 Run one iteration of the main loop, and return when complete. More...
 
virtual int getBackendFd ()=0
 Get the backend file descriptor. More...
 
virtual int getBackendTimeout ()=0
 Get the poll timeout for the backend file descriptor. More...
 

Detailed Description

An adaptor that allows integrating libopflex with an external main loop.

If using a main loop adaptor, libopflex will not create any threads of its own.

Member Function Documentation

virtual int opflex::ofcore::MainLoopAdaptor::getBackendFd ( )
pure virtual

Get the backend file descriptor.

This can be used to poll on events and call runOnce in response to the events.

Returns
a file descriptor for polling
virtual int opflex::ofcore::MainLoopAdaptor::getBackendTimeout ( )
pure virtual

Get the poll timeout for the backend file descriptor.

Returns
the timeout value in milliseconds, or -1 if there is no timeout.
virtual void opflex::ofcore::MainLoopAdaptor::runOnce ( )
pure virtual

Run one iteration of the main loop, and return when complete.

Call this for each iteration of your main loop after calling OFFramework::start. This function will not block.


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