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