axis2_param.h

Go to the documentation of this file.
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_PARAM_H
00019 #define AXIS2_PARAM_H
00020 
00026 #include <axis2_utils_defines.h>
00027 #include <axis2_env.h>
00028 #include <axis2_hash.h>
00029 #include <axis2_array_list.h>
00030 
00031 #ifdef __cplusplus
00032 extern "C"
00033 {
00034 #endif
00035 
00036 struct axis2_param;
00037 struct axis2_param_ops;
00038 
00048   static const int AXIS2_TEXT_PARAM = 0;
00049 
00053   static const int AXIS2_DOM_PARAM = 1;
00054        
00058  typedef struct axis2_param_ops
00059     {
00060     
00065     axis2_char_t* (AXIS2_CALL *
00066    get_name)(struct axis2_param *param, 
00067            const axis2_env_t *env);
00068 
00073     void* (AXIS2_CALL *
00074    get_value)(struct axis2_param *param, 
00075              const axis2_env_t *env);
00076 
00081      axis2_status_t (AXIS2_CALL *
00082     set_name)(struct axis2_param *param, 
00083              const axis2_env_t *env, 
00084               const axis2_char_t *name);
00085 
00091      axis2_status_t (AXIS2_CALL *
00092     set_value)(struct axis2_param *param, 
00093              const axis2_env_t *env, 
00094              const void *value);
00095 
00101      axis2_bool_t (AXIS2_CALL *
00102     is_locked)(struct axis2_param *param,
00103               const axis2_env_t *env);
00104 
00110      axis2_status_t (AXIS2_CALL *
00111     set_locked)(struct axis2_param *param,
00112              const axis2_env_t *env,
00113              axis2_bool_t value);
00114 
00120      int (AXIS2_CALL *
00121     get_param_type)(struct axis2_param *param, 
00122                  const axis2_env_t *env);
00123 
00124      axis2_status_t (AXIS2_CALL *
00125     set_param_type)(struct axis2_param *param, 
00126                  const axis2_env_t *env,
00127                 int type);
00128 
00129      axis2_status_t (AXIS2_CALL *
00130     free)(struct axis2_param *param, 
00131           const axis2_env_t *env);
00132 
00133     axis2_status_t (AXIS2_CALL *
00134     set_attributes) (
00135             struct axis2_param *param,
00136             const axis2_env_t *env,
00137             axis2_hash_t *attrs);
00138 
00139     axis2_hash_t* (AXIS2_CALL *
00140     get_attributes) (
00141             struct axis2_param *param,
00142             const axis2_env_t *env);
00143          
00144     axis2_status_t (AXIS2_CALL *
00145     set_value_list) (
00146             struct axis2_param *param,
00147             const axis2_env_t *env,
00148             axis2_array_list_t *value_list);
00149 
00150     axis2_array_list_t* (AXIS2_CALL *
00151     get_value_list) (
00152             struct axis2_param *param,
00153             const axis2_env_t *env);
00154 
00155     axis2_status_t (AXIS2_CALL *
00156     value_free) (void *param_value, 
00157                  const axis2_env_t *env);
00158 }axis2_param_ops_t;
00159  
00163 typedef struct axis2_param
00164 {
00166    axis2_param_ops_t *ops;
00167 }axis2_param_t;
00168 
00172 AXIS2_EXTERN axis2_param_t* AXIS2_CALL 
00173 axis2_param_create(const axis2_env_t *env, 
00174                   axis2_char_t *name, 
00175                   void *value);
00176 
00177 #define AXIS2_PARAM_FREE(param, env) \
00178     ((param)->ops->free (param, env))
00179 
00180 #define AXIS2_PARAM_SET_NAME(param, env, name) \
00181     ((param)->ops->set_name (param, env, name))
00182 
00183 #define AXIS2_PARAM_GET_NAME(param, env) \
00184     ((param)->ops->get_name (param, env))
00185 
00186 #define AXIS2_PARAM_SET_VALUE(param, env, value) \
00187     ((param)->ops->set_value (param , env, value))
00188 
00189 #define AXIS2_PARAM_GET_VALUE(param, env) \
00190     ((param)->ops->get_value (param, env))
00191 
00192 #define AXIS2_PARAM_IS_LOCKED(param, env) \
00193     ((param)->ops->is_locked (param, env))
00194 
00195 #define AXIS2_PARAM_SET_LOCKED(param, env, locked) \
00196     ((param)->ops->set_locked (param, env, locked))
00197 
00198 #define AXIS2_PARAM_SET_PARAM_TYPE(param, env, type) \
00199     ((param)->ops->set_param_type (param, env, type))
00200  
00201 #define AXIS2_PARAM_GET_PARAM_TYPE(param, env) \
00202     ((param)->ops->get_param_type (param, env))
00203     
00204 #define AXIS2_PARAM_SET_ATTRIBUTES(param, env, attrs) \
00205     ((param)->ops->set_attributes (param , env, attrs))
00206 
00207 #define AXIS2_PARAM_GET_ATTRIBUTES(param, env) \
00208     ((param)->ops->get_attributes (param, env))
00209        
00210 #define AXIS2_PARAM_SET_VALUE_LIST(param, env, value_list) \
00211     ((param)->ops->set_value_list (param , env, value_list))
00212 
00213 #define AXIS2_PARAM_GET_VALUE_LIST(param, env) \
00214     ((param)->ops->get_value_list (param, env))
00215    
00218 #ifdef __cplusplus
00219 }
00220 #endif
00221 
00222 #endif    /* AXIS2_PARAM_H */

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