woden_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_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_scope) (
00055             axis2_generic_obj_t *generic_obj,
00056             const axis2_env_t *env,
00057             axis2_scope_t scope);
00058 
00059     axis2_status_t (AXIS2_CALL *
00060     set_free_func) (
00061             axis2_generic_obj_t *generic_obj,
00062             const axis2_env_t *env,
00063             AXIS2_FREE_VOID_ARG free_func);
00064 
00065     axis2_status_t (AXIS2_CALL *
00066     set_value) (
00067             axis2_generic_obj_t *generic_obj,
00068             const axis2_env_t *env,
00069             void *value);
00070     
00071     void *(AXIS2_CALL *
00072     get_value) (
00073             axis2_generic_obj_t *generic_obj,
00074             const axis2_env_t *env);
00075 
00076 };
00077     
00078      
00082  struct axis2_generic_obj
00083 {
00084    axis2_generic_obj_ops_t *ops;
00085 };
00086 
00091 AXIS2_EXTERN axis2_generic_obj_t * AXIS2_CALL
00092 axis2_generic_obj_create(const axis2_env_t *env);
00093 
00094 /*************************** Function macros **********************************/
00095 
00096 #define AXIS2_GENERIC_OBJ_FREE(generic_obj, env) \
00097       ((generic_obj)->ops->free (generic_obj, env))
00098 
00099 #define AXIS2_GENERIC_OBJ_SET_FREE_FUNC(generic_obj, env, free_func) \
00100       ((generic_obj)->ops->set_free_func (generic_obj, env, free_func))  
00101 
00102 #define AXIS2_GENERIC_OBJ_SET_SCOPE(generic_obj, env, scope) \
00103       ((generic_obj)->ops->set_scope (generic_obj, env, scope)) 
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 /*************************** End of function macros ***************************/
00112 
00113 
00114 
00117 #ifdef __cplusplus
00118 }
00119 #endif
00120 
00121 #endif  /* AXIS2_GENERIC_OBJ_H */

Generated on Wed Dec 20 20:34:50 2006 for Axis2/C by  doxygen 1.5.1