xml_schema_enum.h

Go to the documentation of this file.
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 XML_SCHEMA_ENUM_H
00018 #define XML_SCHEMA_ENUM_H
00019 
00025 #include <axis2_allocator.h>
00026 #include <axis2_env.h>
00027 #include <axis2_error.h>
00028 #include <axis2_string.h>
00029 #include <axis2_utils_defines.h>
00030 #include <axis2_array_list.h>
00031 #include <axis2_hash.h>
00032 #include <xml_schema_defines.h>
00033 #include <xml_schema_constants.h>
00034 
00035 #ifdef __cplusplus
00036 extern "C"
00037 {
00038 #endif
00039 
00040 typedef struct xml_schema_enum xml_schema_enum_t;
00041 typedef struct xml_schema_enum_ops xml_schema_enum_ops_t;
00042 
00048 struct xml_schema_enum_ops
00049 {
00050     axis2_status_t (AXIS2_CALL *
00051     free)(
00052             void *schema_enum,
00053             const axis2_env_t *env);
00054 
00055     axis2_hash_t *(AXIS2_CALL *
00056     super_objs)(
00057             void *schema_enum,
00058             const axis2_env_t *env);
00059 
00060     xml_schema_types_t (AXIS2_CALL *
00061     get_type) (
00062             void *schema_enum,
00063             const axis2_env_t *env);
00064 
00065     axis2_char_t* (AXIS2_CALL *
00066     get_value)(
00067             void *schema_enum,
00068             const axis2_env_t *env);
00069 
00070     axis2_status_t (AXIS2_CALL *
00071     set_value)(
00072             void *schema_enum,
00073             const axis2_env_t *env,
00074             const axis2_char_t *value);
00075 
00076     axis2_bool_t (AXIS2_CALL *
00077     equals)(void *schema_enum,
00078             const axis2_env_t *env,
00079             void *obj);
00080 
00081     axis2_array_list_t* (AXIS2_CALL *
00082     get_values)(
00083             void *schema_enum, 
00084             const axis2_env_t *env);
00085     
00086 };
00087 
00088 struct xml_schema_enum
00089 {
00090     xml_schema_enum_ops_t *ops;
00091 };
00092 
00093 AXIS2_EXTERN xml_schema_enum_t * AXIS2_CALL
00094 xml_schema_enum_create(const axis2_env_t *env,
00095                        const axis2_char_t *value);
00096 
00100 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00101 xml_schema_enum_resolve_methods(xml_schema_enum_t *schema_enum,
00102                                 const axis2_env_t *env,
00103                                 xml_schema_enum_t *schema_enum_impl,
00104                                 XML_SCHEMA_SUPER_OBJS_FN super_objs,
00105                                 XML_SCHEMA_GET_TYPE_FN get_type,
00106                                 XML_SCHEMA_FREE_FN free_fn);
00107 
00108 AXIS2_EXTERN int AXIS2_CALL
00109 xml_schema_enum_index(axis2_char_t *value,
00110                             const axis2_env_t *env,
00111                             axis2_array_list_t *values);
00112                             
00113 /***************** macros ****************************************************/                           
00114 
00115 #define XML_SCHEMA_ENUM_FREE(schema_enum, env) \
00116       (((xml_schema_enum_t *) schema_enum)->ops->free (schema_enum, env))
00117 
00118 #define XML_SCHEMA_ENUM_SUPER_OBJS(schema_enum, env) \
00119       (((xml_schema_enum_t *) schema_enum)->ops->super_objs (schema_enum, env))
00120 
00121 #define XML_SCHEMA_ENUM_GET_TYPE(schema_enum, env) \
00122       (((xml_schema_enum_t *) schema_enum)->ops->get_type(schema_enum, env))
00123 
00124 #define XML_SCHEMA_ENUM_GET_VALUE(schema_enum, env) \
00125       (((xml_schema_enum_t *) schema_enum)->ops->get_value \
00126          (schema_enum, env))
00127 
00128 #define XML_SCHEMA_ENUM_SET_VALUE(schema_enum, env, value) \
00129       (((xml_schema_enum_t *) schema_enum)->ops->set_value \
00130          (schema_enum, env, value))
00131 
00132 #define XML_SCHEMA_ENUM_EQUALS(schema_enum, env) \
00133       (((xml_schema_enum_t *) schema_enum)->ops->equals (schema_enum, env))
00134 
00135 #define XML_SCHEMA_ENUM_GET_VALUES(schema_enum, env) \
00136       (((xml_schema_enum_t *) schema_enum)->ops->get_values \
00137          (schema_enum, env))
00138 
00139 /**************** end macros *************************************************/
00141 #ifdef __cplusplus
00142 }
00143 #endif
00144 #endif /* XML_SCHEMA_ENUM_H */

Generated on Tue Oct 3 20:48:00 2006 for Axis2/C by  doxygen 1.4.7