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_terminate (apt_task_t *task, apt_bool_t wait_till_complete)
apt_bool_t apt_task_child_start (apt_task_t *task)
apt_bool_t apt_task_child_terminate (apt_task_t *task)
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_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

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:
task the task to add child task to
child_task the 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:
task the task to set mode for
auto_ready the enabled/disabled auto ready mode
apt_bool_t apt_task_child_start ( apt_task_t task  ) 

Start child tasks.

Parameters:
task the parent task
apt_bool_t apt_task_child_terminate ( apt_task_t task  ) 

Terminate child tasks.

Parameters:
task the parent task
apt_task_t* apt_task_create ( void *  obj,
apt_task_msg_pool_t msg_pool,
apr_pool_t *  pool 
)

Create task.

Parameters:
obj the external object to associate with the task
msg_pool the pool of task messages
pool the pool to allocate memory from
void apt_task_delay ( apr_size_t  msec  ) 

Hold task execution.

Parameters:
msec the time to hold
apt_bool_t apt_task_destroy ( apt_task_t task  ) 

Destroy task.

Parameters:
task the task to destroy
apt_task_msg_t* apt_task_msg_get ( apt_task_t task  ) 

Get (acquire) task message.

Parameters:
task the 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:
task the task to signal message to
msg the 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:
task the task to process message
msg the 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:
task the task to signal message to
msg the message to signal
const char* apt_task_name_get ( const apt_task_t task  ) 

Get task name.

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

Give a name to the task.

Parameters:
task the task to give name for
name the name to set
void* apt_task_object_get ( const apt_task_t task  ) 

Get external object associated with the task.

Parameters:
task the task to get object from
apt_task_t* apt_task_parent_get ( const apt_task_t task  ) 

Get parent (master) task.

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

Get memory pool associated with task.

Parameters:
task the task to get pool from
apt_bool_t apt_task_ready ( apt_task_t task  ) 

Explicitly indicate task is ready to process messages.

Parameters:
task the task
apt_bool_t* apt_task_running_flag_get ( apt_task_t task  ) 

Get the running flag.

Parameters:
task the task
apt_bool_t apt_task_start ( apt_task_t task  ) 

Start task.

Parameters:
task the task to start
apt_bool_t apt_task_start_request_add ( apt_task_t task  ) 

Add start request.

Parameters:
task the task
apt_bool_t apt_task_start_request_remove ( apt_task_t task  ) 

Remove start request.

Parameters:
task the task
apt_bool_t apt_task_terminate ( apt_task_t task,
apt_bool_t  wait_till_complete 
)

Terminate task.

Parameters:
task the task to terminate
wait_till_complete whether 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:
task the task
apt_bool_t apt_task_terminate_request_remove ( apt_task_t task  ) 

Remove termination request.

Parameters:
task the task
apt_task_vtable_t* apt_task_vtable_get ( apt_task_t task  ) 

Get task vtable.

Parameters:
task the task to get vtable from
apt_bool_t apt_task_wait_till_complete ( apt_task_t task  ) 

Wait for task till complete.

Parameters:
task the task to wait for
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on 25 Mar 2013 for UniMRCP by  doxygen 1.6.1