00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef AXIS2_CTX_H
00018 #define AXIS2_CTX_H
00019
00020
00026 #include <axis2_defines.h>
00027 #include <axis2_hash.h>
00028 #include <axis2_env.h>
00029 #include <axis2_property.h>
00030
00031 #ifdef __cplusplus
00032 extern "C"
00033 {
00034 #endif
00035
00041 typedef struct axis2_ctx_ops axis2_ctx_ops_t;
00042 typedef struct axis2_ctx axis2_ctx_t;
00043
00044
00049 struct axis2_ctx_ops
00050 {
00058 axis2_status_t (AXIS2_CALL *
00059 set_property)(struct axis2_ctx *ctx,
00060 const axis2_env_t *env,
00061 const axis2_char_t *key,
00062 axis2_property_t *value,
00063 const axis2_bool_t persistent);
00064
00070 axis2_property_t *(AXIS2_CALL *
00071 get_property)(
00072 struct axis2_ctx *ctx,
00073 const axis2_env_t *env,
00074 const axis2_char_t *key,
00075 const axis2_bool_t persistent);
00076
00077 axis2_hash_t* (AXIS2_CALL *get_non_persistent_map)(struct axis2_ctx *ctx,
00078 const axis2_env_t *env);
00079
00080 axis2_hash_t* (AXIS2_CALL *get_persistent_map)(struct axis2_ctx *ctx,
00081 const axis2_env_t *env);
00082
00087 axis2_status_t (AXIS2_CALL *free)(axis2_ctx_t *ctx,
00088 const axis2_env_t *env);
00089 axis2_status_t (AXIS2_CALL *
00090 set_non_persistent_map)(
00091 struct axis2_ctx *ctx,
00092 const axis2_env_t *env,
00093 axis2_hash_t* map);
00094
00095 axis2_status_t (AXIS2_CALL *
00096 set_persistent_map)(
00097 struct axis2_ctx *ctx,
00098 const axis2_env_t *env,
00099 axis2_hash_t* map);
00100 };
00101
00106 struct axis2_ctx
00107 {
00108 axis2_ctx_ops_t *ops;
00109 };
00110
00111 AXIS2_EXTERN axis2_ctx_t *AXIS2_CALL axis2_ctx_create (const axis2_env_t *env);
00112
00113
00114
00115 #define AXIS2_CTX_SET_PROPERTY(ctx, env, key, value, persistent) \
00116 ((ctx)->ops->set_property(ctx, env, key, value, persistent))
00117 #define AXIS2_CTX_GET_PROPERTY(ctx, env, key, persistent) \
00118 ((ctx)->ops->get_property(ctx, env, key, persistent))
00119 #define AXIS2_CTX_GET_NON_PERSISTANT_MAP(ctx, env) \
00120 ((ctx)->ops->get_non_persistent_map(ctx, env))
00121 #define AXIS2_CTX_GET_PERSISTANT_MAP(ctx, env) \
00122 ((ctx)->ops->get_persistent_map(ctx, env))
00123 #define AXIS2_CTX_SET_NON_PERSISTANT_MAP(ctx, env, map) \
00124 ((ctx)->ops->set_non_persistent_map(ctx, env, map))
00125 #define AXIS2_CTX_SET_PERSISTANT_MAP(ctx, env, map) \
00126 ((ctx)->ops->set_persistent_map(ctx, env, map))
00127 #define AXIS2_CTX_FREE(ctx, env) \
00128 ((ctx)->ops->free (ctx, env))
00129
00130
00131
00133 #ifdef __cplusplus
00134 }
00135 #endif
00136
00137 #endif