You are viewing a plain text version of this content. The canonical link for it is here.
Posted to sandesha-dev@ws.apache.org by da...@apache.org on 2007/03/08 05:40:55 UTC

svn commit: r515923 - in /webservices/sandesha/trunk/c: include/sandesha2_report.h include/sandesha2_seq_report.h samples/rm_report/report.c src/client/client.c src/client/report.c src/client/sequence_report.c

Author: damitha
Date: Wed Mar  7 20:40:54 2007
New Revision: 515923

URL: http://svn.apache.org/viewvc?view=rev&rev=515923
Log:
Removed function macros from sandesha2_report.h and sandesha2_seq_report.h

Modified:
    webservices/sandesha/trunk/c/include/sandesha2_report.h
    webservices/sandesha/trunk/c/include/sandesha2_seq_report.h
    webservices/sandesha/trunk/c/samples/rm_report/report.c
    webservices/sandesha/trunk/c/src/client/client.c
    webservices/sandesha/trunk/c/src/client/report.c
    webservices/sandesha/trunk/c/src/client/sequence_report.c

Modified: webservices/sandesha/trunk/c/include/sandesha2_report.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_report.h?view=diff&rev=515923&r1=515922&r2=515923
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_report.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2_report.h Wed Mar  7 20:40:54 2007
@@ -36,138 +36,84 @@
 #endif
 
 typedef struct sandesha2_report sandesha2_report_t;
-typedef struct sandesha2_report_ops sandesha2_report_ops_t;
 
 /** @defgroup sandesha2_report Report
   * @ingroup sandesha2
   * @{
   */
 
-struct sandesha2_report_ops
-{
-   /** 
-     * Deallocate memory
-     * @return status code
-     */
-    axis2_status_t (AXIS2_CALL *
-    free) (
-        void *report,
-        const axis2_env_t *env);
-       
-    long (AXIS2_CALL *
-    get_completed_msgs_count) (
-        sandesha2_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t *seq_id);
-
-    axis2_array_list_t *(AXIS2_CALL *
-    get_incoming_seq_list) (
-        sandesha2_report_t *report,
-        const axis2_env_t *env);
-
-    axis2_array_list_t *(AXIS2_CALL *
-    get_outgoing_seq_list) (
-        sandesha2_report_t *report,
-        const axis2_env_t *env);
-
-    axis2_char_t (AXIS2_CALL *
-    get_seq_status_map) (
-        sandesha2_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t *seq_id);
-
-    axis2_status_t (AXIS2_CALL *
-    add_to_incoming_seq_list) (
-        sandesha2_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t *incoming_seq_id);
-
-    axis2_status_t (AXIS2_CALL *
-    add_to_outgoing_seq_list) (
-        sandesha2_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t *out_seq_id);
-
-    axis2_status_t (AXIS2_CALL *
-    add_to_no_of_completed_msgs_map) (
-        sandesha2_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t *id,
-        long no_of_msgs);
-        
-    axis2_status_t (AXIS2_CALL *
-    add_to_seq_status_map) (
-        sandesha2_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t *id,
-        axis2_char_t status);
-
-    axis2_char_t *(AXIS2_CALL *
-    get_internal_seq_id_of_out_seq) (
-        sandesha2_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t *out_seq_id);
-
-    axis2_status_t (AXIS2_CALL *
-    add_to_outgoing_internal_seq_map) (
-        sandesha2_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t *out_seq_id,
-        axis2_char_t *internal_seq_id);
-};
-
-struct sandesha2_report
-{
-    sandesha2_report_ops_t *ops;
-};
+/** 
+ * Deallocate memory
+ * @return status code
+ */
+axis2_status_t AXIS2_CALL
+sandesha2_report_free(
+    void *report,
+    const axis2_env_t *env);
+   
+long AXIS2_CALL 
+sandesha2_report_get_completed_msgs_count (
+    sandesha2_report_t *report,
+    const axis2_env_t *env,
+    axis2_char_t *seq_id);
+
+axis2_array_list_t *AXIS2_CALL
+sandesha2_report_get_incoming_seq_list (
+    sandesha2_report_t *report,
+    const axis2_env_t *env);
+
+axis2_array_list_t *AXIS2_CALL
+sandesha2_report_get_outgoing_seq_list (
+    sandesha2_report_t *report,
+    const axis2_env_t *env);
+
+axis2_char_t AXIS2_CALL
+sandesha2_report_get_seq_status_map (
+    sandesha2_report_t *report,
+    const axis2_env_t *env,
+    axis2_char_t *seq_id);
+
+axis2_status_t AXIS2_CALL
+sandesha2_report_add_to_incoming_seq_list (
+    sandesha2_report_t *report,
+    const axis2_env_t *env,
+    axis2_char_t *incoming_seq_id);
+
+axis2_status_t AXIS2_CALL
+sandesha2_report_add_to_outgoing_seq_list (
+    sandesha2_report_t *report,
+    const axis2_env_t *env,
+    axis2_char_t *out_seq_id);
+
+axis2_status_t AXIS2_CALL
+sandesha2_report_add_to_no_of_completed_msgs_map (
+    sandesha2_report_t *report,
+    const axis2_env_t *env,
+    axis2_char_t *id,
+    long no_of_msgs);
+    
+axis2_status_t AXIS2_CALL
+sandesha2_report_add_to_seq_status_map (
+    sandesha2_report_t *report,
+    const axis2_env_t *env,
+    axis2_char_t *id,
+    axis2_char_t status);
+
+axis2_char_t *AXIS2_CALL
+sandesha2_report_get_internal_seq_id_of_out_seq(
+    sandesha2_report_t *report,
+    const axis2_env_t *env,
+    axis2_char_t *out_seq_id);
+
+axis2_status_t AXIS2_CALL
+sandesha2_report_add_to_outgoing_internal_seq_map(
+    sandesha2_report_t *report,
+    const axis2_env_t *env,
+    axis2_char_t *out_seq_id,
+    axis2_char_t *internal_seq_id);
 
 AXIS2_EXTERN sandesha2_report_t * AXIS2_CALL
 sandesha2_report_create(const axis2_env_t *env);
-
-#define SANDESHA2_REPORT_FREE(report, env) \
-      (((sandesha2_report_t *) report)->ops->free (report, env))
-
-#define SANDESHA2_REPORT_GET_COMPLETED_MSGS_COUNT(report, env, seq_id) \
-      (((sandesha2_report_t *) report)->ops->\
-      get_completed_msgs_count  (report, env, seq_id))
-
-#define SANDESHA2_REPORT_GET_INCOMING_SEQ_LIST(report, env) \
-      (((sandesha2_report_t *) report)->ops->\
-       get_incoming_seq_list (report, env))
-
-#define SANDESHA2_REPORT_GET_OUTGOING_SEQ_LIST(report, env) \
-      (((sandesha2_report_t *) report)->ops->\
-       get_outgoing_seq_list (report, env))
-
-#define SANDESHA2_REPORT_GET_SEQ_STATUS_MAP(report, env, seq_id) \
-      (((sandesha2_report_t *) report)->ops->\
-       get_seq_status_map (report, env, seq_id))
-
-#define SANDESHA2_REPORT_ADD_TO_INCOMING_SEQ_LIST(report, env, incoming_seq_id) \
-      (((sandesha2_report_t *) report)->ops->\
-       add_to_incoming_seq_list (report, env, incoming_seq_id))
-
-#define SANDESHA2_REPORT_ADD_TO_OUTGOING_SEQ_LIST(report, env, out_seq_id) \
-      (((sandesha2_report_t *) report)->ops->\
-       add_to_outgoing_seq_list (report, env, out_seq_id))
-
-#define SANDESHA2_REPORT_ADD_TO_NO_OF_COMPLETED_MSGS_MAP(report, env, id, \
-        no_of_msgs) \
-      (((sandesha2_report_t *) report)->ops->\
-       add_to_no_of_completed_msgs_map (report, env, id, no_of_msgs))
-
-#define SANDESHA2_REPORT_ADD_TO_SEQ_STATUS_MAP(report, env, id, status) \
-      (((sandesha2_report_t *) report)->ops->\
-       add_to_seq_status_map (report, env, id, status))
-
-#define SANDESHA2_REPORT_GET_INTERNAL_SEQ_ID_OF_OUT_SEQ(report, env, out_seq_id) \
-      (((sandesha2_report_t *) report)->ops->\
-       get_internal_seq_id_of_out_seq (report, env, out_seq_id))
-
-#define SANDESHA2_REPORT_ADD_TO_OUTGOING_INTERNAL_SEQ_MAP(report, env, \
-        out_seq_id, internal_seq_id) \
-      (((sandesha2_report_t *) report)->ops->\
-       add_to_outgoing_internal_seq_map (report, env, out_seq_id, internal_seq_id))
 
 /** @} */
 #ifdef __cplusplus

