summaryrefslogtreecommitdiff
path: root/source/modules/asura-utils/Threads/Task.h
blob: b871303ce4dbd3b12b6fe41d008326faacfa63bd (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
41
42
43
#ifndef _ASURA_THRAD_TASK_H_
#define _ASURA_THRAD_TASK_H_

#include <asura-utils/Type.h>
#include <asura-utils/Scripting/Portable.hpp>
#include <asura-utils/Classes.h>

namespace_begin(AsuraEngine)
namespace_begin(Threads)

///
/// ϣһ̴߳񣬼̳TaskдExecute
///
ASURA_ABSTRACT class Task : public AEScripting::Object
{
public:

	Task() {};
	virtual ~Task() {};

	///
	/// ִɺ󷵻trueûص
	///
	virtual bool Execute() = 0;

	///
	/// ûصinvoke threadص
	///
	virtual void Invoke(lua_State* invokeThreaad) = 0;

protected:

	// ȡص
	Luax::LuaxMemberRef m_Callback;

};

namespace_end
namespace_end

namespace AEThreading = AsuraEngine::Threads;

#endif