axis2_generic_obj.h

00001 /*
00002  * Licensed to the Apache Software Foundation (ASF) under one or more
00003  * contributor license agreements.  See the NOTICE file distributed with
00004  * this work for additional information regarding copyright ownership.
00005  * The ASF licenses this file to You under the Apache License, Version 2.0
00006  * (the "License"); you may not use this file except in compliance with
00007  * the License.  You may obtain a copy of the License at
00008  *
00009  *      http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 #ifndef AXIS2_GENERIC_OBJ_H
00019 #define AXIS2_GENERIC_OBJ_H
00020 
00021 #include <axis2_utils_defines.h>
00022 #include <axis2_error.h>
00023 #include <axis2_env.h>
00024 #include <axis2_utils.h>
00025 
00026 
00027 #ifdef __cplusplus
00028 extern "C"
00029 {
00030 #endif
00031     
00032 typedef struct axis2_generic_obj axis2_generic_obj_t;
00033 typedef struct axis2_generic_obj_ops axis2_generic_obj_ops_t;
00034     
00045  struct axis2_generic_obj_ops
00046 {
00047 
00048     axis2_status_t (AXIS2_CALL *
00049     free) (
00050             axis2_generic_obj_t *generic_obj, 
00051             const axis2_env_t *env);
00052 
00053     axis2_status_t (AXIS2_CALL *
00054     set_free_func) (axis2_generic_obj_t *generic_obj,
00055                     const axis2_env_t *env,
00056                     AXIS2_FREE_VOID_ARG free_func);
00057 
00058     axis2_status_t (AXIS2_CALL *
00059     set_value) (axis2_generic_obj_t *generic_obj,
00060                 const axis2_env_t *env,
00061                 void *value);
00062 
00063     void *(AXIS2_CALL *
00064     get_value) (axis2_generic_obj_t *generic_obj,
00065                             const axis2_env_t *env);
00066 
00067     axis2_status_t (AXIS2_CALL *
00068     set_type) (
00069             axis2_generic_obj_t *generic_obj,
00070             const axis2_env_t *env,
00071             int type);
00072 
00073     int (AXIS2_CALL *
00074     get_type) (
00075             axis2_generic_obj_t *generic_obj,
00076             const axis2_env_t *env);
00077 
00078 
00079 };
00080     
00081      
00085  struct axis2_generic_obj
00086 {
00087    axis2_generic_obj_ops_t *ops;
00088 };
00089 
00094 AXIS2_EXTERN axis2_generic_obj_t * AXIS2_CALL
00095 axis2_generic_obj_create(const axis2_env_t *env);
00096 
00097 /*************************** Function macros **********************************/
00098 
00099 #define AXIS2_GENERIC_OBJ_FREE(generic_obj, env) \
00100       (((axis2_generic_obj_t *) generic_obj)->ops->free (generic_obj, env))
00101 
00102 #define AXIS2_GENERIC_OBJ_SET_FREE_FUNC(generic_obj, env, free_func) \
00103       ((generic_obj)->ops->set_free_func (generic_obj, env, free_func))  
00104 
00105 #define AXIS2_GENERIC_OBJ_SET_VALUE(generic_obj, env, value) \
00106       ((generic_obj)->ops->set_value (generic_obj, env, value))
00107 
00108 #define AXIS2_GENERIC_OBJ_GET_VALUE(generic_obj, env) \
00109         ((generic_obj)->ops->get_value(generic_obj, env))
00110  
00111 #define AXIS2_GENERIC_OBJ_SET_TYPE(generic_obj, env, type) \
00112       ((generic_obj)->ops->set_type (generic_obj, env, type))
00113 
00114 #define AXIS2_GENERIC_OBJ_GET_TYPE(generic_obj, env) \
00115         ((generic_obj)->ops->get_type(generic_obj, env))
00116                                                 
00117 /*************************** End of function macros ***************************/
00118 
00119 
00120 
00123 #ifdef __cplusplus
00124 }
00125 #endif
00126 
00127 #endif  /* AXIS2_GENERIC_OBJ_H */

Generated on Wed Dec 20 20:14:10 2006 for Axis2/C by  doxygen 1.5.1