Modified: webservices/sandesha/trunk/c/include/sandesha2_seq_report.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_seq_report.h?view=diff&rev=515923&r1=515922&r2=515923
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_seq_report.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2_seq_report.h Wed Mar  7 20:40:54 2007
@@ -37,7 +37,6 @@
 #endif
 
 typedef struct sandesha2_seq_report sandesha2_seq_report_t;
-typedef struct sandesha2_seq_report_ops sandesha2_seq_report_ops_t;
 
 #define SANDESHA2_SEQ_STATUS_UNKNOWN 0
 #define SANDESHA2_SEQ_STATUS_INITIAL 1
@@ -56,140 +55,75 @@
   * @ingroup sandesha2
   * @{
   */
-
-struct sandesha2_seq_report_ops
-{
-   /** 
-     * Deallocate memory
-     * @return status code
-     */
-    axis2_status_t (AXIS2_CALL *
-    free) (
-            void *seq_report,
-            const axis2_env_t *env);
-     
-    axis2_status_t (AXIS2_CALL *
-    set_seq_status) (
-            sandesha2_seq_report_t *report,
-            const axis2_env_t *env,
-            axis2_char_t seq_status);
-
-    axis2_status_t (AXIS2_CALL *
-    set_seq_direction) (
-            sandesha2_seq_report_t *report,
-            const axis2_env_t *env,
-            axis2_char_t seq_direction);
-
-    axis2_char_t (AXIS2_CALL *
-    get_seq_status) (
-            sandesha2_seq_report_t *report,
-            const axis2_env_t *env);
-
-    axis2_char_t (AXIS2_CALL *
-    get_seq_direction) (
-            sandesha2_seq_report_t *report,
-            const axis2_env_t *env);
-
-    axis2_char_t *(AXIS2_CALL *
-    get_seq_id) (
-            sandesha2_seq_report_t *report,
-            const axis2_env_t *env);
-
-    axis2_status_t (AXIS2_CALL *
-    set_seq_id) (
-            sandesha2_seq_report_t *report,
-            const axis2_env_t *env,
-            axis2_char_t *seq_id);
-
-    axis2_array_list_t *(AXIS2_CALL *
-    get_completed_msgs) (
-            sandesha2_seq_report_t *report,
-            const axis2_env_t *env);
-
-    axis2_status_t (AXIS2_CALL *
-    add_completed_msg) (
-            sandesha2_seq_report_t *report,
-            const axis2_env_t *env,
-            long *msg_no);
-
-    axis2_status_t (AXIS2_CALL *
-    set_completed_msgs) (
-            sandesha2_seq_report_t *report,
-            const axis2_env_t *env,
-            axis2_array_list_t *completed_msgs);
-
-    axis2_char_t *(AXIS2_CALL *
-    get_internal_seq_id) (
-            sandesha2_seq_report_t *report,
-            const axis2_env_t *env,
-            long *msg_no);
-
-    axis2_status_t (AXIS2_CALL *
-    set_internal_seq_id) (
-            sandesha2_seq_report_t *report,
-            const axis2_env_t *env,
-            axis2_char_t *internal_seq_id);
-   
-};
-
-struct sandesha2_seq_report
-{
-    sandesha2_seq_report_ops_t *ops;
-};
+axis2_status_t AXIS2_CALL 
+sandesha2_seq_report_free(
+    void *report,
+    const axis2_env_t *envv);
+
+axis2_status_t AXIS2_CALL
+sandesha2_seq_report_set_seq_status(
+    sandesha2_seq_report_t *report,
+    const axis2_env_t *env,
+    axis2_char_t seq_status);
+
+axis2_status_t AXIS2_CALL
+sandesha2_seq_report_set_seq_direction(
+    sandesha2_seq_report_t *report,
+    const axis2_env_t *env,
+    axis2_char_t seq_direction);
+
+axis2_char_t AXIS2_CALL
+sandesha2_seq_report_get_seq_status(
+    sandesha2_seq_report_t *report,
+    const axis2_env_t *env);
+
+axis2_char_t AXIS2_CALL
+sandesha2_seq_report_get_seq_direction(
+    sandesha2_seq_report_t *report,
+    const axis2_env_t *env);
+
+axis2_char_t *AXIS2_CALL
+sandesha2_seq_report_get_seq_id(
+    sandesha2_seq_report_t *report,
+    const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+sandesha2_seq_report_set_seq_id(
+    sandesha2_seq_report_t *report,
+    const axis2_env_t *env,
+    axis2_char_t *seq_id);
+
+axis2_array_list_t *AXIS2_CALL
+sandesha2_seq_report_get_completed_msgs(
+    sandesha2_seq_report_t *report,
+    const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+sandesha2_seq_report_add_completed_msg(
+    sandesha2_seq_report_t *report,
+    const axis2_env_t *env,
+    long *msg_no);
+
+axis2_status_t AXIS2_CALL
+sandesha2_seq_report_set_completed_msgs(
+    sandesha2_seq_report_t *report,
+    const axis2_env_t *env,
+    axis2_array_list_t *completed_msgs);
+
+axis2_char_t *AXIS2_CALL
+sandesha2_seq_report_get_internal_seq_id(
+    sandesha2_seq_report_t *report,
+    const axis2_env_t *env,
+    long *msg_no);
+
+axis2_status_t AXIS2_CALL
+sandesha2_seq_report_set_internal_seq_id(
+    sandesha2_seq_report_t *report,
+    const axis2_env_t *env,
+    axis2_char_t *internal_seq_id);
 
 AXIS2_EXTERN sandesha2_seq_report_t * AXIS2_CALL
 sandesha2_seq_report_create(const axis2_env_t *env);
-
-#define SANDESHA2_SEQ_REPORT_FREE(seq_report, env) \
-      (((sandesha2_seq_report_t *) seq_report)->ops->free (seq_report, env))
-
-#define SANDESHA2_SEQ_REPORT_SET_SEQ_STATUS(seq_report, env, \
-        seq_status) \
-      (((sandesha2_seq_report_t *) seq_report)->ops->\
-      set_seq_status (seq_report, env, seq_status))
-
-#define SANDESHA2_SEQ_REPORT_SET_SEQ_DIRECTION(seq_report, env, \
-        seq_direction) \
-      (((sandesha2_seq_report_t *) seq_report)->ops->\
-      set_seq_direction (seq_report, env, seq_direction))
-
-#define SANDESHA2_SEQ_REPORT_GET_SEQ_STATUS(seq_report, env) \
-      (((sandesha2_seq_report_t *) seq_report)->ops->\
-      get_seq_status (seq_report, env))
-
-#define SANDESHA2_SEQ_REPORT_GET_SEQ_DIRECTION(seq_report, env) \
-      (((sandesha2_seq_report_t *) seq_report)->ops->\
-      get_seq_direction (seq_report, env))
-
-#define SANDESHA2_SEQ_REPORT_GET_SEQ_ID(seq_report, env) \
-      (((sandesha2_seq_report_t *) seq_report)->ops->\
-      get_seq_id (seq_report, env))
-
-#define SANDESHA2_SEQ_REPORT_SET_SEQ_ID(seq_report, env, seq_id) \
-      (((sandesha2_seq_report_t *) seq_report)->ops->\
-      set_seq_id (seq_report, env, seq_id))
-
-#define SANDESHA2_SEQ_REPORT_GET_COMPLETED_MSGS(seq_report, env) \
-      (((sandesha2_seq_report_t *) seq_report)->ops->\
-      get_completed_msgs (seq_report, env))
-
-#define SANDESHA2_SEQ_REPORT_ADD_COMPLETED_MSG(seq_report, env, msg_no) \
-      (((sandesha2_seq_report_t *) seq_report)->ops->\
-      add_completed_msg (seq_report, env, msg_no))
-
-#define SANDESHA2_SEQ_REPORT_SET_COMPLETED_MSGS(seq_report, env, completed_msgs) \
-      (((sandesha2_seq_report_t *) seq_report)->ops->\
-      set_completed_msgs (seq_report, env, completed_msgs))
-
-#define SANDESHA2_SEQ_REPORT_GET_INTERNAL_SEQ_ID(seq_report, env) \
-      (((sandesha2_seq_report_t *) seq_report)->ops->\
-      get_internal_seq_id (seq_report, env))
-
-#define SANDESHA2_SEQ_REPORT_SET_INTERNAL_SEQ_ID(seq_report, env, \
-        seq_id) \
-      (((sandesha2_seq_report_t *) seq_report)->ops->\
-      set_internal_seq_id (seq_report, env, seq_id))
-
 
 /** @} */
 #ifdef __cplusplus

