Subversion Repositories HomeAutomation

Rev

Rev 1608 | Rev 1647 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1608 Rev 1625
Line 24... Line 24...
24
#include <string>
24
#include <string>
25
#include <map>
25
#include <map>
26
#include <vector>
26
#include <vector>
27
 
27
 
28
#include <boost/shared_ptr.hpp>
28
#include <boost/shared_ptr.hpp>
-
 
29
#include <boost/asio.hpp>
29
#include <v8-debug.h>
30
#include <v8-debug.h>
30
 
31
 
31
#include "types.h"
32
#include "types.h"
32
 
33
 
33
namespace atom {
34
namespace atom {
Line 36... Line 37...
36
class Plugin
37
class Plugin
37
{
38
{
38
public:
39
public:
39
    typedef boost::shared_ptr<Plugin> Pointer;
40
    typedef boost::shared_ptr<Plugin> Pointer;
40
   
41
   
41
    Plugin();
42
    Plugin(boost::asio::io_service& io_service);
42
    virtual ~Plugin();
43
    virtual ~Plugin();
43
   
44
   
44
    std::string GetName();
45
    std::string GetName();
45
    ExportFunctionList& GetExportFunctions();
46
    ExportFunctionList& GetExportFunctions();
46
   
47
   
Line 50... Line 51...
50
protected:
51
protected:
51
    typedef boost::shared_ptr<char> TrackerPointer;
52
    typedef boost::shared_ptr<char> TrackerPointer;
52
   
53
   
53
    std::string name_;
54
    std::string name_;
54
    TrackerPointer tracker_;
55
    TrackerPointer tracker_;
-
 
56
    boost::asio::io_service& io_service_;
55
   
57
   
56
    void Call(unsigned int request_id, std::string name, ArgumentListPointer arguments);
58
    void Call(unsigned int request_id, std::string name, ArgumentListPointer arguments);
57
    void Execute(unsigned int request_id, std::string code);
59
    void Execute(unsigned int request_id, std::string code);
58
    void ExportFunction(std::string name, v8::InvocationCallback function);
60
    void ExportFunction(std::string name, v8::InvocationCallback function);
59
    static bool ImportFunction(std::string name);
61
    static bool ImportFunction(std::string name);