Main Page   Class Hierarchy   Compound List   File List   Compound Members  

C_ScenarioStats.hpp

00001 /*
00002  *  This program is free software; you can redistribute it and/or modify
00003  *  it under the terms of the GNU General Public License as published by
00004  *  the Free Software Foundation; either version 2 of the License, or
00005  *  (at your option) any later version.
00006  *
00007  *  This program is distributed in the hope that it will be useful,
00008  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00009  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010  *  GNU General Public License for more details.
00011  *
00012  *  You should have received a copy of the GNU General Public License
00013  *  along with this program; if not, write to the Free Software
00014  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00015  *
00016  * (c)Copyright 2006 Hewlett-Packard Development Company, LP.
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   //  iostream_output& display (iostream_output& P_stream);
00052 
00053   void display_stats_command ();
00054   // void display_stats_command_sub_message ();
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 

Generated on Wed Mar 7 14:44:58 2007 for Seagull by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002