diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-11-13 23:56:53 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-11-13 23:56:53 (GMT) |
commit | 7a1dc775d5d8edcf9193ca4ad7154af5eab18f1c (patch) | |
tree | b681e35b778f5c17d768b0713d8141a17a1dedb9 /src/uscxml/plugins/DataModel.h | |
parent | 2bc6ae32bbb67d242436d173c41fabc47626b943 (diff) | |
download | uscxml-7a1dc775d5d8edcf9193ca4ad7154af5eab18f1c.zip uscxml-7a1dc775d5d8edcf9193ca4ad7154af5eab18f1c.tar.gz uscxml-7a1dc775d5d8edcf9193ca4ad7154af5eab18f1c.tar.bz2 |
Support for DataModelExtensions
Diffstat (limited to 'src/uscxml/plugins/DataModel.h')
-rw-r--r-- | src/uscxml/plugins/DataModel.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/uscxml/plugins/DataModel.h b/src/uscxml/plugins/DataModel.h index be68ea2..a210ea1 100644 --- a/src/uscxml/plugins/DataModel.h +++ b/src/uscxml/plugins/DataModel.h @@ -33,6 +33,17 @@ namespace uscxml { class InterpreterImpl; +class DataModelImpl; + +class USCXML_API DataModelExtension { +public: + DataModelExtension() : dm(NULL) {} + virtual ~DataModelExtension() {} + virtual std::string provides() = 0; + virtual Data getValueOf(const std::string& member) = 0; + virtual void setValueOf(const std::string& member, const Data& data) = 0; + DataModelImpl* dm; +}; class USCXML_API DataModelImpl { public: @@ -86,6 +97,8 @@ public: _interpreter = interpreter; } + virtual void addExtension(DataModelExtension* ext) {} + virtual std::string andExpressions(std::list<std::string>) { return ""; } @@ -96,6 +109,7 @@ protected: class USCXML_API DataModel { public: + DataModel() : _impl() {} DataModel(const boost::shared_ptr<DataModelImpl> impl) : _impl(impl) { } DataModel(const DataModel& other) : _impl(other._impl) { } @@ -205,6 +219,10 @@ public: _impl->setInterpreter(interpreter); } + virtual void addExtension(DataModelExtension* ext) { + _impl->addExtension(ext); + } + protected: boost::shared_ptr<DataModelImpl> _impl; }; |