Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Examples

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 
00020 
00026 #include <axis2_defines.h>
00027 #include <axis2_env.h>
00028 #include <axis2_async_result.h>
00029 #include <axiom_soap_envelope.h>
00030 
00031 #ifdef __cplusplus
00032 extern "C"
00033 {
00034 #endif
00035 
00041 typedef struct axis2_callback_ops axis2_callback_ops_t;
00042 typedef struct axis2_callback axis2_callback_t; 
00043 
00044 typedef axis2_status_t (AXIS2_CALL *
00045         on_complete_func_ptr)(struct axis2_callback *, 
00046                              const axis2_env_t *);
00047 
00048 typedef axis2_status_t (AXIS2_CALL *
00049         on_error_func_ptr)(struct axis2_callback *,
00050                           const axis2_env_t *, int);
00051     
00056 struct axis2_callback_ops
00057 {
00063     axis2_status_t (AXIS2_CALL *
00064    invoke_on_complete)(struct axis2_callback *callback, 
00065                     const axis2_env_t *env, 
00066                     axis2_async_result_t *result);
00072     axis2_status_t (AXIS2_CALL *
00073    on_complete)(struct axis2_callback *callback, 
00074                     const axis2_env_t *env);
00080     axis2_status_t (AXIS2_CALL *
00081    report_error)(struct axis2_callback *callback, 
00082                 const axis2_env_t *env, 
00083                   int exception);
00089     axis2_status_t (AXIS2_CALL *
00090    on_error)(struct axis2_callback *callback, 
00091                 const axis2_env_t *env, 
00092                   int exception);
00108     axis2_bool_t (AXIS2_CALL *
00109    get_complete)(struct axis2_callback *callback, 
00110                   const axis2_env_t *env);
00116     axis2_status_t (AXIS2_CALL *
00117    set_complete)(struct axis2_callback *callback, 
00118                 const axis2_env_t *env, 
00119                   axis2_bool_t complete);
00120    
00121    
00122     axiom_soap_envelope_t* (AXIS2_CALL *
00123    get_envelope)(struct axis2_callback *callback, 
00124                 const axis2_env_t *env);
00125    
00126    
00127     axis2_status_t (AXIS2_CALL *
00128    set_envelope)(struct axis2_callback *callback, 
00129                 const axis2_env_t *env, 
00130                  axiom_soap_envelope_t *envelope);
00131    
00132    
00133     int (AXIS2_CALL *
00134    get_error)(struct axis2_callback *callback, 
00135                const axis2_env_t *env);
00136    
00137    
00138     axis2_status_t (AXIS2_CALL *
00139    set_error)(struct axis2_callback *callback, 
00140                const axis2_env_t *env, 
00141                int error);
00142    
00143    axis2_status_t (AXIS2_CALL *
00144    set_data)(struct axis2_callback *callback,
00145          void *data);
00146 
00147    void * (AXIS2_CALL *
00148    get_data)(struct axis2_callback *callback);
00149 
00150    void (AXIS2_CALL *
00151    set_on_complete)(struct axis2_callback *callback,
00152       on_complete_func_ptr f);
00153 
00154    void (AXIS2_CALL *
00155    set_on_error)(struct axis2_callback *callback,
00156       on_error_func_ptr f);
00157 
00158     axis2_status_t (AXIS2_CALL *
00159    free)(struct axis2_callback *callback, 
00160           const axis2_env_t *env);
00161 };
00162 
00167 struct axis2_callback
00168 {
00169     axis2_callback_ops_t *ops;    
00170 };
00171 
00172 AXIS2_EXTERN axis2_callback_t *AXIS2_CALL axis2_callback_create(const axis2_env_t *env);
00173     
00174 /************************** Start of function macros **************************/
00175 
00176 #define AXIS2_CALLBACK_INVOKE_ON_COMPLETE(callback, env, result) \
00177       ((callback)->ops->invoke_on_complete(callback, env, result))
00178 
00179 #define AXIS2_CALLBACK_ON_COMPLETE(callback, env) \
00180       ((callback)->ops->on_complete(callback, env))
00181 
00182 #define AXIS2_CALLBACK_REPORT_ERROR(callback, env, error) \
00183       ((callback)->ops->report_error(callback, env, error))
00184 
00185 #define AXIS2_CALLBACK_ON_ERROR(callback, env, error) \
00186       ((callback)->ops->on_error(callback, env, error))
00187 
00188 #define AXIS2_CALLBACK_GET_COMPLETE(callback, env)\
00189       ((callback)->ops->get_complete(callback, env))
00190 
00191 #define AXIS2_CALLBACK_SET_COMPLETE(callback, env, complete) \
00192       ((callback)->ops->set_complete(callback, env, complete))
00193 
00194 #define AXIS2_CALLBACK_GET_ENVELOPE(callback, env) \
00195       ((callback)->ops->get_envelope(callback, env))
00196 
00197 #define AXIS2_CALLBACK_SET_ENVELOPE(callback, env, envelope) \
00198       ((callback)->ops->set_envelope(callback, env, envelope))
00199       
00200 #define AXIS2_CALLBACK_GET_ERROR(callback, env) \
00201       ((callback)->ops->get_error(callback, env))
00202       
00203 #define AXIS2_CALLBACK_SET_ERROR(callback, env, error) \
00204       ((callback)->ops->set_error(callback, env, error))
00205 
00206 #define AXIS2_CALLBACK_GET_DATA(callback) \
00207       ((callback)->ops->get_data(callback))
00208 
00209 #define AXIS2_CALLBACK_SET_DATA(callback, data) \
00210       ((callback)->ops->set_data(callback, data))
00211 
00212 #define AXIS2_CALLBACK_SET_ON_COMPLETE(callback, func) \
00213       ((callback)->ops->set_on_complete(callback, func))
00214 
00215 #define AXIS2_CALLBACK_SET_ON_ERROR(callback, func) \
00216       ((callback)->ops->set_on_error(callback, func))
00217 
00218 #define AXIS2_CALLBACK_FREE(callback, env) \
00219       ((callback)->ops->free (callback, env))
00220 
00221 /************************** End of function macros ****************************/    
00222 
00224 #ifdef __cplusplus
00225 }
00226 #endif
00227 
00228 #endif                          /* AXIS2_CALLBACK_H */

Generated on Fri Jun 16 18:02:30 2006 for Axis2/C by  doxygen 1.4.2