From 69f7d1bd745ed5680b9bc4e3cfdd882ff2a5ad26 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 27 Mar 2019 22:18:14 +0800 Subject: +threading --- .../libs/asura-lib-utils/io/binding/_io_task.cpp | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 source/libs/asura-lib-utils/io/binding/_io_task.cpp (limited to 'source/libs/asura-lib-utils/io/binding/_io_task.cpp') diff --git a/source/libs/asura-lib-utils/io/binding/_io_task.cpp b/source/libs/asura-lib-utils/io/binding/_io_task.cpp new file mode 100644 index 0000000..c03ff2a --- /dev/null +++ b/source/libs/asura-lib-utils/io/binding/_io_task.cpp @@ -0,0 +1,36 @@ +#include "../io_task.h" + +using namespace std; + +namespace AsuraEngine +{ + namespace IO + { + + LUAX_REGISTRY(IOTask) + { + LUAX_REGISTER_METHODS(state, + { "New", _New } + ); + } + + LUAX_POSTPROCESS(IOTask) + { + + } + + // task = IOTask.New(path, dst) + LUAX_IMPL_METHOD(IOTask, _New) + { + LUAX_STATE(L); + + cc8* path = state.CheckParam(1); + DataBuffer* db = state.CheckUserdata(2); + IOTask* task = new IOTask(path, db); + task->PushLuaxUserdata(state); + task->SetLuaxMemberRef(state, task->mDstRef, 2); + return 1; + } + + } +} -- cgit v1.1-26-g67d0