00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _C_READ_CONTROL_H
00021 #define _C_READ_CONTROL_H
00022
00023 #include "select_t.hpp"
00024
00025 #include "C_TaskControl.hpp"
00026 #include "C_Transport.hpp"
00027 #include "C_CallControl.hpp"
00028 #include "GeneratorXmlData.hpp"
00029 #include "C_ScenarioControl.hpp"
00030 #include "TrafficType.h"
00031 #include "C_GeneratorConfig.hpp"
00032
00033 #include "C_ProtocolFrame.hpp"
00034 #include "C_GeneratorStats.hpp"
00035
00036 #include "C_TransportControl.hpp"
00037 #include "C_ChannelControl.hpp"
00038
00039 #include "gen_operation_t.hpp"
00040
00041 class C_ReadControl : public C_TaskControl {
00042
00043 public:
00044
00045
00046 C_ReadControl(C_ChannelControl *P_channel_ctrl, C_TransportControl *P_transport_ctrl);
00047 ~C_ReadControl();
00048
00049 void set_config (C_GeneratorConfig *P_config);
00050
00051 void set_scenario_control (T_pC_ScenarioControl P_scenControl,
00052 T_TrafficType P_trafficType);
00053
00054 void pause_traffic() ;
00055 void restart_traffic () ;
00056 void force_init () ;
00057 unsigned long get_call_rate();
00058 void change_call_rate(T_GenChangeOperation P_op, unsigned long P_rate);
00059 void change_rate_scale(unsigned long P_scale);
00060 void change_burst (unsigned long P_burst);
00061
00062 void process_event (C_Transport *P_transport, T_pC_TransportEvent P_event);
00063
00064 protected:
00065
00066 private:
00067
00068
00069
00070 T_pC_ScenarioControl m_scen_controller ;
00071 T_pC_CallControl m_call_controller ;
00072 T_TrafficType m_traffic_type ;
00073
00074 C_ChannelControl *m_channel_ctrl ;
00075 C_TransportControl *m_transport_ctrl ;
00076 C_Transport **m_transport_table ;
00077 int m_transport_table_size ;
00078
00079 struct timeval m_select_timeout ;
00080
00081 C_GeneratorStats *m_stat ;
00082 C_GeneratorConfig *m_config ;
00083
00084 size_t m_max_event_nb ;
00085 T_pC_TransportEvent m_events ;
00086
00087 int m_nb_global_channel ;
00088
00089 T_SelectDef m_call_select ;
00090 T_TrafficType m_last_traffic_type ;
00091
00092
00093 T_GeneratorError TaskProcedure();
00094 T_GeneratorError InitProcedure();
00095 T_GeneratorError EndProcedure();
00096 T_GeneratorError StoppingProcedure();
00097 T_GeneratorError ForcedStoppingProcedure();
00098
00099 void endTrafficControl () ;
00100
00101
00102 T_GeneratorError receiveControl () ;
00103
00104
00105 void transport_table () ;
00106 void create_call_controller () ;
00107 void start_call_controller () ;
00108
00109
00110 } ;
00111
00112 typedef C_ReadControl * T_pC_ReadControl ;
00113
00114 #endif // _C_READ_CONTROL_H