Modified: webservices/sandesha/trunk/c/samples/rm_report/report.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/samples/rm_report/report.c?view=diff&rev=515923&r1=515922&r2=515923
==============================================================================
--- webservices/sandesha/trunk/c/samples/rm_report/report.c (original)
+++ webservices/sandesha/trunk/c/samples/rm_report/report.c Wed Mar  7 20:40:54 2007
@@ -197,7 +197,6 @@
     payload = build_om_payload_for_echo_svc(env, "echo1", "sequence1");
     result = AXIS2_SVC_CLIENT_SEND_RECEIVE(svc_client, env, payload);
 
-    /*result = sandesha2_client_get_response_envelope(env, conf_ctx, svc_client, 2);*/
     if(result)
     {
         axis2_char_t *om_str = NULL;
@@ -220,7 +219,7 @@
         int i = 0, size = 0;
         axis2_array_list_t *incoming_seq_list = NULL;
         axis2_array_list_t *outgoing_seq_list = NULL;
-        incoming_seq_list = SANDESHA2_REPORT_GET_INCOMING_SEQ_LIST(report, env);
+        incoming_seq_list = sandesha2_report_get_incoming_seq_list(report, env);
         if(incoming_seq_list)
             size = axis2_array_list_size(incoming_seq_list, env);
         for(i = 0; i < size; i++)
@@ -232,7 +231,7 @@
             }
         }
         size = 0;
-        outgoing_seq_list = SANDESHA2_REPORT_GET_OUTGOING_SEQ_LIST(report, env);
+        outgoing_seq_list = sandesha2_report_get_outgoing_seq_list(report, env);
         if(outgoing_seq_list)
             size = axis2_array_list_size(outgoing_seq_list, env);
         for(i = 0; i < size; i++)
