Lua/LuaInstance: Rename automatic SetField/SetGlobal to PushField/PushGlobal

Former-commit-id: add576baa5ee7c12121925b5b4fb5fc37fe85042
This commit is contained in:
Lynix
2016-04-23 22:18:43 +02:00
parent 3051b6bdde
commit 7b10bbaab0
4 changed files with 38 additions and 38 deletions

View File

@@ -541,6 +541,19 @@ namespace Nz
return LuaImplReplyVal(*this, std::move(arg), TypeTag<T>());
}
template<typename T>
void LuaInstance::PushField(const char* name, T&& arg, int tableIndex) const
{
Push<T>(std::forward<T>(arg));
SetField(name, tableIndex);
}
template<typename T>
void LuaInstance::PushField(const String& name, T&& arg, int tableIndex) const
{
PushField(name.GetConstBuffer(), std::forward<T>(arg), tableIndex);
}
template<typename R, typename... Args, typename... DefArgs>
void LuaInstance::PushFunction(R(*func)(Args...), DefArgs&&... defArgs) const
{
@@ -554,6 +567,19 @@ namespace Nz
});
}
template<typename T>
void LuaInstance::PushGlobal(const char* name, T&& arg)
{
Push<T>(std::forward<T>(arg));
SetGlobal(name);
}
template<typename T>
void LuaInstance::PushGlobal(const String& name, T&& arg)
{
PushGlobal(name.GetConstBuffer(), std::forward<T>(arg));
}
template<typename T>
void LuaInstance::PushInstance(const char* tname, T* instance) const
{
@@ -568,32 +594,6 @@ namespace Nz
PushInstance(tname, new T(std::forward<Args>(args)...));
}
template<typename T>
void LuaInstance::SetField(const char* name, T&& arg, int tableIndex)
{
Push<T>(std::forward<T>(arg));
SetField(name, tableIndex);
}
template<typename T>
void LuaInstance::SetField(const String& name, T&& arg, int tableIndex)
{
SetField(name.GetConstBuffer(), std::forward<T>(arg), tableIndex);
}
template<typename T>
void LuaInstance::SetGlobal(const char* name, T&& arg)
{
Push<T>(std::forward<T>(arg));
SetGlobal(name);
}
template<typename T>
void LuaInstance::SetGlobal(const String& name, T&& arg)
{
SetGlobal(name.GetConstBuffer(), std::forward<T>(arg));
}
template<typename T>
T LuaInstance::CheckBounds(int index, long long value) const
{