00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _C_SCENARIO_STATS_H
00021 #define _C_SCENARIO_STATS_H
00022
00023 #include "iostream_t.hpp"
00024 #include "Utils.hpp"
00025
00026 #include "C_Semaphore.hpp"
00027 #include "C_DisplayObject.hpp"
00028
00029 class C_Scenario;
00030
00031 class C_ScenarioStats : public C_DisplayObject {
00032
00033 public:
00034
00035 C_ScenarioStats(C_Scenario *P_scen) ;
00036 virtual ~C_ScenarioStats();
00037
00038 typedef enum _scenario_stat_data_action {
00039 E_MESSAGE,
00040 E_RETRANS,
00041 E_TIMEOUT,
00042 E_UNEXPECTED,
00043 E_NB_ACTIONS
00044 } T_ScenarioStatDataAction, *T_pScenarioStatDataAction ;
00045
00046
00047 void updateStats (int P_cmd_index,
00048 T_ScenarioStatDataAction P_action,
00049 int P_sub_msg_index);
00050
00051
00052
00053 void display_stats_command ();
00054
00055
00056 void displayScreen() ;
00057 void setCurrentScreen(bool P_first) ;
00058
00059 void reset_cumul_counters () ;
00060
00061
00062 protected:
00063 private:
00064
00065 typedef int T_CounterType, *T_pCounterType ;
00066
00067 class C_CounterData {
00068 public:
00069 T_CounterType m_counter_value ;
00070 C_Semaphore m_sem ;
00071 } ;
00072
00073 typedef struct _command_stat {
00074 char *m_name ;
00075 C_CounterData *m_counters;
00076 } T_CommandStat, *T_pCommandStat ;
00077
00078 typedef C_CounterData *C_pCounterData ;
00079
00080
00081 C_Scenario *m_scenario ;
00082
00083 T_pCommandStat m_counter_cmd_table ;
00084
00085 typedef void (C_ScenarioStats::* T_DisplayScenFct)() ;
00086
00087 int m_current_scen_stat_id ;
00088 int m_nb_stat_scen_id ;
00089 T_DisplayScenFct *m_current_scen_stat_table ;
00090 T_DisplayScenFct m_current_scen_stat_display ;
00091
00092 int m_nb_command ;
00093
00094 } ;
00095
00096 #endif // _C_SCENARIO_STATS_H
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115