@@ -242,7 +241,7 @@
             {
                 long completed_msgs_count = -1; 
                 printf("outgoing seq_id %d:%s\n", i+1, seq_id);
-                completed_msgs_count = SANDESHA2_REPORT_GET_COMPLETED_MSGS_COUNT(
+                completed_msgs_count = sandesha2_report_get_completed_msgs_count(
                     report, env, seq_id);
                 printf("completed_msgs_count:%d\n", completed_msgs_count);
             }
@@ -252,7 +251,6 @@
     AXIS2_OPTIONS_SET_PROPERTY(options, env, "Sandesha2LastMessage", property);
     payload = build_om_payload_for_echo_svc(env, "echo2", "sequence1");
     result = AXIS2_SVC_CLIENT_SEND_RECEIVE(svc_client, env, payload);
-    /*result = sandesha2_client_get_response_envelope(env, conf_ctx, svc_client, 3);*/
     if(result)
     {
         axis2_char_t *om_str = NULL;

Modified: webservices/sandesha/trunk/c/src/client/client.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/client/client.c?view=diff&rev=515923&r1=515922&r2=515923
==============================================================================
--- webservices/sandesha/trunk/c/src/client/client.c (original)
+++ webservices/sandesha/trunk/c/src/client/client.c Wed Mar  7 20:40:54 2007
@@ -244,7 +244,7 @@
     AXIS2_PARAM_CHECK(env->error, conf_ctx, NULL);
 
     seq_report = sandesha2_seq_report_create(env);
-    SANDESHA2_SEQ_REPORT_SET_SEQ_DIRECTION(seq_report, env, 
+    sandesha2_seq_report_set_seq_direction(seq_report, env, 
         SANDESHA2_SEQ_DIRECTION_OUT);
 
     conf = AXIS2_CONF_CTX_GET_CONF(conf_ctx, env);
@@ -276,7 +276,7 @@
         }
         client_report_transaction = report_transaction;
     }
-    SANDESHA2_SEQ_REPORT_SET_INTERNAL_SEQ_ID(seq_report, env, internal_seq_id);
+    sandesha2_seq_report_set_internal_seq_id(seq_report, env, internal_seq_id);
     create_seq_find_bean = sandesha2_create_seq_bean_create(env);
     sandesha2_create_seq_bean_set_internal_seq_id(create_seq_find_bean, 
         env, internal_seq_id);
@@ -310,7 +310,7 @@
          */
 
         /* so, setting the seq status to INITIAL */
-        SANDESHA2_SEQ_REPORT_SET_SEQ_STATUS(seq_report, env, 
+        sandesha2_seq_report_set_seq_status(seq_report, env, 
             SANDESHA2_SEQ_STATUS_INITIAL);
 		/* returning the current seq report.*/
         return seq_report;
@@ -318,15 +318,15 @@
     out_seq_id = sandesha2_create_seq_bean_get_seq_id(create_seq_bean, env);
     if(!out_seq_id)
     {
-        SANDESHA2_SEQ_REPORT_SET_INTERNAL_SEQ_ID(seq_report, env, 
+        sandesha2_seq_report_set_internal_seq_id(seq_report, env, 
             internal_seq_id);
-        SANDESHA2_SEQ_REPORT_SET_SEQ_STATUS(seq_report, env, 
+        sandesha2_seq_report_set_seq_status(seq_report, env, 
             SANDESHA2_SEQ_STATUS_INITIAL);
-        SANDESHA2_SEQ_REPORT_SET_SEQ_DIRECTION(seq_report, env, 
+        sandesha2_seq_report_set_seq_direction(seq_report, env, 
             SANDESHA2_SEQ_DIRECTION_OUT);
         return seq_report;
     }
-    SANDESHA2_SEQ_REPORT_SET_SEQ_STATUS(seq_report, env, 
+    sandesha2_seq_report_set_seq_status(seq_report, env, 
         SANDESHA2_SEQ_STATUS_ESTABLISHED);
     sandesha2_client_fill_outgoing_seq_info(env, seq_report, out_seq_id, 
         seq_prop_mgr);
@@ -365,7 +365,7 @@
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
-    incoming_seq_ids = SANDESHA2_REPORT_GET_INCOMING_SEQ_LIST(report, env);
+    incoming_seq_ids = sandesha2_report_get_incoming_seq_list(report, env);
     for(i = 0; i < size; i++)
     {
         axis2_char_t *seq_id = NULL;
@@ -466,19 +466,19 @@
         bean = (sandesha2_seq_property_bean_t *) axis2_array_list_get(
             collection, env, i);
         seq_id = sandesha2_seq_property_bean_get_seq_id(bean, env);
-        SANDESHA2_REPORT_ADD_TO_OUTGOING_SEQ_LIST(sandesha2_report, env, seq_id);
+        sandesha2_report_add_to_outgoing_seq_list(sandesha2_report, env, seq_id);
         value = sandesha2_seq_property_bean_get_value(bean, env);
-        SANDESHA2_REPORT_ADD_TO_OUTGOING_INTERNAL_SEQ_MAP(sandesha2_report, env,  
+        sandesha2_report_add_to_outgoing_internal_seq_map(sandesha2_report, env,  
             seq_id, value);
         report = sandesha2_client_get_outgoing_seq_report_with_internal_seq_id(
             env, value, conf_ctx);
-        completed_msgs = SANDESHA2_SEQ_REPORT_GET_COMPLETED_MSGS(report, env);
+        completed_msgs = sandesha2_seq_report_get_completed_msgs(report, env);
         if(completed_msgs)
             no_of_msgs = axis2_array_list_size(completed_msgs, env);
-        SANDESHA2_REPORT_ADD_TO_NO_OF_COMPLETED_MSGS_MAP(sandesha2_report, env, 
+        sandesha2_report_add_to_no_of_completed_msgs_map(sandesha2_report, env, 
             seq_id, no_of_msgs);
-        status = SANDESHA2_SEQ_REPORT_GET_SEQ_STATUS(report, env);
-        SANDESHA2_REPORT_ADD_TO_SEQ_STATUS_MAP(sandesha2_report, env, seq_id, status);
+        status = sandesha2_seq_report_get_seq_status(report, env);
+        sandesha2_report_add_to_seq_status_map(sandesha2_report, env, seq_id, status);
     }
     size = 0;
 	/* incoming sequences */
@@ -504,20 +504,20 @@
             axis2_array_list_get(svr_completed_msgs_beans, env, i);
         seq_id = sandesha2_seq_property_bean_get_seq_id(svr_completed_msgs_bean, 
             env);
-        SANDESHA2_REPORT_ADD_TO_INCOMING_SEQ_LIST(sandesha2_report, env, seq_id);
+        sandesha2_report_add_to_incoming_seq_list(sandesha2_report, env, seq_id);
         value = sandesha2_seq_property_bean_get_value(svr_completed_msgs_bean, 
             env);
         seq_report = sandesha2_client_get_incoming_seq_report(env, value, 
             conf_ctx);
         if(seq_report)
-            completed_msgs = SANDESHA2_SEQ_REPORT_GET_COMPLETED_MSGS(seq_report, 
+            completed_msgs = sandesha2_seq_report_get_completed_msgs(seq_report, 
                 env);
         if(completed_msgs)
             no_of_msgs = axis2_array_list_size(completed_msgs, env);
-        SANDESHA2_REPORT_ADD_TO_NO_OF_COMPLETED_MSGS_MAP(sandesha2_report, env, 
+        sandesha2_report_add_to_no_of_completed_msgs_map(sandesha2_report, env, 
             seq_id, no_of_msgs);
-        status = SANDESHA2_SEQ_REPORT_GET_SEQ_STATUS(seq_report, env);
-        SANDESHA2_REPORT_ADD_TO_SEQ_STATUS_MAP(sandesha2_report, env, seq_id, status);
+        status = sandesha2_seq_report_get_seq_status(seq_report, env);
+        sandesha2_report_add_to_seq_status_map(sandesha2_report, env, seq_id, status);
     }
     if (AXIS2_TRUE != within_transaction && AXIS2_TRUE != rolled_back && 
         report_transaction != NULL && commit) 
@@ -918,7 +918,7 @@
         int status = -1;
 
         seq_report = sandesha2_client_get_outgoing_seq_report_with_svc_client(env, svc_client);
-        status = SANDESHA2_SEQ_REPORT_GET_SEQ_STATUS(seq_report, env);
+        status = sandesha2_seq_report_get_seq_status(seq_report, env);
         if(status == SANDESHA2_SEQ_STATUS_TERMINATED)
             done = AXIS2_TRUE;
         if(status == SANDESHA2_SEQ_STATUS_TIMED_OUT)
@@ -1020,7 +1020,7 @@
                 AXIS2_FAILURE);
         return NULL;
     }
-    status = SANDESHA2_SEQ_REPORT_GET_SEQ_STATUS(seq_report, env);
+    status = sandesha2_seq_report_get_seq_status(seq_report, env);
     if(status != SANDESHA2_SEQ_STATUS_ESTABLISHED)
     {
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_SEQ_NOT_IN_ACTIVE_STATE, AXIS2_FAILURE);
@@ -1121,7 +1121,7 @@
                 AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
-    status = SANDESHA2_SEQ_REPORT_GET_SEQ_STATUS(seq_report, env);
+    status = sandesha2_seq_report_get_seq_status(seq_report, env);
     if(status != SANDESHA2_SEQ_STATUS_ESTABLISHED)
     {
         AXIS2_ERROR_SET(env->error, 
@@ -1262,7 +1262,7 @@
                 AXIS2_FAILURE);
         return NULL;
     }
-    status = SANDESHA2_SEQ_REPORT_GET_SEQ_STATUS(seq_report, env);
+    status = sandesha2_seq_report_get_seq_status(seq_report, env);
     if(status != SANDESHA2_SEQ_STATUS_ESTABLISHED)
     {
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_SEQ_NOT_IN_ACTIVE_STATE, AXIS2_FAILURE);
@@ -1441,7 +1441,7 @@
         AXIS2_ERROR_SET(env->error, NOT_A_VALID_TERMINATED_SEQ, AXIS2_FAILURE); 
         return AXIS2_FAILURE;
     }
-    SANDESHA2_SEQ_REPORT_SET_SEQ_STATUS(report, env, 
+    sandesha2_seq_report_set_seq_status(report, env, 
             SANDESHA2_SEQ_STATUS_TERMINATED);
     out_seq_id = sandesha2_seq_property_bean_get_seq_id(internal_seq_bean, env);
     sandesha2_client_fill_outgoing_seq_info(env, report, out_seq_id, seq_prop_mgr);
@@ -1479,7 +1479,7 @@
         AXIS2_ERROR_SET(env->error, NOT_A_VALID_TERMINATED_SEQ, AXIS2_FAILURE); 
         return AXIS2_FAILURE;
     }
-    SANDESHA2_SEQ_REPORT_SET_SEQ_STATUS(report, env, 
+    sandesha2_seq_report_set_seq_status(report, env, 
             SANDESHA2_SEQ_STATUS_TIMED_OUT);
     out_seq_id = sandesha2_seq_property_bean_get_seq_id(internal_seq_bean, env);
     sandesha2_client_fill_outgoing_seq_info(env, report, out_seq_id, seq_prop_mgr);
@@ -1496,7 +1496,7 @@
     axis2_array_list_t *completed_msg_list = NULL;
     int i = 0, size = 0;
     
-    SANDESHA2_SEQ_REPORT_SET_SEQ_ID(report, env, out_seq_id);
+    sandesha2_seq_report_set_seq_id(report, env, out_seq_id);
     completed_msg_list = sandesha2_ack_mgr_get_client_completed_msgs_list(env,
             out_seq_id, seq_prop_mgr);
     if(completed_msg_list)
@@ -1507,7 +1507,7 @@
         long *lng = AXIS2_MALLOC(env->allocator, sizeof(long));
         value =  axis2_array_list_get(completed_msg_list, env, i);
         *lng = atol(value);
-        SANDESHA2_SEQ_REPORT_ADD_COMPLETED_MSG(report, env, lng);
+        sandesha2_seq_report_add_completed_msg(report, env, lng);
     }
     return AXIS2_SUCCESS; 
 }
@@ -1618,15 +1618,15 @@
         axis2_char_t *value = axis2_array_list_get(completed_msg_list, env, i);
         
         *lng = atol(value);
-        SANDESHA2_SEQ_REPORT_ADD_COMPLETED_MSG(seq_report, env, lng);
+        sandesha2_seq_report_add_completed_msg(seq_report, env, lng);
     }
-    SANDESHA2_SEQ_REPORT_SET_SEQ_ID(seq_report, env, seq_id);
-    SANDESHA2_SEQ_REPORT_SET_INTERNAL_SEQ_ID(seq_report, env, seq_id); /* For
+    sandesha2_seq_report_set_seq_id(seq_report, env, seq_id);
+    sandesha2_seq_report_set_internal_seq_id(seq_report, env, seq_id); /* For
         incoming side internal_seq_id = seq_id*/
-    SANDESHA2_SEQ_REPORT_SET_SEQ_DIRECTION(seq_report, env, 
+    sandesha2_seq_report_set_seq_direction(seq_report, env, 
         SANDESHA2_SEQ_DIRECTION_IN);
     status = sandesha2_client_get_svr_seq_status(env, seq_id, storage_mgr);
-    SANDESHA2_SEQ_REPORT_SET_SEQ_STATUS(seq_report, env, 
+    sandesha2_seq_report_set_seq_status(seq_report, env, 
         status);
     if(commit)
         sandesha2_transaction_commit(report_transaction, env);
@@ -1682,7 +1682,7 @@
                 AXIS2_FAILURE);
         return NULL;
     }
-    status = SANDESHA2_SEQ_REPORT_GET_SEQ_STATUS(seq_report, env);
+    status = sandesha2_seq_report_get_seq_status(seq_report, env);
     if(status != SANDESHA2_SEQ_STATUS_ESTABLISHED)
     {
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_SEQ_NOT_IN_ACTIVE_STATE, 

Modified: webservices/sandesha/trunk/c/src/client/report.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/client/report.c?view=diff&rev=515923&r1=515922&r2=515923
==============================================================================
--- webservices/sandesha/trunk/c/src/client/report.c (original)
+++ webservices/sandesha/trunk/c/src/client/report.c Wed Mar  7 20:40:54 2007
@@ -18,16 +18,13 @@
 #include <sandesha2_seq_report.h>
 #include <axis2_log.h>
 
-typedef struct sandesha2_report_impl sandesha2_report_impl_t;
 
 /** 
  * @brief Sandesha Sequence Report Struct Impl
  *   Sandesha Sequence Report 
  */ 
-struct sandesha2_report_impl
+struct sandesha2_report
 {
-    sandesha2_report_t report;
-
     axis2_array_list_t *incoming_seq_list;
     axis2_array_list_t *outgoing_seq_list;
     axis2_hash_t *seq_status_map;
@@ -35,187 +32,87 @@
     axis2_hash_t *outgoing_internal_seq_id_map;
 };
 
-#define SANDESHA2_INTF_TO_IMPL(report) ((sandesha2_report_impl_t *) report)
-
-axis2_status_t AXIS2_CALL 
-sandesha2_report_free(
-        void *report,
-        const axis2_env_t *envv);
-
-long AXIS2_CALL
-sandesha2_report_get_completed_msgs_count(
-        sandesha2_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t *seq_id);
-
-axis2_array_list_t *AXIS2_CALL
-sandesha2_report_get_incoming_seq_list(
-        sandesha2_report_t *report,
-        const axis2_env_t *env);
-
-axis2_array_list_t *AXIS2_CALL
-sandesha2_report_get_outgoing_seq_list(
-        sandesha2_report_t *report,
-        const axis2_env_t *env);
-
-axis2_char_t AXIS2_CALL
-sandesha2_report_get_seq_status_map(
-        sandesha2_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t *seq_id);
-
-axis2_status_t AXIS2_CALL
-sandesha2_report_add_to_incoming_seq_list(
-        sandesha2_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t *incoming_seq_id);
-
-axis2_status_t AXIS2_CALL
-sandesha2_report_add_to_outgoing_seq_list(
-        sandesha2_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t *out_seq_id);
-
-axis2_status_t AXIS2_CALL
-sandesha2_report_add_to_no_of_completed_msgs_map(
-    sandesha2_report_t *report,
-    const axis2_env_t *env,
-    axis2_char_t *id,
-    long no_of_msgs);
-	
-axis2_status_t AXIS2_CALL
-sandesha2_report_add_to_seq_status_map(
-        sandesha2_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t *id,
-        axis2_char_t status);
-
-axis2_char_t *AXIS2_CALL
-sandesha2_report_get_internal_seq_id_of_out_seq(
-        sandesha2_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t *out_seq_id);
-
-axis2_status_t AXIS2_CALL
-sandesha2_report_add_to_outgoing_internal_seq_map(
-        sandesha2_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t *out_seq_id,
-        axis2_char_t *internal_seq_id);
+#define SANDESHA2_INTF_TO_IMPL(report) ((sandesha2_report_t *) report)
 
 AXIS2_EXTERN sandesha2_report_t * AXIS2_CALL
 sandesha2_report_create(
-        const axis2_env_t *env)
+    const axis2_env_t *env)
 {
-    sandesha2_report_impl_t *report_impl = NULL;
-    
+    sandesha2_report_t *report = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    report_impl = AXIS2_MALLOC(env->allocator, 
-                    sizeof(sandesha2_report_impl_t));
+    report = AXIS2_MALLOC(env->allocator, 
+        sizeof(sandesha2_report_t));
 
-    report_impl->incoming_seq_list = NULL;
-    report_impl->outgoing_seq_list = NULL;
-    report_impl->seq_status_map = NULL;
-    report_impl->no_of_completed_msgs_map = NULL;
-    report_impl->outgoing_internal_seq_id_map = NULL;
-
-    report_impl->report.ops = AXIS2_MALLOC(env->allocator, 
-                    sizeof(sandesha2_report_ops_t)); 
-    
-    report_impl->incoming_seq_list = axis2_array_list_create(env, 0);
-    report_impl->outgoing_seq_list = axis2_array_list_create(env, 0);
-    if(!report_impl->incoming_seq_list ||
-       !report_impl->outgoing_seq_list) 
+    report->incoming_seq_list = NULL;
+    report->outgoing_seq_list = NULL;
+    report->seq_status_map = NULL;
+    report->no_of_completed_msgs_map = NULL;
+    report->outgoing_internal_seq_id_map = NULL;
+
+    report->incoming_seq_list = axis2_array_list_create(env, 0);
+    report->outgoing_seq_list = axis2_array_list_create(env, 0);
+    if(!report->incoming_seq_list ||
+       !report->outgoing_seq_list) 
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
-    report_impl->seq_status_map = axis2_hash_make(env);
-    report_impl->no_of_completed_msgs_map = axis2_hash_make(env);
-    report_impl->outgoing_internal_seq_id_map = axis2_hash_make(env);
-    if(!report_impl->seq_status_map ||
-        !report_impl->no_of_completed_msgs_map ||
-        !report_impl->outgoing_internal_seq_id_map) 
+    report->seq_status_map = axis2_hash_make(env);
+    report->no_of_completed_msgs_map = axis2_hash_make(env);
+    report->outgoing_internal_seq_id_map = axis2_hash_make(env);
+    if(!report->seq_status_map ||
+        !report->no_of_completed_msgs_map ||
+        !report->outgoing_internal_seq_id_map) 
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
 
-    report_impl->report.ops->free = sandesha2_report_free;
-    report_impl->report.ops->get_completed_msgs_count = 
-        sandesha2_report_get_completed_msgs_count;
-    report_impl->report.ops->get_incoming_seq_list = 
-        sandesha2_report_get_incoming_seq_list;
-    report_impl->report.ops->get_outgoing_seq_list = 
-        sandesha2_report_get_outgoing_seq_list;
-    report_impl->report.ops->get_seq_status_map = 
-        sandesha2_report_get_seq_status_map;
-    report_impl->report.ops->add_to_incoming_seq_list = 
-        sandesha2_report_add_to_incoming_seq_list;
-    report_impl->report.ops->add_to_outgoing_seq_list = 
-        sandesha2_report_add_to_outgoing_seq_list;
-    report_impl->report.ops->add_to_no_of_completed_msgs_map = 
-        sandesha2_report_add_to_no_of_completed_msgs_map;
-    report_impl->report.ops->add_to_seq_status_map = 
-        sandesha2_report_add_to_seq_status_map;
-    report_impl->report.ops->get_internal_seq_id_of_out_seq = 
-        sandesha2_report_get_internal_seq_id_of_out_seq;
-    report_impl->report.ops->add_to_outgoing_internal_seq_map = 
-        sandesha2_report_add_to_outgoing_internal_seq_map;
-
-    return &(report_impl->report);
+    return report;
 }
 
 axis2_status_t AXIS2_CALL
 sandesha2_report_free(
-        void *report,
-        const axis2_env_t *env)
+    void *rep,
+    const axis2_env_t *env)
 {
-    sandesha2_report_impl_t *report_impl = NULL;
-
+    sandesha2_report_t *report = (sandesha2_report_t *) rep;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    report_impl = SANDESHA2_INTF_TO_IMPL(report);
 
-    if(report_impl->incoming_seq_list)
+    if(report->incoming_seq_list)
     {
-        axis2_array_list_free(report_impl->incoming_seq_list, env);
-        report_impl->incoming_seq_list = NULL;
+        axis2_array_list_free(report->incoming_seq_list, env);
+        report->incoming_seq_list = NULL;
     }
 
-    if(report_impl->outgoing_seq_list)
+    if(report->outgoing_seq_list)
     {
-        axis2_array_list_free(report_impl->outgoing_seq_list, env);
-        report_impl->outgoing_seq_list = NULL;
+        axis2_array_list_free(report->outgoing_seq_list, env);
+        report->outgoing_seq_list = NULL;
     }
 
-    if(report_impl->seq_status_map)
+    if(report->seq_status_map)
     {
-        axis2_hash_free(report_impl->seq_status_map, env);
-        report_impl->seq_status_map = NULL;
+        axis2_hash_free(report->seq_status_map, env);
+        report->seq_status_map = NULL;
     }
 
-    if(report_impl->no_of_completed_msgs_map)
+    if(report->no_of_completed_msgs_map)
     {
-        axis2_hash_free(report_impl->no_of_completed_msgs_map, env);
-        report_impl->no_of_completed_msgs_map = NULL;
+        axis2_hash_free(report->no_of_completed_msgs_map, env);
+        report->no_of_completed_msgs_map = NULL;
     }
 
-    if(report_impl->outgoing_internal_seq_id_map)
+    if(report->outgoing_internal_seq_id_map)
     {
-        axis2_hash_free(report_impl->outgoing_internal_seq_id_map, env);
-        report_impl->outgoing_internal_seq_id_map = NULL;
+        axis2_hash_free(report->outgoing_internal_seq_id_map, env);
+        report->outgoing_internal_seq_id_map = NULL;
     }
     
-    if((&(report_impl->report))->ops)
-    {
-        AXIS2_FREE(env->allocator, (&(report_impl->report))->ops);
-        (&(report_impl->report))->ops = NULL;
-    }
-
-    if(report_impl)
+    if(report)
     {
-        AXIS2_FREE(env->allocator, report_impl);
-        report_impl = NULL;
+        AXIS2_FREE(env->allocator, report);
+        report = NULL;
     }
     return AXIS2_SUCCESS;
 }
@@ -226,13 +123,10 @@
     const axis2_env_t *env,
     axis2_char_t *seq_id)
 {
-    sandesha2_report_impl_t *report_impl = NULL;
     long *lng = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    report_impl = SANDESHA2_INTF_TO_IMPL(report);
 
-    lng = (long *)axis2_hash_get(report_impl->no_of_completed_msgs_map, seq_id, 
+    lng = (long *)axis2_hash_get(report->no_of_completed_msgs_map, seq_id, 
         AXIS2_HASH_KEY_STRING);
     if(!lng)
     {
@@ -243,43 +137,33 @@
 
 axis2_array_list_t *AXIS2_CALL
 sandesha2_report_get_incoming_seq_list(
-        sandesha2_report_t *report,
-        const axis2_env_t *env)
+    sandesha2_report_t *report,
+    const axis2_env_t *env)
 {
-    sandesha2_report_impl_t *report_impl = NULL;
-
     AXIS2_ENV_CHECK(env, NULL);
-    report_impl = SANDESHA2_INTF_TO_IMPL(report);
-    return report_impl->incoming_seq_list;
+    return report->incoming_seq_list;
 }
 
 axis2_array_list_t *AXIS2_CALL
 sandesha2_report_get_outgoing_seq_list(
-        sandesha2_report_t *report,
-        const axis2_env_t *env)
+    sandesha2_report_t *report,
+    const axis2_env_t *env)
 {
-    sandesha2_report_impl_t *report_impl = NULL;
-
     AXIS2_ENV_CHECK(env, NULL);
-    report_impl = SANDESHA2_INTF_TO_IMPL(report);
-    return report_impl->outgoing_seq_list;
+    return report->outgoing_seq_list;
 }
 
 axis2_char_t AXIS2_CALL
 sandesha2_report_get_seq_status_map(
-        sandesha2_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t *seq_id)
+    sandesha2_report_t *report,
+    const axis2_env_t *env,
+    axis2_char_t *seq_id)
 {
-    sandesha2_report_impl_t *report_impl = NULL;
     axis2_char_t *status = NULL;
-    
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    report_impl = SANDESHA2_INTF_TO_IMPL(report);
 
-    status = (axis2_char_t *) axis2_hash_get(report_impl->seq_status_map, 
-            seq_id, AXIS2_HASH_KEY_STRING);
+    status = (axis2_char_t *) axis2_hash_get(report->seq_status_map, 
+        seq_id, AXIS2_HASH_KEY_STRING);
     if(!status)
         return SANDESHA2_SEQ_STATUS_UNKNOWN;
     return *status;
@@ -287,31 +171,23 @@
 
 axis2_status_t AXIS2_CALL
 sandesha2_report_add_to_incoming_seq_list(
-        sandesha2_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t *incoming_seq_id)
+    sandesha2_report_t *report,
+    const axis2_env_t *env,
+    axis2_char_t *incoming_seq_id)
 {
-    sandesha2_report_impl_t *report_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    report_impl = SANDESHA2_INTF_TO_IMPL(report);
-
-    axis2_array_list_add(report_impl->incoming_seq_list, env, incoming_seq_id);
+    axis2_array_list_add(report->incoming_seq_list, env, incoming_seq_id);
     return AXIS2_SUCCESS;
 }
 
 axis2_status_t AXIS2_CALL
 sandesha2_report_add_to_outgoing_seq_list(
-        sandesha2_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t *out_seq_id)
+    sandesha2_report_t *report,
+    const axis2_env_t *env,
+    axis2_char_t *out_seq_id)
 {
-    sandesha2_report_impl_t *report_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    report_impl = SANDESHA2_INTF_TO_IMPL(report);
-
-    axis2_array_list_add(report_impl->outgoing_seq_list, env, out_seq_id);
+    axis2_array_list_add(report->outgoing_seq_list, env, out_seq_id);
     return AXIS2_SUCCESS;
 }
 
@@ -322,64 +198,49 @@
     axis2_char_t *id,
     long no_of_msgs)
 {
-    sandesha2_report_impl_t *report_impl = NULL;
     long *no_of_msgs_l = AXIS2_MALLOC(env->allocator, sizeof(long));
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    report_impl = SANDESHA2_INTF_TO_IMPL(report);
-
     *no_of_msgs_l = no_of_msgs;
-    axis2_hash_set(report_impl->no_of_completed_msgs_map, id, 
+    axis2_hash_set(report->no_of_completed_msgs_map, id, 
         AXIS2_HASH_KEY_STRING, no_of_msgs_l);
     return AXIS2_SUCCESS;
 }
 	
 axis2_status_t AXIS2_CALL
 sandesha2_report_add_to_seq_status_map(
-        sandesha2_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t *id,
-        axis2_char_t status)
+    sandesha2_report_t *report,
+    const axis2_env_t *env,
+    axis2_char_t *id,
+    axis2_char_t status)
 {
-    sandesha2_report_impl_t *report_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    report_impl = SANDESHA2_INTF_TO_IMPL(report);
-
-    axis2_hash_set(report_impl->seq_status_map, id, 
-            AXIS2_HASH_KEY_STRING, &status);
+    axis2_hash_set(report->seq_status_map, id, 
+        AXIS2_HASH_KEY_STRING, &status);
     return AXIS2_SUCCESS;
 }
 
 axis2_char_t *AXIS2_CALL
 sandesha2_report_get_internal_seq_id_of_out_seq(
-        sandesha2_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t *out_seq_id)
+    sandesha2_report_t *report,
+    const axis2_env_t *env,
+    axis2_char_t *out_seq_id)
 {
-    sandesha2_report_impl_t *report_impl = NULL;
-
     AXIS2_ENV_CHECK(env, NULL);
-    report_impl = SANDESHA2_INTF_TO_IMPL(report);
     return (axis2_char_t *) axis2_hash_get(
-            report_impl->outgoing_internal_seq_id_map, out_seq_id, 
-            AXIS2_HASH_KEY_STRING);
+        report->outgoing_internal_seq_id_map, out_seq_id, 
+        AXIS2_HASH_KEY_STRING);
 }
 
 axis2_status_t AXIS2_CALL
 sandesha2_report_add_to_outgoing_internal_seq_map(
-        sandesha2_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t *out_seq_id,
-        axis2_char_t *internal_seq_id)
+    sandesha2_report_t *report,
+    const axis2_env_t *env,
+    axis2_char_t *out_seq_id,
+    axis2_char_t *internal_seq_id)
 {
-    sandesha2_report_impl_t *report_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    report_impl = SANDESHA2_INTF_TO_IMPL(report);
-
-    axis2_hash_set(report_impl->outgoing_internal_seq_id_map, out_seq_id, 
-            AXIS2_HASH_KEY_STRING, internal_seq_id);
+    axis2_hash_set(report->outgoing_internal_seq_id_map, out_seq_id, 
+        AXIS2_HASH_KEY_STRING, internal_seq_id);
     return AXIS2_SUCCESS;
 }
 	

