axis2_property.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_PROPERTY_H
00019 #define AXIS2_PROPERTY_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_property axis2_property_t;
00033 typedef struct axis2_property_ops axis2_property_ops_t;
00034     
00045  struct axis2_property_ops
00046 {
00047 
00048     axis2_status_t (AXIS2_CALL *
00049     free) (axis2_property_t *property, 
00050             const axis2_env_t *env);
00051 
00055     axis2_status_t (AXIS2_CALL *
00056     set_scope) (axis2_property_t *property,
00057                 const axis2_env_t *env,
00058                 axis2_scope_t scope);
00059 
00060     axis2_status_t (AXIS2_CALL *
00061     set_free_func) (axis2_property_t *property,
00062                     const axis2_env_t *env,
00063                     AXIS2_FREE_VOID_ARG free_func);
00064 
00065     axis2_status_t (AXIS2_CALL *
00066     set_value) (axis2_property_t *property,
00067                 const axis2_env_t *env,
00068                 void *value);
00069     void *(AXIS2_CALL *
00070     get_value) (axis2_property_t *property,
00071                             const axis2_env_t *env);
00072 
00073     axis2_property_t* (AXIS2_CALL *
00074             clone)(
00075                 axis2_property_t *property,
00076                 const axis2_env_t *env);
00077 
00078 };
00079     
00080      
00084  struct axis2_property
00085 {
00086    axis2_property_ops_t *ops;
00087 };
00088 
00093 AXIS2_EXTERN axis2_property_t * AXIS2_CALL
00094 axis2_property_create(
00095     const axis2_env_t *env);
00096 
00110 AXIS2_EXTERN axis2_property_t * AXIS2_CALL
00111 axis2_property_create_with_args(
00112     const axis2_env_t *env,
00113     axis2_scope_t scope,
00114     AXIS2_FREE_VOID_ARG free_func,
00115     void *value);
00116 
00117 /*************************** Function macros **********************************/
00118 
00119 #define AXIS2_PROPERTY_FREE(property, env) \
00120       ((property)->ops->free (property, env))
00121 
00122 #define AXIS2_PROPERTY_SET_FREE_FUNC(property, env, free_func) \
00123       ((property)->ops->set_free_func (property, env, free_func))  
00124 
00125 #define AXIS2_PROPERTY_SET_SCOPE(property, env, scope) \
00126       ((property)->ops->set_scope (property, env, scope)) 
00127 
00128 #define AXIS2_PROPERTY_SET_VALUE(property, env, value) \
00129       ((property)->ops->set_value (property, env, value))
00130 
00131 #define AXIS2_PROPERTY_GET_VALUE(property, env) \
00132         ((property)->ops->get_value(property, env))
00133 
00134 #define AXIS2_PROPERTY_CLONE(property, env) \
00135         ((property)->ops->clone(property, env))
00136 
00137 /*************************** End of function macros ***************************/
00138 
00139 
00140 
00143 #ifdef __cplusplus
00144 }
00145 #endif
00146 
00147 #endif  /* AXIS2_PROPERTY_H */

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