Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Examples

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 
00025 #include <axis2_utils_defines.h>
00026 #include <axis2_env.h>
00027 
00028 #ifdef __cplusplus
00029 extern "C"
00030 {
00031 #endif
00032 
00033 struct axis2_array_list;
00034 struct axis2_array_list_ops;
00035     
00036 static const int AXIS2_ARRAY_LIST_DEFAULT_CAPACITY = 16;
00037     
00047     AXIS2_DECLARE_DATA typedef struct axis2_array_list_ops
00048     {
00056         axis2_status_t (AXIS2_CALL *
00057         ensure_capacity) (
00058                 struct axis2_array_list *array_list, 
00059                 const axis2_env_t *env, 
00060                 int min_capacity);
00061         
00067         int (AXIS2_CALL *
00068         size) (
00069                 struct axis2_array_list *array_list, 
00070                 const axis2_env_t *env);
00071         
00077         axis2_bool_t (AXIS2_CALL *
00078         is_empty) (
00079                 struct axis2_array_list *array_list, 
00080                 const axis2_env_t *env);
00081         
00088         axis2_bool_t (AXIS2_CALL *
00089         contains) (
00090                 struct axis2_array_list *array_list, 
00091                 const axis2_env_t *env, 
00092                 void *e);
00093             
00102         int (AXIS2_CALL *
00103         index_of) (
00104                 struct axis2_array_list *array_list, 
00105                 const axis2_env_t *env, 
00106                 void *e);
00107         
00116         int (AXIS2_CALL *
00117         last_index_of) (
00118                 struct axis2_array_list *array_list, 
00119                 const axis2_env_t *env, 
00120                 void *e);
00121         
00128         void** (AXIS2_CALL *
00129         to_array) (
00130                 struct axis2_array_list *array_list, 
00131                 const axis2_env_t *env);
00132         
00139         void* (AXIS2_CALL *
00140         get) (struct axis2_array_list *array_list, 
00141                 const axis2_env_t *env, 
00142                 int index);
00143         
00152         void* (AXIS2_CALL *
00153         set) (
00154                 struct axis2_array_list *array_list, 
00155                 const axis2_env_t *env, 
00156                 int index, 
00157                 void* e);
00158         
00166         axis2_status_t (AXIS2_CALL *
00167         add) (
00168                 struct axis2_array_list *array_list, 
00169                 const axis2_env_t *env, 
00170                 const void* e);
00171         
00181         axis2_status_t (AXIS2_CALL *
00182         add_at) (
00183                 struct axis2_array_list *array_list, 
00184                 const axis2_env_t *env, 
00185                 const int index, 
00186                 const void* e);
00187         
00194         void* (AXIS2_CALL *
00195         remove) (struct axis2_array_list *array_list, 
00196                 const axis2_env_t *env, 
00197                 int index);
00198         
00205         axis2_bool_t (AXIS2_CALL *
00206         check_bound_inclusive) (
00207                 struct axis2_array_list *array_list, 
00208                 const axis2_env_t *env, 
00209                 int index);
00210         
00217         axis2_bool_t (AXIS2_CALL *
00218         check_bound_exclusive) (
00219                 struct axis2_array_list *array_list, 
00220                 const axis2_env_t *env, 
00221                 int index);
00222             
00223         axis2_status_t (AXIS2_CALL *
00224         free) (
00225                 struct axis2_array_list *array_list, 
00226                 const axis2_env_t *env);
00227 
00228     } axis2_array_list_ops_t;
00229 
00234     typedef struct axis2_array_list
00235     {
00237         axis2_array_list_ops_t *ops;
00238     } axis2_array_list_t;
00239 
00246     AXIS2_EXTERN axis2_array_list_t* AXIS2_CALL axis2_array_list_create(const axis2_env_t *env, int capacity);
00250     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00251     axis2_array_list_free_void_arg(
00252             void *array_list, 
00253             const axis2_env_t *env);
00254 
00255 
00256 #define AXIS2_ARRAY_LIST_FREE(array_list, env) ((array_list)->ops->free(array_list, env))
00257 #define AXIS2_ARRAY_LIST_SIZE(array_list, env) ((array_list)->ops->size(array_list, env))
00258 #define AXIS2_ARRAY_LIST_IS_EMPTY(array_list, env) ((array_list)->ops->is_empty(array_list, env))
00259 #define AXIS2_ARRAY_LIST_CONTAINS(array_list, env, e) ((array_list)->ops->contains(array_list, env, e))
00260 #define AXIS2_ARRAY_LIST_INDEX_OF(array_list, env, e) ((array_list)->ops->index_of(array_list, env, e))
00261 #define AXIS2_ARRAY_LIST_LAST_INDEX_OF(array_list, env, e) ((array_list)->ops->last_index_of(array_list, env, e))    
00262 #define AXIS2_ARRAY_LIST_TO_ARRAY(array_list, env) ((array_list)->ops->index_of(array_list, env))
00263 #define AXIS2_ARRAY_LIST_GET(array_list, env, index) ((array_list)->ops->get(array_list, env, index))
00264 #define AXIS2_ARRAY_LIST_SET(array_list, env, index, e) ((array_list)->ops->set(array_list, env, index, e))
00265 #define AXIS2_ARRAY_LIST_ADD(array_list, env, e) ((array_list)->ops->add(array_list, env, e))
00266 #define AXIS2_ARRAY_LIST_ADD_AT(array_list, env, index, e) ((array_list)->ops->add_at(array_list, env, index, e))
00267 #define AXIS2_ARRAY_LIST_REMOVE(array_list, env, index) ((array_list)->ops->remove(array_list, env, index))
00268 
00271 #ifdef __cplusplus
00272 }
00273 #endif
00274 
00275 #endif    /* AXIS2_ARRAY_LIST_H */

Generated on Fri Jun 16 18:02:30 2006 for Axis2/C by  doxygen 1.4.2