Modified: webservices/sandesha/trunk/c/src/client/sequence_report.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/client/sequence_report.c?view=diff&rev=515923&r1=515922&r2=515923
==============================================================================
--- webservices/sandesha/trunk/c/src/client/sequence_report.c (original)
+++ webservices/sandesha/trunk/c/src/client/sequence_report.c Wed Mar  7 20:40:54 2007
@@ -17,16 +17,12 @@
 #include <sandesha2_seq_report.h>
 #include <axis2_log.h>
 
-typedef struct sandesha2_seq_report_impl sandesha2_seq_report_impl_t;
-
 /** 
  * @brief Sandesha Sequence Report Struct Impl
  *   Sandesha Sequence Report 
  */ 
-struct sandesha2_seq_report_impl
+struct sandesha2_seq_report
 {
-    sandesha2_seq_report_t report;
-
     axis2_char_t seq_status;
 	axis2_char_t seq_direction;
 	axis2_char_t *seq_id;
@@ -34,258 +30,129 @@
 	axis2_array_list_t *completed_msgs; /* no of messages acked (both for incoming and outgoing)*/
 };
 
-#define SANDESHA2_INTF_TO_IMPL(report) ((sandesha2_seq_report_impl_t *) report)
-
-axis2_status_t AXIS2_CALL 
-sandesha2_seq_report_free(
-        void *report,
-        const axis2_env_t *envv);
-
-axis2_status_t AXIS2_CALL
-sandesha2_seq_report_set_seq_status(
-        sandesha2_seq_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t seq_status);
-
-axis2_status_t AXIS2_CALL
-sandesha2_seq_report_set_seq_direction(
-        sandesha2_seq_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t seq_direction);
-
-axis2_char_t AXIS2_CALL
-sandesha2_seq_report_get_seq_status(
-        sandesha2_seq_report_t *report,
-        const axis2_env_t *env);
-
-axis2_char_t AXIS2_CALL
-sandesha2_seq_report_get_seq_direction(
-        sandesha2_seq_report_t *report,
-        const axis2_env_t *env);
-
-axis2_char_t *AXIS2_CALL
-sandesha2_seq_report_get_seq_id(
-        sandesha2_seq_report_t *report,
-        const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-sandesha2_seq_report_set_seq_id(
-        sandesha2_seq_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t *seq_id);
-
-axis2_array_list_t *AXIS2_CALL
-sandesha2_seq_report_get_completed_msgs(
-        sandesha2_seq_report_t *report,
-        const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-sandesha2_seq_report_add_completed_msg(
-        sandesha2_seq_report_t *report,
-        const axis2_env_t *env,
-        long *msg_no);
-
-axis2_status_t AXIS2_CALL
-sandesha2_seq_report_set_completed_msgs(
-        sandesha2_seq_report_t *report,
-        const axis2_env_t *env,
-        axis2_array_list_t *completed_msgs);
-
-axis2_char_t *AXIS2_CALL
-sandesha2_seq_report_get_internal_seq_id(
-        sandesha2_seq_report_t *report,
-        const axis2_env_t *env,
-        long *msg_no);
-
-axis2_status_t AXIS2_CALL
-sandesha2_seq_report_set_internal_seq_id(
-        sandesha2_seq_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t *internal_seq_id);
-
 AXIS2_EXTERN sandesha2_seq_report_t * AXIS2_CALL
 sandesha2_seq_report_create(
-        const axis2_env_t *env)
+    const axis2_env_t *env)
 {
-    sandesha2_seq_report_impl_t *report_impl = NULL;
-    
+    sandesha2_seq_report_t *report = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    report_impl = AXIS2_MALLOC(env->allocator, 
-                    sizeof(sandesha2_seq_report_impl_t));
+    report = AXIS2_MALLOC(env->allocator, 
+        sizeof(sandesha2_seq_report_t));
 
-    report_impl->seq_status = SANDESHA2_SEQ_STATUS_UNKNOWN;
-    report_impl->seq_direction = SANDESHA2_SEQ_DIRECTION_UNKNOWN;
-    report_impl->completed_msgs = NULL;
-    report_impl->internal_seq_id = NULL;
-    report_impl->seq_id = NULL;
+    report->seq_status = SANDESHA2_SEQ_STATUS_UNKNOWN;
+    report->seq_direction = SANDESHA2_SEQ_DIRECTION_UNKNOWN;
+    report->completed_msgs = NULL;
+    report->internal_seq_id = NULL;
+    report->seq_id = NULL;
 
-    report_impl->report.ops = AXIS2_MALLOC(env->allocator, 
-                    sizeof(sandesha2_seq_report_ops_t)); 
-    
-    report_impl->completed_msgs = axis2_array_list_create(env, 0);
-    if(!report_impl->completed_msgs) 
+    report->completed_msgs = axis2_array_list_create(env, 0);
+    if(!report->completed_msgs) 
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
-    report_impl->report.ops->free = sandesha2_seq_report_free;
-    report_impl->report.ops->set_seq_status = 
-        sandesha2_seq_report_set_seq_status;
-    report_impl->report.ops->set_seq_direction = 
-        sandesha2_seq_report_set_seq_direction;
-    report_impl->report.ops->get_seq_status = 
-        sandesha2_seq_report_get_seq_status;
-    report_impl->report.ops->get_seq_direction = 
-        sandesha2_seq_report_get_seq_direction;
-    report_impl->report.ops->get_seq_id = 
-        sandesha2_seq_report_get_seq_id;
-    report_impl->report.ops->set_seq_id = 
-        sandesha2_seq_report_set_seq_id;
-    report_impl->report.ops->get_completed_msgs = 
-        sandesha2_seq_report_get_completed_msgs;
-    report_impl->report.ops->add_completed_msg = 
-        sandesha2_seq_report_add_completed_msg;
-    report_impl->report.ops->set_completed_msgs = 
-        sandesha2_seq_report_set_completed_msgs;
-    report_impl->report.ops->get_internal_seq_id = 
-        sandesha2_seq_report_get_internal_seq_id;
-    report_impl->report.ops->set_internal_seq_id = 
-        sandesha2_seq_report_set_internal_seq_id;
-
-    return &(report_impl->report);
+    return report;
 }
 
 axis2_status_t AXIS2_CALL
 sandesha2_seq_report_free(
-        void *report,
-        const axis2_env_t *env)
+    void *seq_report,
+    const axis2_env_t *env)
 {
-    sandesha2_seq_report_impl_t *report_impl = NULL;
-
+    sandesha2_seq_report_t *report = (sandesha2_seq_report_t *)seq_report;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    report_impl = SANDESHA2_INTF_TO_IMPL(report);
-
-    if(report_impl->completed_msgs)
+    if(report->completed_msgs)
     {
-        axis2_array_list_free(report_impl->completed_msgs, env);
-        report_impl->completed_msgs = NULL;
+        axis2_array_list_free(report->completed_msgs, env);
+        report->completed_msgs = NULL;
     }
 
-    if(report_impl->seq_id)
+    if(report->seq_id)
     {
-        AXIS2_FREE(env->allocator, report_impl->seq_id);
-        report_impl->seq_id = NULL;
+        AXIS2_FREE(env->allocator, report->seq_id);
+        report->seq_id = NULL;
     }
     
-    if((&(report_impl->report))->ops)
-    {
-        AXIS2_FREE(env->allocator, (&(report_impl->report))->ops);
-        (&(report_impl->report))->ops = NULL;
-    }
-
-    if(report_impl)
+    if(report)
     {
-        AXIS2_FREE(env->allocator, report_impl);
-        report_impl = NULL;
+        AXIS2_FREE(env->allocator, report);
+        report = NULL;
     }
     return AXIS2_SUCCESS;
 }
 
 axis2_status_t AXIS2_CALL
 sandesha2_seq_report_set_seq_status(
-        sandesha2_seq_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t seq_status)
+    sandesha2_seq_report_t *report,
+    const axis2_env_t *env,
+    axis2_char_t seq_status)
 {
-    sandesha2_seq_report_impl_t *report_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    report_impl = SANDESHA2_INTF_TO_IMPL(report);
-
     if (seq_status >= SANDESHA2_SEQ_STATUS_UNKNOWN && 
-            seq_status <= SANDESHA2_MAX_SEQ_STATUS) 
+        seq_status <= SANDESHA2_MAX_SEQ_STATUS) 
     {
-        report_impl->seq_status = seq_status;
+        report->seq_status = seq_status;
     }
     return AXIS2_SUCCESS;
 }
 
 axis2_status_t AXIS2_CALL
 sandesha2_seq_report_set_seq_direction(
-        sandesha2_seq_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t seq_direction)
+    sandesha2_seq_report_t *report,
+    const axis2_env_t *env,
+    axis2_char_t seq_direction)
 {
-    sandesha2_seq_report_impl_t *report_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    report_impl = SANDESHA2_INTF_TO_IMPL(report);
-
     if (seq_direction >= SANDESHA2_SEQ_DIRECTION_UNKNOWN && 
-            seq_direction <= SANDESHA2_MAX_SEQ_DIRECTION) 
+        seq_direction <= SANDESHA2_MAX_SEQ_DIRECTION) 
     {
-        report_impl->seq_direction = seq_direction;
+        report->seq_direction = seq_direction;
     }
     return AXIS2_SUCCESS;
 }
 
 axis2_char_t AXIS2_CALL
 sandesha2_seq_report_get_seq_status(
-        sandesha2_seq_report_t *report,
-        const axis2_env_t *env)
+    sandesha2_seq_report_t *report,
+    const axis2_env_t *env)
 {
-    sandesha2_seq_report_impl_t *report_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    report_impl = SANDESHA2_INTF_TO_IMPL(report);
-
-    return report_impl->seq_status;
+    return report->seq_status;
 }
 
 axis2_char_t AXIS2_CALL
 sandesha2_seq_report_get_seq_direction(
-        sandesha2_seq_report_t *report,
-        const axis2_env_t *env)
+    sandesha2_seq_report_t *report,
+    const axis2_env_t *env)
 {
-    sandesha2_seq_report_impl_t *report_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    report_impl = SANDESHA2_INTF_TO_IMPL(report);
-
-    return report_impl->seq_direction;
+    return report->seq_direction;
 }
 
 axis2_char_t *AXIS2_CALL
 sandesha2_seq_report_get_seq_id(
-        sandesha2_seq_report_t *report,
-        const axis2_env_t *env)
+    sandesha2_seq_report_t *report,
+    const axis2_env_t *env)
 {
-    sandesha2_seq_report_impl_t *report_impl = NULL;
-
     AXIS2_ENV_CHECK(env, NULL);
-    report_impl = SANDESHA2_INTF_TO_IMPL(report);
 
-    return report_impl->seq_id;
+    return report->seq_id;
 }
 
 axis2_status_t AXIS2_CALL
 sandesha2_seq_report_set_seq_id(
-        sandesha2_seq_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t *seq_id)
+    sandesha2_seq_report_t *report,
+    const axis2_env_t *env,
+    axis2_char_t *seq_id)
 {
-    sandesha2_seq_report_impl_t *report_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    report_impl = SANDESHA2_INTF_TO_IMPL(report);
-
-    if(report_impl->seq_id)
+    if(report->seq_id)
     {
-        AXIS2_FREE(env->allocator, report_impl->seq_id);
-        report_impl->seq_id = NULL;
+        AXIS2_FREE(env->allocator, report->seq_id);
+        report->seq_id = NULL;
     }
-    report_impl->seq_id = AXIS2_STRDUP(seq_id, env);
-    if(!report_impl->seq_id)
+    report->seq_id = AXIS2_STRDUP(seq_id, env);
+    if(!report->seq_id)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return AXIS2_FAILURE;
@@ -298,12 +165,9 @@
     sandesha2_seq_report_t *report,
     const axis2_env_t *env)
 {
-    sandesha2_seq_report_impl_t *report_impl = NULL;
-
     AXIS2_ENV_CHECK(env, NULL);
-    report_impl = SANDESHA2_INTF_TO_IMPL(report);
 
-    return report_impl->completed_msgs;
+    return report->completed_msgs;
 }
 
 axis2_status_t AXIS2_CALL
