UniMRCP  1.5.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Typedefs | Functions
apt_task.h File Reference

Thread Execution Abstraction. More...

#include "apt.h"
#include "apt_task_msg.h"

Go to the source code of this file.

Data Structures

struct  apt_task_vtable_t
 

Typedefs

typedef
typedefAPT_BEGIN_EXTERN_C
struct apt_task_t 
apt_task_t
 
typedef struct apt_task_vtable_t apt_task_vtable_t
 
typedef apt_bool_t(* apt_task_method_f )(apt_task_t *task)
 
typedef void(* apt_task_event_f )(apt_task_t *task)
 

Functions

apt_task_tapt_task_create (void *obj, apt_task_msg_pool_t *msg_pool, apr_pool_t *pool)
 
apt_bool_t apt_task_destroy (apt_task_t *task)
 
apt_bool_t apt_task_add (apt_task_t *task, apt_task_t *child_task)
 
apt_bool_t apt_task_start (apt_task_t *task)
 
apt_bool_t apt_task_offline (apt_task_t *task)
 
apt_bool_t apt_task_online (apt_task_t *task)
 
apt_bool_t apt_task_terminate (apt_task_t *task, apt_bool_t wait_till_complete)
 
apt_bool_t apt_task_wait_till_complete (apt_task_t *task)
 
apt_task_msg_tapt_task_msg_get (apt_task_t *task)
 
apt_bool_t apt_task_msg_signal (apt_task_t *task, apt_task_msg_t *msg)
 
apt_bool_t apt_task_msg_parent_signal (apt_task_t *task, apt_task_msg_t *msg)
 
apt_bool_t apt_task_msg_process (apt_task_t *task, apt_task_msg_t *msg)
 
apt_bool_t apt_task_start_request_process (apt_task_t *task)
 
apt_bool_t apt_task_terminate_request_process (apt_task_t *task)
 
apt_task_tapt_task_parent_get (const apt_task_t *task)
 
apr_pool_t * apt_task_pool_get (const apt_task_t *task)
 
void * apt_task_object_get (const apt_task_t *task)
 
apt_task_vtable_tapt_task_vtable_get (apt_task_t *task)
 
void apt_task_name_set (apt_task_t *task, const char *name)
 
const char * apt_task_name_get (const apt_task_t *task)
 
void apt_task_auto_ready_set (apt_task_t *task, apt_bool_t auto_ready)
 
apt_bool_t apt_task_ready (apt_task_t *task)
 
apt_bool_tapt_task_running_flag_get (apt_task_t *task)
 
apt_bool_t apt_task_start_request_add (apt_task_t *task)
 
apt_bool_t apt_task_start_request_remove (apt_task_t *task)
 
apt_bool_t apt_task_terminate_request_add (apt_task_t *task)
 
apt_bool_t apt_task_terminate_request_remove (apt_task_t *task)
 
void apt_task_delay (apr_size_t msec)
 

Detailed Description

Thread Execution Abstraction.

Typedef Documentation

typedef void(* apt_task_event_f)(apt_task_t *task)

Opaque task event declaration

typedef apt_bool_t(* apt_task_method_f)(apt_task_t *task)

Opaque task method declaration

typedef typedefAPT_BEGIN_EXTERN_C struct apt_task_t apt_task_t

Opaque task declaration

Opaque task virtual table declaration

Function Documentation

apt_bool_t apt_task_add ( apt_task_t task,
apt_task_t child_task 
)

Add child task.

Parameters
taskthe task to add child task to
child_taskthe child task to add
void apt_task_auto_ready_set ( apt_task_t task,
apt_bool_t  auto_ready 
)

Enable/disable auto ready mode.

Parameters
taskthe task to set mode for
auto_readythe enabled/disabled auto ready mode
apt_task_t* apt_task_create ( void *  obj,
apt_task_msg_pool_t msg_pool,
apr_pool_t *  pool 
)

Create task.

Parameters
objthe external object to associate with the task
msg_poolthe pool of task messages
poolthe pool to allocate memory from
void apt_task_delay ( apr_size_t  msec)

Hold task execution.

Parameters
msecthe time to hold
apt_bool_t apt_task_destroy ( apt_task_t task)

Destroy task.

Parameters
taskthe task to destroy
apt_task_msg_t* apt_task_msg_get ( apt_task_t task)

Get (acquire) task message.

Parameters
taskthe task to get task message from
apt_bool_t apt_task_msg_parent_signal ( apt_task_t task,
apt_task_msg_t msg 
)

Signal (post) message to the parent of the specified task.

Parameters
taskthe task to signal message to
msgthe message to signal
apt_bool_t apt_task_msg_process ( apt_task_t task,
apt_task_msg_t msg 
)

Process message signaled to the task.

Parameters
taskthe task to process message
msgthe message to process
apt_bool_t apt_task_msg_signal ( apt_task_t task,
apt_task_msg_t msg 
)

Signal (post) message to the task.

Parameters
taskthe task to signal message to
msgthe message to signal
const char* apt_task_name_get ( const apt_task_t task)

Get task name.

Parameters
taskthe task to get name from
void apt_task_name_set ( apt_task_t task,
const char *  name 
)

Give a name to the task.

Parameters
taskthe task to give name for
namethe name to set
void* apt_task_object_get ( const apt_task_t task)

Get external object associated with the task.

Parameters
taskthe task to get object from
apt_bool_t apt_task_offline ( apt_task_t task)

Take task offline.

Parameters
taskthe task to take offline
apt_bool_t apt_task_online ( apt_task_t task)

Bring task online.

Parameters
taskthe task to bring online
apt_task_t* apt_task_parent_get ( const apt_task_t task)

Get parent (master) task.

Parameters
taskthe task to get parent from
apr_pool_t* apt_task_pool_get ( const apt_task_t task)

Get memory pool associated with task.

Parameters
taskthe task to get pool from
apt_bool_t apt_task_ready ( apt_task_t task)

Explicitly indicate task is ready to process messages.

Parameters
taskthe task
apt_bool_t* apt_task_running_flag_get ( apt_task_t task)

Get the running flag.

Parameters
taskthe task
apt_bool_t apt_task_start ( apt_task_t task)

Start task.

Parameters
taskthe task to start
apt_bool_t apt_task_start_request_add ( apt_task_t task)

Add start request.

Parameters
taskthe task
apt_bool_t apt_task_start_request_process ( apt_task_t task)

Process task start request.

Parameters
taskthe task being started
apt_bool_t apt_task_start_request_remove ( apt_task_t task)

Remove start request.

Parameters
taskthe task
apt_bool_t apt_task_terminate ( apt_task_t task,
apt_bool_t  wait_till_complete 
)

Terminate task.

Parameters
taskthe task to terminate
wait_till_completewhether to wait for task to complete or process termination asynchronously
apt_bool_t apt_task_terminate_request_add ( apt_task_t task)

Add termination request.

Parameters
taskthe task
apt_bool_t apt_task_terminate_request_process ( apt_task_t task)

Process task termination request.

Parameters
taskthe task being terminated
apt_bool_t apt_task_terminate_request_remove ( apt_task_t task)

Remove termination request.

Parameters
taskthe task
apt_task_vtable_t* apt_task_vtable_get ( apt_task_t task)

Get task vtable.

Parameters
taskthe task to get vtable from
apt_bool_t apt_task_wait_till_complete ( apt_task_t task)

Wait for task till complete.

Parameters
taskthe task to wait for