diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-03-20 08:00:41 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-03-20 08:00:41 (GMT) |
commit | c6c1f3e2e333705bf7d54fffd4b18939a56f4ed8 (patch) | |
tree | 92af8be33c602a68d1912790cad657c2a012e2c0 /src/uscxml/Interpreter.cpp | |
parent | ccbf595c52fd705ec70abc774a29b153a7281334 (diff) | |
download | uscxml-c6c1f3e2e333705bf7d54fffd4b18939a56f4ed8.zip uscxml-c6c1f3e2e333705bf7d54fffd4b18939a56f4ed8.tar.gz uscxml-c6c1f3e2e333705bf7d54fffd4b18939a56f4ed8.tar.bz2 |
Started Syteminvoker
Diffstat (limited to 'src/uscxml/Interpreter.cpp')
-rw-r--r-- | src/uscxml/Interpreter.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/uscxml/Interpreter.cpp b/src/uscxml/Interpreter.cpp index 95f4658..4ae4689 100644 --- a/src/uscxml/Interpreter.cpp +++ b/src/uscxml/Interpreter.cpp @@ -39,7 +39,9 @@ Interpreter::Interpreter() : Arabica::SAX2DOM::Parser<std::string>() { _parentQueue = NULL; _running = false; _done = false; + _isInitialized = false; _httpServlet = NULL; + _capabilities = CAN_BASIC_HTTP | CAN_GENERIC_HTTP; #ifdef _WIN32 WSADATA wsaData; @@ -170,7 +172,7 @@ Interpreter* Interpreter::fromInputSource(Arabica::SAX::InputSource<std::string> } else { interpreter->_document = interpreter->Arabica::SAX2DOM::Parser<std::string>::getDocument(); } - interpreter->init(); +// interpreter->init(); return interpreter; } @@ -191,14 +193,17 @@ void Interpreter::init() { normalize(_document); + if (_capabilities & CAN_GENERIC_HTTP) + _httpServlet = new HTTPServletInvoker(this); + _sendQueue = new DelayedEventQueue(); - _httpServlet = new HTTPServletInvoker(this); _sendQueue->start(); } else { LOG(ERROR) << "Cannot find SCXML element" << std::endl; } } + _isInitialized = true; } Interpreter::~Interpreter() { @@ -259,10 +264,13 @@ bool Interpreter::runOnMainThread(int fps, bool blocking) { // see: http://www.w3.org/TR/scxml/#AlgorithmforSCXMLInterpretation void Interpreter::interpret() { + if (!_isInitialized) + init(); + if (!_scxml) return; // dump(); - + _sessionId = getUUID(); std::string datamodelName; @@ -2520,6 +2528,11 @@ void Interpreter::setupIOProcessors() { tthread::lock_guard<tthread::mutex> lock(_mutex); std::map<std::string, IOProcessorImpl*>::iterator ioProcIter = Factory::getInstance()->_ioProcessors.begin(); while(ioProcIter != Factory::getInstance()->_ioProcessors.end()) { + if (boost::iequals(ioProcIter->first, "basichttp") && !(_capabilities & CAN_BASIC_HTTP)) { + ioProcIter++; + continue; + } + _ioProcessors[ioProcIter->first] = Factory::createIOProcessor(ioProcIter->first, this); _ioProcessors[ioProcIter->first].setType(ioProcIter->first); _ioProcessors[ioProcIter->first].setInterpreter(this); |