diff options
author | Stefan Radomski <github@mintwerk.de> | 2017-04-30 20:51:38 (GMT) |
---|---|---|
committer | Stefan Radomski <github@mintwerk.de> | 2017-04-30 20:51:38 (GMT) |
commit | 6e1d8d25d4e7b65ca67b5d5c529ba0bedb81feb9 (patch) | |
tree | ef48948b05c1947d10ed40cb7844f0cb6d6eb86e /contrib/src/uscxml | |
parent | 8015ce2701862e6977fe12cde839a35ddb4c32e5 (diff) | |
download | uscxml-6e1d8d25d4e7b65ca67b5d5c529ba0bedb81feb9.zip uscxml-6e1d8d25d4e7b65ca67b5d5c529ba0bedb81feb9.tar.gz uscxml-6e1d8d25d4e7b65ca67b5d5c529ba0bedb81feb9.tar.bz2 |
Optimized ANSI-C transformation
Diffstat (limited to 'contrib/src/uscxml')
-rw-r--r-- | contrib/src/uscxml/ExtendedLuaDataModel.cpp | 21 | ||||
-rw-r--r-- | contrib/src/uscxml/ExtendedLuaDataModel.h | 49 |
2 files changed, 70 insertions, 0 deletions
diff --git a/contrib/src/uscxml/ExtendedLuaDataModel.cpp b/contrib/src/uscxml/ExtendedLuaDataModel.cpp new file mode 100644 index 0000000..cb19743 --- /dev/null +++ b/contrib/src/uscxml/ExtendedLuaDataModel.cpp @@ -0,0 +1,21 @@ +/** + * @file + * @author 2017 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @copyright Simplified BSD + * + * @cond + * This program is free software: you can redistribute it and/or modify + * it under the terms of the FreeBSD license as published by the FreeBSD + * project. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the FreeBSD license along with this + * program. If not, see <http://www.opensource.org/licenses/bsd-license>. + * @endcond + */ + +#include "ExtendedLuaDataModel.h" + diff --git a/contrib/src/uscxml/ExtendedLuaDataModel.h b/contrib/src/uscxml/ExtendedLuaDataModel.h new file mode 100644 index 0000000..652a2a0 --- /dev/null +++ b/contrib/src/uscxml/ExtendedLuaDataModel.h @@ -0,0 +1,49 @@ +/** + * @file + * @author 2017 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @copyright Simplified BSD + * + * @cond + * This program is free software: you can redistribute it and/or modify + * it under the terms of the FreeBSD license as published by the FreeBSD + * project. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the FreeBSD license along with this + * program. If not, see <http://www.opensource.org/licenses/bsd-license>. + * @endcond + */ + +#ifndef EXTENDEDLUADATAMODEL_H_9ED3DCC6 +#define EXTENDEDLUADATAMODEL_H_9ED3DCC6 + +#include "uscxml/plugins/datamodel/lua/LuaDataModel.h" + +class ExtendedLuaDataModel : public uscxml::LuaDataModel { +public: + ExtendedLuaDataModel() {}; + + std::shared_ptr<DataModelImpl> create(uscxml::DataModelCallbacks* callbacks) { + + std::shared_ptr<ExtendedLuaDataModel> dm(new ExtendedLuaDataModel()); +// dm->LuaDataModel::init(callbacks); + + lua_pushcfunction(dm->_luaState, GetSomeResult); + lua_setglobal(dm->_luaState, "GetSomeResult"); + + return dm; + } + + static int GetSomeResult(lua_State * L) { + LOGD(uscxml::USCXML_INFO) << "Calling GetSomeResult!" << std::endl; + lua_pushinteger(L, 55555); + return 1; + } +}; + + + +#endif /* end of include guard: EXTENDEDLUADATAMODEL_H_9ED3DCC6 */ |