Subversion Repositories HomeAutomation

Rev

Rev 1947 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1947 Rev 1959
Line 16... Line 16...
16
 *  with this program; if not, write to the Free Software Foundation, Inc.,
16
 *  with this program; if not, write to the Free Software Foundation, Inc.,
17
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
 *
18
 *
19
 */
19
 */
20
 
20
 
21
#ifndef VM_PLUGIN_MBB_H
21
#ifndef VM_PLUGIN_SERVER_H
22
#define VM_PLUGIN_MBB_H
22
#define VM_PLUGIN_SERVER_H
23
 
23
 
24
#include <boost/shared_ptr.hpp>
24
#include <boost/shared_ptr.hpp>
25
 
25
 
26
#include "net/Subscriber.h"
26
#include "net/Subscriber.h"
27
#include "net/types.h"
27
#include "net/types.h"
Line 31... Line 31...
31
 
31
 
32
namespace atom {
32
namespace atom {
33
namespace vm {
33
namespace vm {
34
namespace plugin {
34
namespace plugin {
35
 
35
 
36
class Mbb : public Plugin
36
class Server : public Plugin
37
{
37
{
38
public:
38
public:
39
    typedef boost::shared_ptr<Mbb> Pointer;
39
    typedef boost::shared_ptr<Server> Pointer;
40
   
40
   
41
    Mbb(boost::asio::io_service& io_service, unsigned int port);
41
    Server(boost::asio::io_service& io_service);
42
    virtual ~Mbb();
42
    virtual ~Server();
43
   
43
   
44
    void InitializeDone();
44
    void InitializeDone();
45
    void CallOutput(unsigned int request_id, std::string output);
45
    void CallOutput(unsigned int request_id, std::string output);
46
   
46
   
47
private:
47
private:
48
    net::ServerId server_id_;
48
    void SlotOnNewState(net::ClientId client_id, net::SocketId server_id, net::ClientState client_state);
49
    static net::ClientId current_client_id_;
49
    void SlotOnNewData(net::ClientId client_id, net::SocketId server_id, common::Byteset data);
50
   
50
   
51
    void SlotOnNewState(net::ClientId client_id, net::ServerId server_id, net::ClientState client_state);
-
 
52
    void SlotOnNewData(net::ClientId client_id, net::ServerId server_id, common::Byteset data);
-
 
53
   
-
 
54
    void SlotOnNewStateHandler(net::ClientId client_id, net::ServerId server_id, net::ClientState client_state);
51
    void SlotOnNewStateHandler(net::ClientId client_id, net::SocketId server_id, net::ClientState client_state);
55
    void SlotOnNewDataHandler(net::ClientId client_id, net::ServerId server_id, common::Byteset data);
52
    void SlotOnNewDataHandler(net::ClientId client_id, net::SocketId server_id, common::Byteset data);
56
   
53
   
57
    static Value Export_SendData(const v8::Arguments& args);
54
    static Value Export_SendData(const v8::Arguments& args);
58
};
55
};
59
 
56
 
60
}; // namespace plugin
57
}; // namespace plugin
61
}; // namespace vm
58
}; // namespace vm
62
}; // namespace atom
59
}; // namespace atom
63
 
60
 
64
#endif // VM_PLUGIN_MBB_H
61
#endif // VM_PLUGIN_SERVER_H