axis2_callback.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 AXIS2_CALLBACK_H
00018 #define AXIS2_CALLBACK_H
00019 
00035 #include <axis2_defines.h>
00036 #include <axis2_env.h>
00037 #include <axis2_async_result.h>
00038 #include <axiom_soap_envelope.h>
00039 
00040 #ifdef __cplusplus
00041 extern "C"
00042 {
00043 #endif
00044 
00046     typedef struct axis2_callback_ops axis2_callback_ops_t;
00048     typedef struct axis2_callback axis2_callback_t;
00050     typedef axis2_status_t (AXIS2_CALL *
00051             axis2_on_complete_func_ptr)(axis2_callback_t *,
00052                     const axis2_env_t *);
00054     typedef axis2_status_t (AXIS2_CALL *
00055             axis2_on_error_func_ptr)(axis2_callback_t *,
00056                     const axis2_env_t *, int);
00057 
00062     struct axis2_callback_ops
00063     {
00072         axis2_status_t (AXIS2_CALL *
00073                 invoke_on_complete)(
00074                     axis2_callback_t *callback,
00075                     const axis2_env_t *env,
00076                     axis2_async_result_t *result);
00077 
00086         axis2_status_t (AXIS2_CALL *
00087                 on_complete)(
00088                     axis2_callback_t *callback,
00089                     const axis2_env_t *env);
00090 
00099         axis2_status_t (AXIS2_CALL *
00100                 report_error)(
00101                     axis2_callback_t *callback,
00102                     const axis2_env_t *env,
00103                     const int exception);
00104 
00114         axis2_status_t (AXIS2_CALL *
00115                 on_error)(
00116                     axis2_callback_t *callback,
00117                     const axis2_env_t *env,
00118                     const int exception);
00119 
00137         axis2_bool_t (AXIS2_CALL *
00138                 get_complete)(
00139                     const axis2_callback_t *callback,
00140                     const axis2_env_t *env);
00141 
00149         axis2_status_t (AXIS2_CALL *
00150                 set_complete)(
00151                     axis2_callback_t *callback,
00152                     const axis2_env_t *env,
00153                     const axis2_bool_t complete);
00154 
00161         axiom_soap_envelope_t *(AXIS2_CALL *
00162                 get_envelope)(
00163                     const axis2_callback_t *callback,
00164                     const axis2_env_t *env);
00165 
00173         axis2_status_t (AXIS2_CALL *
00174                 set_envelope)(
00175                     axis2_callback_t *callback,
00176                     const axis2_env_t *env,
00177                     axiom_soap_envelope_t *envelope);
00178 
00185         int (AXIS2_CALL *
00186                 get_error)(
00187                     const axis2_callback_t *callback,
00188                     const axis2_env_t *env);
00189 
00197         axis2_status_t (AXIS2_CALL *
00198                 set_error)(
00199                     axis2_callback_t *callback,
00200                     const axis2_env_t *env,
00201                     const int error);
00202 
00209         axis2_status_t (AXIS2_CALL *
00210                 set_data)(
00211                     axis2_callback_t *callback,
00212                     void *data);
00213 
00219         void *(AXIS2_CALL *
00220                 get_data)(
00221                     const axis2_callback_t *callback);
00222 
00228         void (AXIS2_CALL *
00229                 set_on_complete)(
00230                     axis2_callback_t *callback,
00231                     axis2_on_complete_func_ptr f);
00232 
00238         void (AXIS2_CALL *
00239                 set_on_error)(
00240                     axis2_callback_t *callback,
00241                     axis2_on_error_func_ptr f);
00242 
00249         axis2_status_t (AXIS2_CALL *
00250                 free)(
00251                     axis2_callback_t *callback,
00252                     const axis2_env_t *env);
00253     };
00254 
00258     struct axis2_callback
00259     {
00261         axis2_callback_ops_t *ops;
00262     };
00263 
00269     AXIS2_EXTERN axis2_callback_t *AXIS2_CALL 
00270     axis2_callback_create(
00271         const axis2_env_t *env);
00272 
00273 
00276 #define AXIS2_CALLBACK_INVOKE_ON_COMPLETE(callback, env, result) \
00277       ((callback)->ops->invoke_on_complete(callback, env, result))
00278 
00281 #define AXIS2_CALLBACK_ON_COMPLETE(callback, env) \
00282       ((callback)->ops->on_complete(callback, env))
00283 
00286 #define AXIS2_CALLBACK_REPORT_ERROR(callback, env, error) \
00287       ((callback)->ops->report_error(callback, env, error))
00288 
00291 #define AXIS2_CALLBACK_ON_ERROR(callback, env, error) \
00292       ((callback)->ops->on_error(callback, env, error))
00293 
00296 #define AXIS2_CALLBACK_GET_COMPLETE(callback, env)\
00297       ((callback)->ops->get_complete(callback, env))
00298 
00301 #define AXIS2_CALLBACK_SET_COMPLETE(callback, env, complete) \
00302       ((callback)->ops->set_complete(callback, env, complete))
00303 
00306 #define AXIS2_CALLBACK_GET_ENVELOPE(callback, env) \
00307       ((callback)->ops->get_envelope(callback, env))
00308 
00311 #define AXIS2_CALLBACK_SET_ENVELOPE(callback, env, envelope) \
00312       ((callback)->ops->set_envelope(callback, env, envelope))
00313 
00316 #define AXIS2_CALLBACK_GET_ERROR(callback, env) \
00317       ((callback)->ops->get_error(callback, env))
00318 
00321 #define AXIS2_CALLBACK_SET_ERROR(callback, env, error) \
00322       ((callback)->ops->set_error(callback, env, error))
00323 
00326 #define AXIS2_CALLBACK_GET_DATA(callback) \
00327       ((callback)->ops->get_data(callback))
00328 
00331 #define AXIS2_CALLBACK_SET_DATA(callback, data) \
00332       ((callback)->ops->set_data(callback, data))
00333 
00336 #define AXIS2_CALLBACK_SET_ON_COMPLETE(callback, func) \
00337       ((callback)->ops->set_on_complete(callback, func))
00338 
00341 #define AXIS2_CALLBACK_SET_ON_ERROR(callback, func) \
00342       ((callback)->ops->set_on_error(callback, func))
00343 
00346 #define AXIS2_CALLBACK_FREE(callback, env) \
00347       ((callback)->ops->free (callback, env))
00348 
00350 #ifdef __cplusplus
00351 }
00352 #endif
00353 
00354 #endif                          /* AXIS2_CALLBACK_H */

Generated on Tue Oct 3 20:47:58 2006 for Axis2/C by  doxygen 1.4.7