SockIt

SockItAPI.h

Go to the documentation of this file.
00001 /**********************************************************
00002  Auto-generated SockItAPI.h
00003 
00004  \**********************************************************/
00005 
00006 #ifndef H_SockItAPI
00007 #define H_SockItAPI
00008 
00009 #include <map>
00010 #include <string>
00011 #include <sstream>
00012 #include <vector>
00013 
00014 #include <boost/optional.hpp>
00015 #include <boost/weak_ptr.hpp>
00016 
00017 #include <stdint.h>
00018 
00019 #include "BrowserHost.h"
00020 #include "JSAPIAuto.h"
00021 
00022 #include "SockIt.h"
00023 #include "NetworkThread.h"
00024 
00025 using std::map;
00026 using std::string;
00027 using std::vector;
00028 
00035 class SockItAPI: public FB::JSAPIAuto
00036 {
00037     public:
00038 
00046         SockItAPI(const SockItPtr& plugin, const FB::BrowserHostPtr& host);
00047 
00052         virtual ~SockItAPI();
00053 
00059         SockItPtr getPlugin();
00060 
00066         boost::shared_ptr<NetworkThread> create_thread();
00067 
00075         boost::shared_ptr<TcpServer> create_tcp_server(int port, boost::optional<map<string, string> > options);
00076 
00085         boost::shared_ptr<TcpClient> create_tcp_client(const string & host, int port, 
00086                 boost::optional<map<string, string> > options);
00087 
00095         boost::shared_ptr<UdpServer> create_udp_server(int port, boost::optional<map<string, string> > options);
00096 
00105         boost::shared_ptr<UdpClient> create_udp_client(const string &host, int port,
00106                 boost::optional<map<string, string> > options);
00107 
00113         binary convert_to_binary(const vector<byte> bytes);
00114 
00120         FB::VariantList convert_from_binary(binary data);
00121 
00122     private:
00123 
00127         NetworkThread default_thread;
00128 
00132         SockItWeakPtr m_plugin;
00133 
00137         FB::BrowserHostPtr m_host;
00138 };
00139 
00140 #endif // H_SockItAPI
 All Classes Files Functions Variables Typedefs Friends Defines