Static Public Member Functions

CL_KeepAlive Class Reference

CL_KeepAlive application loop helper. More...

#include <keep_alive.h>

List of all members.

Static Public Member Functions

static CL_Callback_v1< void * > & func_awake_thread ()
 Function that gets called when CL_KeepAliveObject::set_wakeup_event is called.
static CL_Callback_2< int,
const std::vector< CL_Event >
&, int > & 
func_event_wait ()
 Function that polls the events.
static CL_Callback_0< void * > & func_thread_id ()
 Function that gets called when CL_KeepAliveObject objects are created.
static std::vector
< CL_KeepAliveObject * > 
get_objects ()
 Returns all the current keep alive objects available for this thread.
static void process (int timeout=0)
 Processes and dispatches keep alive events until the specified timeout period has passed.

Detailed Description

CL_KeepAlive application loop helper.


Member Function Documentation

static CL_Callback_v1<void *>& CL_KeepAlive::func_awake_thread (  )  [static]

Function that gets called when CL_KeepAliveObject::set_wakeup_event is called.

This callback is used to provide a way to awaken a thread that needs to process keep alive events.

static CL_Callback_2<int , const std::vector<CL_Event> &, int >& CL_KeepAlive::func_event_wait (  )  [static]

Function that polls the events.

If this is not set, CL_Event::wait() is used.

Parameters:
events = The event objects to wait for
timeout = Timeout (ms). -1 = Wait forever
Returns:
The event that triggered an event.
-1 = Timeout events.size() = An external event was triggered
static CL_Callback_0<void *>& CL_KeepAlive::func_thread_id (  )  [static]

Function that gets called when CL_KeepAliveObject objects are created.

This callback is used to provide a thread identifier for the func_awake_thread callback.

static std::vector<CL_KeepAliveObject *> CL_KeepAlive::get_objects (  )  [static]

Returns all the current keep alive objects available for this thread.

static void CL_KeepAlive::process ( int  timeout = 0  )  [static]

Processes and dispatches keep alive events until the specified timeout period has passed.

Parameters:
timeout = Timeout (ms). -1 = Wait forever

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