diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-08-01 12:55:04 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-08-01 12:55:04 (GMT) |
commit | 3df6c9c6630f3b3b9b0876ae5bc8f2d12a15b253 (patch) | |
tree | 41f234c33e1e04015ef92a6b94212d9c7e97ad72 /src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp | |
parent | 720bbe5c1b8c0789b5c7ad9ffca33e52bf77f1da (diff) | |
download | uscxml-3df6c9c6630f3b3b9b0876ae5bc8f2d12a15b253.zip uscxml-3df6c9c6630f3b3b9b0876ae5bc8f2d12a15b253.tar.gz uscxml-3df6c9c6630f3b3b9b0876ae5bc8f2d12a15b253.tar.bz2 |
Bug fixes and version bump
- New calendar invoker
- Fixed memory leaks with JavaScriptCore
- Compiles on windows again
- Beautified source code indentation
Diffstat (limited to 'src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp')
-rw-r--r-- | src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp index 462b661..a52af4b 100644 --- a/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp +++ b/src/uscxml/plugins/datamodel/prolog/swi/SWIDataModel.cpp @@ -13,7 +13,7 @@ _dmPtr = this; #define PL_MODULE \ _interpreter.getSessionId().c_str() \ - + #define UNSET_PL_ENGINE(dm) \ PL_set_engine(NULL, NULL); @@ -49,7 +49,7 @@ SWIDataModel::~SWIDataModel() { _swiEngines.erase(this); } } - + boost::shared_ptr<DataModelImpl> SWIDataModel::create(InterpreterImpl* interpreter) { boost::shared_ptr<SWIDataModel> dm = boost::shared_ptr<SWIDataModel>(new SWIDataModel()); dm->_interpreter = interpreter; @@ -76,18 +76,18 @@ boost::shared_ptr<DataModelImpl> SWIDataModel::create(InterpreterImpl* interpret } else { LOG(WARNING) << "Instantiating more than one SWI prolog datamodel will lead to weird effects as I cannot seperate the environments"; } - + PL_set_engine(PL_ENGINE_CURRENT, &engine); - + // load SWI XML parser try { PlCall("use_module", PlCompound("library", PlTerm("sgml"))); } catch (PlException plex) { - + LOG(ERROR) << "Cannot load prolog sgml module - make sure you have it installed in your prolog runtime: " << (char*)plex; throw plex; } - + // load json parser try { PlCall("use_module", PlCompound("library", PlTerm("http/json"))); @@ -100,11 +100,11 @@ boost::shared_ptr<DataModelImpl> SWIDataModel::create(InterpreterImpl* interpret } else { engine = PL_create_engine(NULL); } - + assert(engine); - _swiEngines[dm.get()] = engine; + _swiEngines[dm.get()] = engine; _dmPtr = dm.get(); - + int rc = PL_set_engine(engine, NULL); assert(rc == PL_ENGINE_SET); @@ -119,7 +119,7 @@ boost::shared_ptr<DataModelImpl> SWIDataModel::create(InterpreterImpl* interpret boost::replace_all(_plModule, "7", "n"); boost::replace_all(_plModule, "8", "o"); boost::replace_all(_plModule, "9", "p"); - + // use atoms for double quoted PlCall("set_prolog_flag(double_quotes,atom)."); |