diff options
author | Stefan Radomski <github@mintwerk.de> | 2017-01-13 16:47:44 (GMT) |
---|---|---|
committer | Stefan Radomski <github@mintwerk.de> | 2017-01-13 16:47:44 (GMT) |
commit | 4f6cbe9e7aec2b4a6c8f286f9097abfb011a6235 (patch) | |
tree | 8c023473bb342780ddf51a893d18369f1319bb5c /src/uscxml/interpreter/InterpreterImpl.h | |
parent | 0aa0fe08dc308c94379c47d0bf9745e341cb4c81 (diff) | |
download | uscxml-4f6cbe9e7aec2b4a6c8f286f9097abfb011a6235.zip uscxml-4f6cbe9e7aec2b4a6c8f286f9097abfb011a6235.tar.gz uscxml-4f6cbe9e7aec2b4a6c8f286f9097abfb011a6235.tar.bz2 |
First support for serialization and some bug fixes for DOM per data.src
Diffstat (limited to 'src/uscxml/interpreter/InterpreterImpl.h')
-rw-r--r-- | src/uscxml/interpreter/InterpreterImpl.h | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/src/uscxml/interpreter/InterpreterImpl.h b/src/uscxml/interpreter/InterpreterImpl.h index 0efc70a..2b12624 100644 --- a/src/uscxml/interpreter/InterpreterImpl.h +++ b/src/uscxml/interpreter/InterpreterImpl.h @@ -64,30 +64,14 @@ public: void cloneFrom(InterpreterImpl* other); void cloneFrom(std::shared_ptr<InterpreterImpl> other); - virtual InterpreterState step(size_t blockMs) { - if (!_isInitialized) { - init(); - _state = USCXML_INITIALIZED; - } else { - _state = _microStepper.step(blockMs); - } - return _state; - } - - virtual void reset() {///< Reset state machine - if (_microStepper) - _microStepper.reset(); - - _isInitialized = false; - _state = USCXML_INSTANTIATED; -// _dataModel.reset(); - if (_delayQueue) - _delayQueue.reset(); -// _contentExecutor.reset(); - } + virtual InterpreterState step(size_t blockMs); + virtual void reset();///< Reset state machine virtual void cancel(); ///< Cancel and finalize state machine + virtual void deserialize(const std::string& encodedState); + virtual std::string serialize(); + InterpreterState getState() { return _state; } @@ -240,6 +224,18 @@ public: _delayQueue = al.delayedQueue; } + ActionLanguage getActionLanguage() { + ActionLanguage al; + al.logger = _logger; + al.execContent = _execContent; + al.microStepper = _microStepper; + al.dataModel = _dataModel; + al.internalQueue = _internalQueue; + al.externalQueue = _externalQueue; + al.delayedQueue = _delayQueue; + return al; + } + void setFactory(Factory* factory) { _factory = factory; } @@ -274,6 +270,7 @@ protected: static std::map<std::string, std::weak_ptr<InterpreterImpl> > _instances; static std::recursive_mutex _instanceMutex; std::recursive_mutex _delayMutex; + std::recursive_mutex _serializationMutex; friend class Interpreter; friend class InterpreterIssue; |