00001 #ifndef _BULKDATA_DISTRIBUTER_CB_H 00002 #define _BULKDATA_DISTRIBUTER_CB_H 00003 00004 #ifndef __cplusplus 00005 #error This is a C++ include file and cannot be used from plain C 00006 #endif 00007 00008 #include "orbsvcs/AV/AVStreams_i.h" 00009 #include "orbsvcs/AV/Endpoint_Strategy.h" 00010 #include "orbsvcs/AV/Protocol_Factory.h" 00011 #include "orbsvcs/AV/Flows_T.h" 00012 #include "orbsvcs/AV/Transport.h" 00013 #include "orbsvcs/AV/Policy.h" 00014 00015 #include <baci.h> 00016 //#include <acsQoS.h> 00017 00018 #include "ACSBulkDataError.h" 00019 00020 #include <iostream> 00021 00022 #include "bulkDataDistributerImpl.h" 00023 00024 class BulkDataDistributerCb : public TAO_AV_Callback 00025 { 00026 00027 public: 00028 00029 enum Cb_State 00030 { 00031 CB_UNS, 00032 CB_SEND_PARAM, 00033 CB_SEND_DATA 00034 }; 00035 00036 enum Cb_SubState 00037 { 00038 CB_SUB_UNS, 00039 CB_SUB_INIT 00040 }; 00041 00042 00043 BulkDataDistributerCb(); 00044 00045 BulkDataDistributerCb(TAO_StreamCtrl * stream_p); 00046 00047 ~BulkDataDistributerCb(); 00048 00049 virtual int handle_start(void); 00050 00051 virtual int handle_stop (void); 00052 00053 virtual int handle_destroy (void); 00054 00055 virtual int receive_frame (ACE_Message_Block *frame, TAO_AV_frame_info *frame_info, const ACE_Addr &); 00056 00057 virtual void setFlowname (const char*); 00058 00059 // The use of setSleepTime is deprecated. It has no effect 00060 // on the waiting time of the handle_stop method 00061 virtual void setSleepTime(ACE_Time_Value locWaitPeriod); 00062 00063 // The use of setSafeTimeout is deprecated. It has no effect 00064 // on the waiting time of the handle_stop method 00065 virtual void setSafeTimeout(CORBA::ULong locLoop); 00066 00067 virtual int cbFwdStart(ACE_Message_Block * userParam_p = 0); 00068 00069 virtual int cbFwdReceive(ACE_Message_Block * frame_p); 00070 00071 virtual int cbFwdStop(); 00072 00073 virtual int cbFwdUserStop(); 00074 00075 virtual int cbHandshake(ACE_Message_Block * frame_p); 00076 00077 virtual void setDistributerImpl(BulkDataDistributerImpl<BulkDataDistributerCb> *distr_p); 00078 00079 virtual CORBA::Boolean isTimeout(); 00080 00081 virtual CORBA::Boolean isWorking(); 00082 00083 ACE_HANDLE getHandle(); 00084 00085 CORBA::Boolean isFepAlive() 00086 { 00087 return isFepAlive_m; 00088 } 00089 00090 // The use of setCbTimeout is deprecated. It has no effect 00091 // on the waiting time of the handle_stop method 00092 virtual void setCbTimeout(ACE_Time_Value cbTimeout); 00093 00094 00095 protected: 00096 00097 ACE_CString flowname_m; 00098 00099 CORBA::ULong flowNumber_m; 00100 00101 private: 00102 00103 BulkDataDistributerImpl<BulkDataDistributerCb> *distr_m; 00104 00105 ACE_Time_Value waitPeriod_m; 00106 00107 CORBA::ULong loop_m; 00108 00109 Cb_State state_m; 00110 Cb_SubState substate_m; 00111 00112 CORBA::Long dim_m; 00113 00114 CORBA::Long count_m; 00115 00116 CORBA::Long frameCount_m; 00117 00118 CORBA::Boolean timeout_m; 00119 00120 CORBA::Boolean working_m; 00121 00122 CORBA::Boolean isFepAlive_m; 00123 }; 00124 00125 00126 #endif