00001 /* 00002 * Copyright 2008-2010 Arsen Chaloyan 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 * 00016 * $Id: apt_consumer_task.h 1708 2010-05-24 17:03:25Z achaloyan $ 00017 */ 00018 00019 #ifndef APT_CONSUMER_TASK_H 00020 #define APT_CONSUMER_TASK_H 00021 00022 /** 00023 * @file apt_consumer_task.h 00024 * @brief Consumer Task Definition 00025 */ 00026 00027 #include "apt_task.h" 00028 00029 APT_BEGIN_EXTERN_C 00030 00031 /** Opaque consumer task declaration */ 00032 typedef struct apt_consumer_task_t apt_consumer_task_t; 00033 00034 /** 00035 * Create consumer task. 00036 * @param obj the external object to associate with the task 00037 * @param msg_pool the pool of task messages 00038 * @param pool the pool to allocate memory from 00039 */ 00040 APT_DECLARE(apt_consumer_task_t*) apt_consumer_task_create( 00041 void *obj, 00042 apt_task_msg_pool_t *msg_pool, 00043 apr_pool_t *pool); 00044 00045 /** 00046 * Get task base. 00047 * @param task the consumer task to get base for 00048 */ 00049 APT_DECLARE(apt_task_t*) apt_consumer_task_base_get(const apt_consumer_task_t *task); 00050 00051 /** 00052 * Get task vtable. 00053 * @param task the consumer task to get vtable for 00054 */ 00055 APT_DECLARE(apt_task_vtable_t*) apt_consumer_task_vtable_get(apt_consumer_task_t *task); 00056 00057 /** 00058 * Get consumer task object. 00059 * @param task the consumer task to get object from 00060 */ 00061 APT_DECLARE(void*) apt_consumer_task_object_get(const apt_consumer_task_t *task); 00062 00063 APT_END_EXTERN_C 00064 00065 #endif /* APT_CONSUMER_TASK_H */