@@ -312,77 +176,64 @@
     const axis2_env_t *env,
     long *msg_no)
 {
-    sandesha2_seq_report_impl_t *report_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    report_impl = SANDESHA2_INTF_TO_IMPL(report);
 
-    axis2_array_list_add(report_impl->completed_msgs, env, msg_no);
+    axis2_array_list_add(report->completed_msgs, env, msg_no);
     return AXIS2_SUCCESS;
 }
 
 axis2_status_t AXIS2_CALL
 sandesha2_seq_report_set_completed_msgs(
-        sandesha2_seq_report_t *report,
-        const axis2_env_t *env,
-        axis2_array_list_t *completed_msgs)
+    sandesha2_seq_report_t *report,
+    const axis2_env_t *env,
+    axis2_array_list_t *completed_msgs)
 {
-    sandesha2_seq_report_impl_t *report_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    report_impl = SANDESHA2_INTF_TO_IMPL(report);
 
-    if(report_impl->completed_msgs)
+    if(report->completed_msgs)
     {
         int i = 0, size = 0;
         
-        size = axis2_array_list_size(report_impl->completed_msgs, env);
+        size = axis2_array_list_size(report->completed_msgs, env);
         for(i = 0; i < size; i++)
         {
             long *msg_no = NULL;
         
-            msg_no = axis2_array_list_get(report_impl->completed_msgs, env, i);
+            msg_no = axis2_array_list_get(report->completed_msgs, env, i);
             AXIS2_FREE(env->allocator, msg_no);
         }
-        axis2_array_list_free(report_impl->completed_msgs, env);
-        report_impl->completed_msgs = NULL;
+        axis2_array_list_free(report->completed_msgs, env);
+        report->completed_msgs = NULL;
     }
-    report_impl->completed_msgs = completed_msgs;
+    report->completed_msgs = completed_msgs;
     return AXIS2_SUCCESS;
 }
 
 axis2_char_t *AXIS2_CALL
 sandesha2_seq_report_get_internal_seq_id(
-        sandesha2_seq_report_t *report,
-        const axis2_env_t *env,
-        long *msg_no)
+    sandesha2_seq_report_t *report,
+    const axis2_env_t *env,
+    long *msg_no)
 {
-    sandesha2_seq_report_impl_t *report_impl = NULL;
-
     AXIS2_ENV_CHECK(env, NULL);
-    report_impl = SANDESHA2_INTF_TO_IMPL(report);
-
-    return report_impl->internal_seq_id;
+    return report->internal_seq_id;
 }
 
 axis2_status_t AXIS2_CALL
 sandesha2_seq_report_set_internal_seq_id(
-        sandesha2_seq_report_t *report,
-        const axis2_env_t *env,
-        axis2_char_t *internal_seq_id)
+    sandesha2_seq_report_t *report,
+    const axis2_env_t *env,
+    axis2_char_t *internal_seq_id)
 {
-    sandesha2_seq_report_impl_t *report_impl = NULL;
-
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    report_impl = SANDESHA2_INTF_TO_IMPL(report);
 
-    if(report_impl->internal_seq_id)
+    if(report->internal_seq_id)
     {
-        AXIS2_FREE(env->allocator, report_impl->internal_seq_id);
-        report_impl->internal_seq_id = NULL;
+        AXIS2_FREE(env->allocator, report->internal_seq_id);
+        report->internal_seq_id = NULL;
     }
-    report_impl->internal_seq_id = AXIS2_STRDUP(internal_seq_id, env);
-    if(!report_impl->internal_seq_id)
+    report->internal_seq_id = AXIS2_STRDUP(internal_seq_id, env);
+    if(!report->internal_seq_id)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return AXIS2_FAILURE;



---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org