apt_poller_task.h File Reference

Poller Task. More...

#include "apt_pollset.h"
#include "apt_task.h"
#include "apt_timer_queue.h"

Go to the source code of this file.

Typedefs

typedef
typedefAPT_BEGIN_EXTERN_C
struct apt_poller_task_t 
apt_poller_task_t
typedef apt_bool_t(* apt_poll_signal_f )(void *obj, const apr_pollfd_t *descriptor)

Functions

apt_poller_task_tapt_poller_task_create (apr_size_t max_pollset_size, apt_poll_signal_f signal_handler, void *obj, apt_task_msg_pool_t *msg_pool, apr_pool_t *pool)
apt_bool_t apt_poller_task_destroy (apt_poller_task_t *task)
void apt_poller_task_cleanup (apt_poller_task_t *task)
apt_bool_t apt_poller_task_start (apt_poller_task_t *task)
apt_bool_t apt_poller_task_terminate (apt_poller_task_t *task)
apt_task_tapt_poller_task_base_get (const apt_poller_task_t *task)
apt_task_vtable_tapt_poller_task_vtable_get (apt_poller_task_t *task)
void * apt_poller_task_object_get (const apt_poller_task_t *task)
apt_bool_t apt_poller_task_descriptor_add (const apt_poller_task_t *task, const apr_pollfd_t *descriptor)
apt_bool_t apt_poller_task_descriptor_remove (const apt_poller_task_t *task, const apr_pollfd_t *descriptor)
apt_timer_tapt_poller_task_timer_create (apt_poller_task_t *task, apt_timer_proc_f proc, void *obj, apr_pool_t *pool)

Detailed Description

Poller Task.


Typedef Documentation

typedef apt_bool_t(* apt_poll_signal_f)(void *obj, const apr_pollfd_t *descriptor)

Function prototype to handle signalled descripors

typedef typedefAPT_BEGIN_EXTERN_C struct apt_poller_task_t apt_poller_task_t

Opaque poller task declaration


Function Documentation

apt_task_t* apt_poller_task_base_get ( const apt_poller_task_t task  ) 

Get task base.

Parameters:
task the poller task to get task base from
void apt_poller_task_cleanup ( apt_poller_task_t task  ) 

Cleanup poller task.

Parameters:
task the task to cleanup
Remarks:
This function should be considered in protected scope. It will be called on task destroy unless you override the behavior.
apt_poller_task_t* apt_poller_task_create ( apr_size_t  max_pollset_size,
apt_poll_signal_f  signal_handler,
void *  obj,
apt_task_msg_pool_t msg_pool,
apr_pool_t *  pool 
)

Create poller task.

Parameters:
max_pollset_size the maximum number of descriptors pollset can hold
signal_handler the handler of signalled descriptors
obj the external object to pass to callback
msg_pool the pool of task messages
pool the pool to allocate memory from
apt_bool_t apt_poller_task_descriptor_add ( const apt_poller_task_t task,
const apr_pollfd_t *  descriptor 
)

Add descriptor to pollset.

Parameters:
task the task which holds the pollset
descriptor the descriptor to add
apt_bool_t apt_poller_task_descriptor_remove ( const apt_poller_task_t task,
const apr_pollfd_t *  descriptor 
)

Remove descriptor from pollset.

Parameters:
task the task which holds the pollset
descriptor the descriptor to remove
apt_bool_t apt_poller_task_destroy ( apt_poller_task_t task  ) 

Destroy poller task.

Parameters:
task the task to destroy
void* apt_poller_task_object_get ( const apt_poller_task_t task  ) 

Get external object.

Parameters:
task the poller task to get object from
apt_bool_t apt_poller_task_start ( apt_poller_task_t task  ) 

Start poller task and wait for incoming messages.

Parameters:
task the task to start
apt_bool_t apt_poller_task_terminate ( apt_poller_task_t task  ) 

Terminate poller task.

Parameters:
task the task to terminate
apt_timer_t* apt_poller_task_timer_create ( apt_poller_task_t task,
apt_timer_proc_f  proc,
void *  obj,
apr_pool_t *  pool 
)

Create timer.

Parameters:
task the poller task to create timer in the scope of
proc the timer callback
obj the object to pass to callback
pool the pool to allocate memory from
apt_task_vtable_t* apt_poller_task_vtable_get ( apt_poller_task_t task  ) 

Get task vtable.

Parameters:
task the poller task to get vtable from
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on 25 Mar 2013 for UniMRCP by  doxygen 1.6.1