axis2_generic_obj.h

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_GENERIC_OBJ_H
00018 #define AXIS2_GENERIC_OBJ_H
00019 
00020 #include <axis2_utils_defines.h>
00021 #include <axis2_error.h>
00022 #include <axis2_env.h>
00023 #include <axis2_utils.h>
00024 
00025 
00026 #ifdef __cplusplus
00027 extern "C"
00028 {
00029 #endif
00030     
00031 typedef struct axis2_generic_obj axis2_generic_obj_t;
00032 typedef struct axis2_generic_obj_ops axis2_generic_obj_ops_t;
00033     
00044  struct axis2_generic_obj_ops
00045 {
00046 
00047     axis2_status_t (AXIS2_CALL *
00048     free) (
00049             axis2_generic_obj_t *generic_obj, 
00050             const axis2_env_t *env);
00051 
00052     axis2_status_t (AXIS2_CALL *
00053     set_free_func) (axis2_generic_obj_t *generic_obj,
00054                     const axis2_env_t *env,
00055                     AXIS2_FREE_VOID_ARG free_func);
00056 
00057     axis2_status_t (AXIS2_CALL *
00058     set_value) (axis2_generic_obj_t *generic_obj,
00059                 const axis2_env_t *env,
00060                 void *value);
00061 
00062     void *(AXIS2_CALL *
00063     get_value) (axis2_generic_obj_t *generic_obj,
00064                             const axis2_env_t *env);
00065 
00066     axis2_status_t (AXIS2_CALL *
00067     set_type) (
00068             axis2_generic_obj_t *generic_obj,
00069             const axis2_env_t *env,
00070             int type);
00071 
00072     int (AXIS2_CALL *
00073     get_type) (
00074             axis2_generic_obj_t *generic_obj,
00075             const axis2_env_t *env);
00076 
00077 
00078 };
00079     
00080      
00084  struct axis2_generic_obj
00085 {
00086    axis2_generic_obj_ops_t *ops;
00087 };
00088 
00093 AXIS2_EXTERN axis2_generic_obj_t * AXIS2_CALL
00094 axis2_generic_obj_create(const axis2_env_t *env);
00095 
00096 /*************************** Function macros **********************************/
00097 
00098 #define AXIS2_GENERIC_OBJ_FREE(generic_obj, env) \
00099       (((axis2_generic_obj_t *) generic_obj)->ops->free (generic_obj, env))
00100 
00101 #define AXIS2_GENERIC_OBJ_SET_FREE_FUNC(generic_obj, env, free_func) \
00102       ((generic_obj)->ops->set_free_func (generic_obj, env, free_func))  
00103 
00104 #define AXIS2_GENERIC_OBJ_SET_VALUE(generic_obj, env, value) \
00105       ((generic_obj)->ops->set_value (generic_obj, env, value))
00106 
00107 #define AXIS2_GENERIC_OBJ_GET_VALUE(generic_obj, env) \
00108         ((generic_obj)->ops->get_value(generic_obj, env))
00109  
00110 #define AXIS2_GENERIC_OBJ_SET_TYPE(generic_obj, env, type) \
00111       ((generic_obj)->ops->set_type (generic_obj, env, type))
00112 
00113 #define AXIS2_GENERIC_OBJ_GET_TYPE(generic_obj, env) \
00114         ((generic_obj)->ops->get_type(generic_obj, env))
00115                                                 
00116 /*************************** End of function macros ***************************/
00117 
00118 
00119 
00122 #ifdef __cplusplus
00123 }
00124 #endif
00125 
00126 #endif  /* AXIS2_GENERIC_OBJ_H */

Generated on Thu Oct 26 21:00:11 2006 for Axis2/C by  doxygen 1.4.7