summaryrefslogtreecommitdiff
path: root/Source/modules/asura-base/Threads/Task.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/modules/asura-base/Threads/Task.h')
-rw-r--r--Source/modules/asura-base/Threads/Task.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/Source/modules/asura-base/Threads/Task.h b/Source/modules/asura-base/Threads/Task.h
new file mode 100644
index 0000000..2e9977a
--- /dev/null
+++ b/Source/modules/asura-base/Threads/Task.h
@@ -0,0 +1,43 @@
+#ifndef _ASURA_THRAD_TASK_H_
+#define _ASURA_THRAD_TASK_H_
+
+#include <asura-base/Type.h>
+#include <asura-base/Scripting/Scripting.h>
+#include <asura-base/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 \ No newline at end of file