00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifndef __SENDER_HPP__
00041 #define __SENDER_HPP__
00042
00043 #include <iostream>
00044 #include <sstream>
00045 #include <boost/thread/thread.hpp>
00046 #include "base64.hpp"
00047 #include "connection.hpp"
00048 #include "tcp.hpp"
00049 #include "param.hpp"
00050 #include "paramip.hpp"
00051 #include "camparam.hpp"
00052
00053
00054
00055 namespace ipsi
00056 {
00057
00059 #define constr mParam->constr
00060
00074 class cmdSender
00075 {
00076 private:
00078 std::string mCmd ;
00080 std::string* mCmdPtr ;
00081
00083 Param* mParam ;
00084
00085 Caminfo* mC;
00086
00088 std::string logpass ;
00089
00091 boost::mutex* mMut ;
00093 bool mRun ;
00094
00095
00096 public:
00107 cmdSender( std::string* cmd ,
00108 Param* param ,
00109 Caminfo* c ,
00110 boost::mutex* mut );
00111
00116 cmdSender( const cmdSender& src );
00117
00121 ~cmdSender( );
00122
00127 void send( );
00128
00143 bool isMess ( std::string s );
00144
00145
00155 bool isError( std::string s );
00156
00157
00163 bool check( );
00164
00168 void operator()( );
00169
00174 void stop( );
00175 };
00176 }
00177 #undef constr
00178 #endif