From c270d033fa04873ee7a8925dbb00cae5edc4555c Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 30 Mar 2019 11:59:35 +0800 Subject: *misc --- source/modules/asura-utils/scripting/lua_env.h | 72 -------------------------- 1 file changed, 72 deletions(-) delete mode 100644 source/modules/asura-utils/scripting/lua_env.h (limited to 'source/modules/asura-utils/scripting/lua_env.h') diff --git a/source/modules/asura-utils/scripting/lua_env.h b/source/modules/asura-utils/scripting/lua_env.h deleted file mode 100644 index e2fc4fc..0000000 --- a/source/modules/asura-utils/scripting/lua_env.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef __ASURA_LUA_ENV_H__ -#define __ASURA_LUA_ENV_H__ - -extern "C" -{ -#include -#include -} -#include - -#include "../singleton.hpp" - -namespace AsuraEngine -{ - namespace Scripting - { - - /// - /// 程序通过这个接口访问主lua state。Asura程序的思想是,进程主线程维护一个lua虚拟机,应用 - /// 的主要逻辑跑在此虚拟机的主lua线程里(或者叫主栈里)。 - /// - class LuaEnv ASURA_FINAL : public Singleton - { - public: - - LuaEnv() : mVM(0) {}; - ~LuaEnv() {}; - - /// - /// 设置主虚拟机的主执行栈。 - /// - inline void Init() - { - ASSERT(!mVM); - mVM = new Luax::LuaxVM(); - ASSERT(mVM); - mVM->Setup(); - }; - - inline lua_State* GetMainThread() - { - return mVM->GetMainThread(); - }; - - inline void Exit() - { - delete mVM; - mVM = nullptr; - } - - private: - - /// - /// 主线程保存一个主lua虚拟机。一个Asura程序永远只有一个主虚拟机,大部分代码都在这个虚 - /// 拟机中运行,且只能设置一次。主线程\主执行栈对应的是global_State里面的: - /// - /// struct lua_State *mainthread; - /// - /// 使用lua_newstate(),会创建一个虚拟机,包含一个global_State结构,并创建一个这个虚 - /// 拟机的主线程lua_State并返回。global_State由这个虚拟机的所有线程共享,除了第一个主 - /// 线程由lua_newstate()创建外,其余线程由lua_newthread()创建。 - /// - Luax::LuaxVM* mVM; - - }; - - } -} - -namespace AEScripting = AsuraEngine::Scripting; - -#endif \ No newline at end of file -- cgit v1.1-26-g67d0