summaryrefslogtreecommitdiff
path: root/source/libs/asura-lib-utils/io/io_task.cpp
blob: 1a50e56f55bd365d65f95388a79529ba3fd3e36f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "io_task.h"

using namespace AEScripting;
using namespace Luax;

namespace AsuraEngine
{
	namespace IO
	{

		IOTask::IOTask(const std::string& path, DataBuffer* buffer)
			: mPath(path)
			, mDst(buffer)
		{
		}

		IOTask::~IOTask()
		{
		}

		bool IOTask::Execute()
		{
			return true;
		}

		void IOTask::Invoke(lua_State* thread)
		{
			if (mCallback)
			{
				LuaxScopedState state(thread);
				if (PushLuaxMemberRef(state, mCallback))
				{
					PushLuaxMemberRef(state, mDstRef);
					state.Call(1, 0);
				}
			}
		}

	}
}