diff options
Diffstat (limited to 'contrib/src/uscxml/ExtendedLuaDataModel.h')
-rw-r--r-- | contrib/src/uscxml/ExtendedLuaDataModel.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/contrib/src/uscxml/ExtendedLuaDataModel.h b/contrib/src/uscxml/ExtendedLuaDataModel.h index 652a2a0..44e4b5d 100644 --- a/contrib/src/uscxml/ExtendedLuaDataModel.h +++ b/contrib/src/uscxml/ExtendedLuaDataModel.h @@ -27,15 +27,18 @@ 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"); - + dm->_callbacks = callbacks; + dm->setup(); return dm; } + + void setup() { + uscxml::LuaDataModel::setup(); + lua_pushcfunction(_luaState, GetSomeResult); + lua_setglobal(_luaState, "GetSomeResult"); + + } static int GetSomeResult(lua_State * L) { LOGD(uscxml::USCXML_INFO) << "Calling GetSomeResult!" << std::endl; |