Sirikata
liboh/plugins/js/JSObjects/JSInvokableObject.hpp
Go to the documentation of this file.
00001 #ifndef __JS_SIMULATION_OBJECT__
00002 #define __JS_SIMULATION_OBJECT__
00003 
00004 #include <sirikata/oh/Platform.hpp>
00005 
00006 #include <vector>
00007 #include <v8.h>
00008 #include <sirikata/proxyobject/Invokable.hpp>
00009 
00010 
00011 
00012 namespace Sirikata
00013 {
00014 namespace JS
00015 {
00016   class EmersonScript;
00017 
00018 namespace JSInvokableObject
00019 {
00020 
00021 class JSInvokableObjectInt : public Invokable
00022 {
00023 
00024   public:
00025   JSInvokableObjectInt(Invokable* _invokable)
00026    : invokable_(_invokable)
00027     {
00028         assert(invokable_ != NULL);
00029     }
00030 
00031   Invokable* invokable() const {return invokable_;}
00032   void invokableIs(Invokable* _invokable) {invokable_=_invokable;}
00033 
00034   boost::any invoke(std::vector<boost::any>& params);
00035 
00036 
00037   private:
00038 
00039   Invokable* invokable_;
00040 
00041 
00042 };
00043 
00044 v8::Handle<v8::Value> invoke(const v8::Arguments& args);
00045 bool decodeJSInvokableObject(v8::Handle<v8::Value>, EmersonScript*&, JSInvokableObject::JSInvokableObjectInt*&);
00046 
00047 
00048 }
00049 
00050 }
00051 
00052 }
00053 
00054 
00055 
00056 #endif