axis2_callback.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_CALLBACK_H
00019 #define AXIS2_CALLBACK_H
00020 
00036 #include <axis2_defines.h>
00037 #include <axis2_env.h>
00038 #include <axis2_async_result.h>
00039 #include <axiom_soap_envelope.h>
00040 
00041 #ifdef __cplusplus
00042 extern "C"
00043 {
00044 #endif
00045 
00047     typedef struct axis2_callback_ops axis2_callback_ops_t;
00049     typedef struct axis2_callback axis2_callback_t;
00051     typedef axis2_status_t (AXIS2_CALL *
00052             axis2_on_complete_func_ptr)(axis2_callback_t *,
00053                     const axis2_env_t *);
00055     typedef axis2_status_t (AXIS2_CALL *
00056             axis2_on_error_func_ptr)(axis2_callback_t *,
00057                     const axis2_env_t *, int);
00058 
00063     struct axis2_callback_ops
00064     {
00073         axis2_status_t (AXIS2_CALL *
00074                 invoke_on_complete)(
00075                     axis2_callback_t *callback,
00076                     const axis2_env_t *env,
00077                     axis2_async_result_t *result);
00078 
00087         axis2_status_t (AXIS2_CALL *
00088                 on_complete)(
00089                     axis2_callback_t *callback,
00090                     const axis2_env_t *env);
00091 
00100         axis2_status_t (AXIS2_CALL *
00101                 report_error)(
00102                     axis2_callback_t *callback,
00103                     const axis2_env_t *env,
00104                     const int exception);
00105 
00115         axis2_status_t (AXIS2_CALL *
00116                 on_error)(
00117                     axis2_callback_t *callback,
00118                     const axis2_env_t *env,
00119                     const int exception);
00120 
00138         axis2_bool_t (AXIS2_CALL *
00139                 get_complete)(
00140                     const axis2_callback_t *callback,
00141                     const axis2_env_t *env);
00142 
00150         axis2_status_t (AXIS2_CALL *
00151                 set_complete)(
00152                     axis2_callback_t *callback,
00153                     const axis2_env_t *env,
00154                     const axis2_bool_t complete);
00155 
00162         axiom_soap_envelope_t *(AXIS2_CALL *
00163                 get_envelope)(
00164                     const axis2_callback_t *callback,
00165                     const axis2_env_t *env);
00166 
00174         axis2_status_t (AXIS2_CALL *
00175                 set_envelope)(
00176                     axis2_callback_t *callback,
00177                     const axis2_env_t *env,
00178                     axiom_soap_envelope_t *envelope);
00179 
00186         int (AXIS2_CALL *
00187                 get_error)(
00188                     const axis2_callback_t *callback,
00189                     const axis2_env_t *env);
00190 
00198         axis2_status_t (AXIS2_CALL *
00199                 set_error)(
00200                     axis2_callback_t *callback,
00201                     const axis2_env_t *env,
00202                     const int error);
00203 
00210         axis2_status_t (AXIS2_CALL *
00211                 set_data)(
00212                     axis2_callback_t *callback,
00213                     void *data);
00214 
00220         void *(AXIS2_CALL *
00221                 get_data)(
00222                     const axis2_callback_t *callback);
00223 
00229         void (AXIS2_CALL *
00230                 set_on_complete)(
00231                     axis2_callback_t *callback,
00232                     axis2_on_complete_func_ptr f);
00233 
00239         void (AXIS2_CALL *
00240                 set_on_error)(
00241                     axis2_callback_t *callback,
00242                     axis2_on_error_func_ptr f);
00243 
00250         axis2_status_t (AXIS2_CALL *
00251                 free)(
00252                     axis2_callback_t *callback,
00253                     const axis2_env_t *env);
00254     };
00255 
00259     struct axis2_callback
00260     {
00262         axis2_callback_ops_t *ops;
00263     };
00264 
00270     AXIS2_EXTERN axis2_callback_t *AXIS2_CALL 
00271     axis2_callback_create(
00272         const axis2_env_t *env);
00273 
00274 
00277 #define AXIS2_CALLBACK_INVOKE_ON_COMPLETE(callback, env, result) \
00278       ((callback)->ops->invoke_on_complete(callback, env, result))
00279 
00282 #define AXIS2_CALLBACK_ON_COMPLETE(callback, env) \
00283       ((callback)->ops->on_complete(callback, env))
00284 
00287 #define AXIS2_CALLBACK_REPORT_ERROR(callback, env, error) \
00288       ((callback)->ops->report_error(callback, env, error))
00289 
00292 #define AXIS2_CALLBACK_ON_ERROR(callback, env, error) \
00293       ((callback)->ops->on_error(callback, env, error))
00294 
00297 #define AXIS2_CALLBACK_GET_COMPLETE(callback, env)\
00298       ((callback)->ops->get_complete(callback, env))
00299 
00302 #define AXIS2_CALLBACK_SET_COMPLETE(callback, env, complete) \
00303       ((callback)->ops->set_complete(callback, env, complete))
00304 
00307 #define AXIS2_CALLBACK_GET_ENVELOPE(callback, env) \
00308       ((callback)->ops->get_envelope(callback, env))
00309 
00312 #define AXIS2_CALLBACK_SET_ENVELOPE(callback, env, envelope) \
00313       ((callback)->ops->set_envelope(callback, env, envelope))
00314 
00317 #define AXIS2_CALLBACK_GET_ERROR(callback, env) \
00318       ((callback)->ops->get_error(callback, env))
00319 
00322 #define AXIS2_CALLBACK_SET_ERROR(callback, env, error) \
00323       ((callback)->ops->set_error(callback, env, error))
00324 
00327 #define AXIS2_CALLBACK_GET_DATA(callback) \
00328       ((callback)->ops->get_data(callback))
00329 
00332 #define AXIS2_CALLBACK_SET_DATA(callback, data) \
00333       ((callback)->ops->set_data(callback, data))
00334 
00337 #define AXIS2_CALLBACK_SET_ON_COMPLETE(callback, func) \
00338       ((callback)->ops->set_on_complete(callback, func))
00339 
00342 #define AXIS2_CALLBACK_SET_ON_ERROR(callback, func) \
00343       ((callback)->ops->set_on_error(callback, func))
00344 
00347 #define AXIS2_CALLBACK_FREE(callback, env) \
00348       ((callback)->ops->free (callback, env))
00349 
00351 #ifdef __cplusplus
00352 }
00353 #endif
00354 
00355 #endif                          /* AXIS2_CALLBACK_H */

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