diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2012-12-20 21:34:09 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2012-12-20 21:34:09 (GMT) |
commit | 498f6f80e9ca01236ca1491596875ab7eb4cd8c3 (patch) | |
tree | e627ae19475bb93a98dfa50db1950f6e3403f569 /src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h | |
parent | d779abe6ff76a78f92d229fcf1f006f5cf1f9295 (diff) | |
download | uscxml-498f6f80e9ca01236ca1491596875ab7eb4cd8c3.zip uscxml-498f6f80e9ca01236ca1491596875ab7eb4cd8c3.tar.gz uscxml-498f6f80e9ca01236ca1491596875ab7eb4cd8c3.tar.bz2 |
Refactoring finished
Support datamodels, invokers and ioprocessors as plugins
Comply to HTTP1.1 by sending host header field
Started prolog datamodel
Diffstat (limited to 'src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h')
-rw-r--r-- | src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h | 94 |
1 files changed, 48 insertions, 46 deletions
diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h index 994ed18..deee58c 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h +++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h @@ -10,76 +10,78 @@ #endif namespace uscxml { - class Event; - class Data; - class V8SCXMLDOM; +class Event; +class Data; +class V8SCXMLDOM; } namespace uscxml { class V8DataModel : public DataModel { public: - V8DataModel(); - virtual ~V8DataModel(); - virtual DataModel* create(Interpreter* interpreter); - - virtual std::set<std::string> getNames() { + V8DataModel(); + virtual ~V8DataModel(); + virtual DataModel* create(Interpreter* interpreter); + + virtual std::set<std::string> getNames() { std::set<std::string> names; names.insert("ecmascript"); return names; } - virtual void initialize(); - virtual void setSessionId(const std::string& sessionId); - virtual void setName(const std::string& name); - virtual void setEvent(const Event& event); + virtual void initialize(); + virtual void setSessionId(const std::string& sessionId); + virtual void setName(const std::string& name); + virtual void setEvent(const Event& event); + + virtual void registerIOProcessor(const std::string& name, IOProcessor* ioprocessor); - virtual bool validate(const std::string& location, const std::string& schema); + virtual bool validate(const std::string& location, const std::string& schema); - virtual uint32_t getLength(const std::string& expr); - virtual void pushContext(); - virtual void popContext(); + virtual uint32_t getLength(const std::string& expr); + virtual void pushContext(); + virtual void popContext(); - virtual void eval(const std::string& expr); - virtual void assign(const std::string& location, const std::string& expr); - virtual void assign(const std::string& location, const Data& data); + virtual void eval(const std::string& expr); + virtual void assign(const std::string& location, const std::string& expr); + virtual void assign(const std::string& location, const Data& data); - virtual Data getStringAsData(const std::string& content); - virtual Data getValueAsData(const v8::Handle<v8::Value>& value); - - virtual std::string evalAsString(const std::string& expr); - virtual bool evalAsBool(const std::string& expr); + virtual Data getStringAsData(const std::string& content); + virtual Data getValueAsData(const v8::Handle<v8::Value>& value); - static v8::Handle<v8::Value> jsGetEventName(v8::Local<v8::String> property, - const v8::AccessorInfo &info); - static v8::Handle<v8::Value> jsGetEventType(v8::Local<v8::String> property, - const v8::AccessorInfo &info); - static v8::Handle<v8::Value> jsGetEventSendId(v8::Local<v8::String> property, - const v8::AccessorInfo &info); - static v8::Handle<v8::Value> jsGetEventOrigin(v8::Local<v8::String> property, - const v8::AccessorInfo &info); - static v8::Handle<v8::Value> jsGetEventOriginType(v8::Local<v8::String> property, - const v8::AccessorInfo &info); - static v8::Handle<v8::Value> jsGetEventInvokeId(v8::Local<v8::String> property, - const v8::AccessorInfo &info); + virtual std::string evalAsString(const std::string& expr); + virtual bool evalAsBool(const std::string& expr); - static v8::Handle<v8::Value> jsIn(const v8::Arguments& args); - static v8::Handle<v8::Value> jsPrint(const v8::Arguments& args); + static v8::Handle<v8::Value> jsGetEventName(v8::Local<v8::String> property, + const v8::AccessorInfo &info); + static v8::Handle<v8::Value> jsGetEventType(v8::Local<v8::String> property, + const v8::AccessorInfo &info); + static v8::Handle<v8::Value> jsGetEventSendId(v8::Local<v8::String> property, + const v8::AccessorInfo &info); + static v8::Handle<v8::Value> jsGetEventOrigin(v8::Local<v8::String> property, + const v8::AccessorInfo &info); + static v8::Handle<v8::Value> jsGetEventOriginType(v8::Local<v8::String> property, + const v8::AccessorInfo &info); + static v8::Handle<v8::Value> jsGetEventInvokeId(v8::Local<v8::String> property, + const v8::AccessorInfo &info); + + static v8::Handle<v8::Value> jsIn(const v8::Arguments& args); + static v8::Handle<v8::Value> jsPrint(const v8::Arguments& args); protected: - std::list<v8::Persistent<v8::Context> > _contexts; - Interpreter* _interpreter; + std::list<v8::Persistent<v8::Context> > _contexts; + Interpreter* _interpreter; std::string _sessionId; std::string _name; - - Event _event; - v8::Persistent<v8::ObjectTemplate> _globalTemplate; - v8::Persistent<v8::ObjectTemplate> _eventTemplate; - v8::Handle<v8::Value> evalAsValue(const std::string& expr); - virtual v8::Handle<v8::Value> getDataAsValue(const Data& data); + Event _event; + v8::Persistent<v8::ObjectTemplate> _globalTemplate; + v8::Persistent<v8::ObjectTemplate> _eventTemplate; + + v8::Handle<v8::Value> evalAsValue(const std::string& expr); + virtual v8::Handle<v8::Value> getDataAsValue(const Data& data); }; |