Main Page   Class Hierarchy   Compound List   File List   Compound Members  

C_ReadControl.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_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   // transport context definition
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   // Specific field
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   // TaskController related methods
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   // Internal methods
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

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