axis2_array_list.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2004,2005 The Apache Software Foundation.
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 
00017 #ifndef AXIS2_ARRAY_LIST_H
00018 #define AXIS2_ARRAY_LIST_H
00019 
00032 #include <axis2_utils_defines.h>
00033 #include <axis2_env.h>
00034 
00035 #ifdef __cplusplus
00036 extern "C"
00037 {
00038 #endif
00039 
00040     struct axis2_array_list;
00041     struct axis2_array_list_ops;
00042 
00043     static const int AXIS2_ARRAY_LIST_DEFAULT_CAPACITY = 16;
00044 
00048      typedef struct axis2_array_list_ops
00049     {
00059         axis2_status_t (AXIS2_CALL *
00060                 ensure_capacity)(
00061                     struct axis2_array_list *array_list,
00062                     const axis2_env_t *env,
00063                     int min_capacity);
00064 
00071         int (AXIS2_CALL *
00072                 size)(
00073                     struct axis2_array_list *array_list,
00074                     const axis2_env_t *env);
00075 
00082         axis2_bool_t (AXIS2_CALL *
00083                 is_empty)(
00084                     struct axis2_array_list *array_list,
00085                     const axis2_env_t *env);
00086 
00094         axis2_bool_t (AXIS2_CALL *
00095                 contains)(
00096                     struct axis2_array_list *array_list,
00097                     const axis2_env_t *env,
00098                     void *e);
00099 
00109         int (AXIS2_CALL *
00110                 index_of)(
00111                     struct axis2_array_list *array_list,
00112                     const axis2_env_t *env,
00113                     void *e);
00114 
00124         int (AXIS2_CALL *
00125                 last_index_of)(
00126                     struct axis2_array_list *array_list,
00127                     const axis2_env_t *env,
00128                     void *e);
00129 
00137         void** (AXIS2_CALL *
00138                 to_array)(
00139                     struct axis2_array_list *array_list,
00140                     const axis2_env_t *env);
00141 
00149         void* (AXIS2_CALL *
00150                 get)(struct axis2_array_list *array_list,
00151                     const axis2_env_t *env,
00152                     int index);
00153 
00163         void* (AXIS2_CALL *
00164                 set)(
00165                     struct axis2_array_list *array_list,
00166                     const axis2_env_t *env,
00167                     int index,
00168                     void* e);
00169 
00178         axis2_status_t (AXIS2_CALL *
00179                 add)(
00180                     struct axis2_array_list *array_list,
00181                     const axis2_env_t *env,
00182                     const void* e);
00183 
00194         axis2_status_t (AXIS2_CALL *
00195                 add_at)(
00196                     struct axis2_array_list *array_list,
00197                     const axis2_env_t *env,
00198                     const int index,
00199                     const void* e);
00200 
00208         void* (AXIS2_CALL *
00209                 remove)(struct axis2_array_list *array_list,
00210                     const axis2_env_t *env,
00211                     int index);
00212 
00220         axis2_bool_t (AXIS2_CALL *
00221                 check_bound_inclusive)(
00222                     struct axis2_array_list *array_list,
00223                     const axis2_env_t *env,
00224                     int index);
00225 
00233         axis2_bool_t (AXIS2_CALL *
00234                 check_bound_exclusive)(
00235                     struct axis2_array_list *array_list,
00236                     const axis2_env_t *env,
00237                     int index);
00238 
00244         axis2_status_t (AXIS2_CALL *
00245                 free)(
00246                     struct axis2_array_list *array_list,
00247                     const axis2_env_t *env);
00248 
00249     }
00250     axis2_array_list_ops_t;
00251 
00256     typedef struct axis2_array_list
00257     {
00259         axis2_array_list_ops_t *ops;
00260     }
00261     axis2_array_list_t;
00262 
00269     AXIS2_EXTERN axis2_array_list_t* AXIS2_CALL axis2_array_list_create(
00270         const axis2_env_t *env, 
00271    int capacity);
00272 
00278     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00279     axis2_array_list_free_void_arg(
00280         void *array_list,
00281         const axis2_env_t *env);
00282 
00283 
00286 #define AXIS2_ARRAY_LIST_FREE(array_list, env) \
00287         ((array_list)->ops->free(array_list, env))
00288 
00291 #define AXIS2_ARRAY_LIST_SIZE(array_list, env) \
00292         ((array_list)->ops->size(array_list, env))
00293 
00296 #define AXIS2_ARRAY_LIST_IS_EMPTY(array_list, env) \
00297         ((array_list)->ops->is_empty(array_list, env))
00298 
00301 #define AXIS2_ARRAY_LIST_CONTAINS(array_list, env, e) \
00302         ((array_list)->ops->contains(array_list, env, e))
00303 
00306 #define AXIS2_ARRAY_LIST_INDEX_OF(array_list, env, e) \
00307         ((array_list)->ops->index_of(array_list, env, e))
00308 
00311 #define AXIS2_ARRAY_LIST_LAST_INDEX_OF(array_list, env, e) \
00312         ((array_list)->ops->last_index_of(array_list, env, e))
00313 
00316 #define AXIS2_ARRAY_LIST_TO_ARRAY(array_list, env) \
00317         ((array_list)->ops->index_of(array_list, env))
00318 
00321 #define AXIS2_ARRAY_LIST_GET(array_list, env, index) \
00322         ((array_list)->ops->get(array_list, env, index))
00323 
00326 #define AXIS2_ARRAY_LIST_SET(array_list, env, index, e) \
00327         ((array_list)->ops->set(array_list, env, index, e))
00328 
00331 #define AXIS2_ARRAY_LIST_ADD(array_list, env, e) \
00332         ((array_list)->ops->add(array_list, env, e))
00333 
00336 #define AXIS2_ARRAY_LIST_ADD_AT(array_list, env, index, e) \
00337         ((array_list)->ops->add_at(array_list, env, index, e))
00338 
00341 #define AXIS2_ARRAY_LIST_REMOVE(array_list, env, index) \
00342         ((array_list)->ops->remove(array_list, env, index))
00343 
00346 #ifdef __cplusplus
00347 }
00348 #endif
00349 
00350 #endif    /* AXIS2_ARRAY_LIST_H */

Generated on Tue Oct 3 20:47:58 2006 for Axis2/C by  doxygen 1.4.7