Main Page   Class Hierarchy   Compound List   File List   Compound Members  

C_RemoteControl.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_REMOTECONTROL_H
00021 #define _C_REMOTECONTROL_H
00022 
00023 #include "select_t.hpp"
00024 
00025 #include "C_TaskControl.hpp"
00026 #include "list_t.hpp"
00027 #include "C_TransportControl.hpp"
00028 #include "C_ProtocolFrame.hpp"
00029 #include "C_GeneratorConfig.hpp"
00030 #include "C_ProtocolControl.hpp"
00031 #include "C_ProtocolText.hpp"
00032 #include "C_GeneratorStats.hpp"
00033 
00034 
00035 class C_Generator ;
00036 
00037 
00038 class C_RemoteControl : public C_TaskControl {
00039 
00040  public:
00041 
00042   C_RemoteControl(C_Generator* P_gen,
00043                   C_ProtocolControl* P_protocol_control,
00044                   char* P_address) ;
00045   ~C_RemoteControl() ;
00046   
00047   void  init() ;
00048 
00049 private :
00050 
00051   C_Generator         *m_gen ;
00052 
00053   C_Transport         *m_transport ;
00054   size_t               m_max_event_nb ;
00055   struct timeval       m_select_timeout ;
00056   C_GeneratorConfig   *m_config ;
00057   T_SelectDef          m_call_select ;
00058   T_pC_TransportEvent  m_events ;
00059   C_ProtocolControl   *m_protocol_ctrl  ;
00060   C_ProtocolFrame     *m_protocol_frame ;
00061   C_ProtocolText      *m_protocol_text  ;
00062 
00063   T_pRcvMsgCtxtList    m_msg_remote_list ;
00064   char                *m_address ;
00065 
00066   C_GeneratorStats    *m_stat ;
00067 
00068   int                  m_command_id, m_uri_id ;
00069 
00070 
00071 
00072 
00073   T_GeneratorError TaskProcedure () ;
00074   T_GeneratorError InitProcedure () ;
00075   T_GeneratorError EndProcedure () ;
00076   T_GeneratorError StoppingProcedure () ;
00077   T_GeneratorError ForcedStoppingProcedure () ;
00078 
00079   T_GeneratorError receiveControl () ;
00080   void             messageReceivedControl () ;
00081 
00082   char* execute_command(char *P_cmd, char *P_uri, char **P_result_data);
00083   char* decode_put_uri(char *P_uri);
00084   char* decode_get_uri(char *P_uri, char **P_result_data);
00085 
00086   char* decode_uri(char *P_uri);
00087 
00088   char* find_directory(char *P_buf,char *P_dir) ;
00089   char* find_file(char *P_buf,char *P_dir) ;
00090   char* find_value(char *P_buf,char *P_dir) ;
00091 
00092   void rate(unsigned long P_value);
00093   void ramp(unsigned long P_value, unsigned long P_duration);
00094   char* dump_stat();
00095 
00096   void quit();
00097   void pause();
00098   void resume();
00099 
00100   char* resultOK();
00101   char* resultKO();
00102 
00103   void createRampThread(unsigned long P_duration,
00104                         unsigned long P_current_rate,
00105                         unsigned long P_sub_rate,
00106                         bool          P_increase);
00107 
00108   C_MessageFrame* analyze_command(C_MessageFrame *P_msg) ;
00109   
00110 } ;
00111 
00112 #endif // _C_REMOTECONTROL_H
00113 
00114 
00115 
00116 
00117 
00118 

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