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 #ifndef _LIBRSTP_INC_RSTPCLIENTIF_H
00026 #define _LIBRSTP_INC_RSTPCLIENTIF_H
00027
00028 #include <string>
00029 #include <iostream>
00030
00031
00032 #if defined(WIN32) || defined(WIN_NATIVE)
00033 #ifdef LIBRADAR_STP_EXPORTS
00034 #define LIBRADAR_STP_INTERFACE __declspec(dllexport)
00035 #else
00036 #define LIBRADAR_STP_INTERFACE __declspec(dllimport)
00037 #endif
00038 #else
00039 #define LIBRADAR_STP_INTERFACE
00040 #endif
00041
00042
00043 namespace libradar_stp {
00044
00053 class
00054 LIBRADAR_STP_INTERFACE
00055 RSTPClientIf {
00056 public:
00057
00058 RSTPClientIf();
00059 ~RSTPClientIf();
00060
00066 void addStream( const std::string& stream );
00067
00076 void addServer( const std::string& addr, unsigned short port, unsigned int timeout = 1000,
00077 const std::string& login = "", const std::string& pass = "" );
00078
00086 void start();
00087
00094 void quit();
00095
00096 typedef void (*CBFUNC)( void*, const std::string&, const std::string& );
00097 typedef void (*CBFUNC3)( void*, const std::string& );
00098
00106 void setDataCallback( CBFUNC func, void* arg = 0 );
00107
00117 void setErrorCallback( CBFUNC3 func, void* arg = 0 );
00118
00124 bool loadFile( const std::string& filename );
00125
00132 bool readConfig( std::istream& fin, bool have_client_head = false );
00133
00134 private:
00135
00136 CBFUNC m_data_cb;
00137 void* m_data_arg;
00138 CBFUNC3 m_error_cb;
00139 void* m_error_cb_arg;
00140
00141 void* m_red_client;
00142
00143 public:
00144
00145 static void _data_cb( void* arg, const std::string& stream, const std::string& data );
00146 static void _error_cb( void* arg, const std::string& msg );
00147
00148 };
00149
00150
00151 };
00152
00153 #endif
00154
00155
00156