Changed lua monitoring calls. Support for threading.

This commit is contained in:
emb
2015-11-20 22:49:56 -06:00
parent d1b8fcb0d9
commit 34e59adb1d
13 changed files with 160 additions and 39 deletions

View File

@@ -0,0 +1,29 @@
#include "LuaCollection.h"
#include "../Collection/CollectionInfo.h"
#include <string>
#include "../Collection/Item.h"
Configuration *config;
CollectionInfoBuilder *cib;
LuaEvent *events;
void LuaCollection::initialize(Configuration *c, CollectionInfoBuilder *b, LuaEvent *e)
{
config = c;
cib = b;
events = e;
}
int LuaCollection::load(lua_State *l)
{
std::string collection = luaL_checkstring(l, 1);
cib->buildCollection(collection, loadCallback, (void *)l);
return 0;
}
void LuaCollection::loadCallback(void *context)
{
lua_State *l = (lua_State *)context;
events->trigger(l, "onCollectionLoaded");
}