summaryrefslogtreecommitdiff
path: root/source/3rd-party/Luax/luax_state.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/3rd-party/Luax/luax_state.h')
-rw-r--r--source/3rd-party/Luax/luax_state.h71
1 files changed, 36 insertions, 35 deletions
diff --git a/source/3rd-party/Luax/luax_state.h b/source/3rd-party/Luax/luax_state.h
index e9c394a..b6d1ff0 100644
--- a/source/3rd-party/Luax/luax_state.h
+++ b/source/3rd-party/Luax/luax_state.h
@@ -9,7 +9,7 @@
namespace Luax
{
- class LuaxContext;
+ class LuaxVM;
class LuaxEnum;
class LuaxStrongRef;
class LuaxWeakRef;
@@ -20,7 +20,8 @@ namespace Luax
/// member table
/// ref table
/// userdata
- /// userdataͨgetmetatableȡϼmetatable֮⻹һclass tableעڶӦƿռ
+ /// userdataͨgetmetatableȡϼmetatable֮⻹һclass tableעڶӦ
+ /// ƿռ
///
LUAX_API class LuaxState
{
@@ -36,11 +37,11 @@ namespace Luax
///
inline lua_State* GetHandle() { return mState; };
- //------------------------------------------------------------------------------------------------------------
+ //------------------------------------------------------------------------------//
void OpenLibs();
- //------------------------------------------------------------------------------------------------------------
+ //------------------------------------------------------------------------------//
// ƿռƿռһ_Gı
void PushGlobalNamespace();
@@ -48,7 +49,7 @@ namespace Luax
void PopNamespace();
bool IsNamespace(int idx);
- //------------------------------------------------------------------------------------------------------------
+ //------------------------------------------------------------------------------//
void SetTop(int top);
int GetTop();
@@ -56,7 +57,7 @@ namespace Luax
int AbsIndex(int idx);
void Call(int nArgs, int nResults);
- //------------------------------------------------------------------------------------------------------------
+ //------------------------------------------------------------------------------//
void GetField(int idx, cc8* name);
void GetField(int idx, int key);
@@ -117,11 +118,11 @@ namespace Luax
template<typename T> T* GetUserdata(int idx = 1);
- //------------------------------------------------------------------------------------------------------------
+ //------------------------------------------------------------------------------//
int ErrorType(int idx, cc8* hint);
- //------------------------------------------------------------------------------------------------------------
+ //------------------------------------------------------------------------------//
template<typename T> T GetValue(int idx, T default_value);
template<typename T> T GetField(int idx, int key, T value);
@@ -130,14 +131,14 @@ namespace Luax
template<typename T> void SetFieldByIndex(int idx, int key, T value);
template<typename T> T* CheckUserdata(int idx);
- template<typename T> T CheckParam(int idx);
+ template<typename T> T CheckValue(int idx);
- //------------------------------------------------------------------------------------------------------------
+ //------------------------------------------------------------------------------//
void DoString(const std::string& code);
void DoFile(const std::string& file);
- //------------------------------------------------------------------------------------------------------------
+ //------------------------------------------------------------------------------//
// ע᷽
///
@@ -166,9 +167,9 @@ namespace Luax
void RegisterMethod(cc8* fname, lua_CFunction func);
///
- /// preloaderӵpackage.preloadrequire"libname"ʱlualoader_preloadlibnameҵpreloaderֱӼء
- /// ʵҪrequireʱżأҼعһκpackage.loaded¼´βټءͨrequire
- /// preloader
+ /// preloaderӵpackage.preloadrequire"libname"ʱlualoader_preload
+ /// libnameҵpreloaderֱӼءʵҪrequireʱżأҼعһκ
+ /// package.loaded¼´βټءͨrequirepreloader
///
void RegisterPreloader(cc8* libname, lua_CFunction preloader);
@@ -191,11 +192,11 @@ namespace Luax
void RegisterPlainEnumRegistry(cc8* name);
#endif
- //------------------------------------------------------------------------------------------------------------
+ //------------------------------------------------------------------------------//
protected:
- friend class LuaxContext;
+ friend class LuaxVM;
LuaxState(lua_State* state);
LuaxState(const LuaxState& state);
@@ -211,7 +212,7 @@ namespace Luax
};
- //--------------------------------------------------------------------------------------------------------------
+ //--------------------------------------------------------------------------------//
// GetValue()ģػ
template <> bool LuaxState::GetValue < bool >(int idx, const bool value);
@@ -229,23 +230,23 @@ namespace Luax
template <> std::string LuaxState::GetValue < std::string >(int idx, const std::string value);
template <> const void* LuaxState::GetValue < const void* >(int idx, const void* value);
- //--------------------------------------------------------------------------------------------------------------
- // CheckParamģػ
-
- template <> bool LuaxState::CheckParam < bool >(int idx);
- template <> cc8* LuaxState::CheckParam < cc8* >(int idx);
- template <> double LuaxState::CheckParam < double >(int idx);
- template <> float LuaxState::CheckParam < float >(int idx);
- template <> s8 LuaxState::CheckParam < s8 >(int idx);
- template <> s16 LuaxState::CheckParam < s16 >(int idx);
- template <> s32 LuaxState::CheckParam < s32 >(int idx);
- template <> s64 LuaxState::CheckParam < s64 >(int idx);
- template <> u8 LuaxState::CheckParam < u8 >(int idx);
- template <> u16 LuaxState::CheckParam < u16 >(int idx);
- template <> u32 LuaxState::CheckParam < u32 >(int idx);
- template <> u64 LuaxState::CheckParam < u64 >(int idx);
- template <> std::string LuaxState::CheckParam < std::string >(int idx);
- template <> const void* LuaxState::CheckParam < const void* >(int idx);
+ //--------------------------------------------------------------------------------//
+ // CheckValueģػ
+
+ template <> bool LuaxState::CheckValue < bool >(int idx);
+ template <> cc8* LuaxState::CheckValue < cc8* >(int idx);
+ template <> double LuaxState::CheckValue < double >(int idx);
+ template <> float LuaxState::CheckValue < float >(int idx);
+ template <> s8 LuaxState::CheckValue < s8 >(int idx);
+ template <> s16 LuaxState::CheckValue < s16 >(int idx);
+ template <> s32 LuaxState::CheckValue < s32 >(int idx);
+ template <> s64 LuaxState::CheckValue < s64 >(int idx);
+ template <> u8 LuaxState::CheckValue < u8 >(int idx);
+ template <> u16 LuaxState::CheckValue < u16 >(int idx);
+ template <> u32 LuaxState::CheckValue < u32 >(int idx);
+ template <> u64 LuaxState::CheckValue < u64 >(int idx);
+ template <> std::string LuaxState::CheckValue < std::string >(int idx);
+ template <> const void* LuaxState::CheckValue < const void* >(int idx);
///
/// ڳԱﴴLuaxStateԲм顣
@@ -258,7 +259,7 @@ namespace Luax
#define LUAX_STATE(L) \
Luax::LuaxState& state = Luax::LuaxRuntime::Get().GetLuaxState(L)
- //--------------------------------------------------------------------------------------------------------------
+ //--------------------------------------------------------------------------------//
///
/// ȷȫluaܹڵ֮󷵻صstack״̬