Go to the documentation of this file.
37 void connectLuaField(
const std::string& field,
const std::function<T>& f,
bool pushFront =
false);
42 template<
typename... T>
45 template<
typename R,
typename... T>
46 R
callLuaField(
const std::string& field,
const T&... args);
47 template<
typename... T>
48 void callLuaField(
const std::string& field,
const T&... args);
55 void setLuaField(
const std::string& key,
const T& value);
92 void connect(
const LuaObjectPtr& obj,
const std::string& field,
const std::function<F>& f,
bool pushFront =
false);
94 template<
typename Lambda>
95 typename std::enable_if<std::is_constructible<decltype(&Lambda::operator())>::value,
void>::type
127 void connect(
const LuaObjectPtr& obj,
const std::string& field,
const std::function<F>& f,
bool pushFront) {
128 obj->connectLuaField<F>(field, f, pushFront);
135 template<
typename Lambda,
typename Ret,
typename... Args>
137 static void call(
const LuaObjectPtr& obj,
const std::string& field,
const Lambda& f,
bool pushFront) {
138 connect(obj, field, std::function<Ret(Args...)>(f), pushFront);
144 template<
typename Lambda>
145 typename std::enable_if<std::is_constructible<decltype(&Lambda::operator())>::value,
void>::type
147 typedef decltype(&Lambda::operator()) F;
151 template<
typename... T>
171 template<
typename R,
typename... T>
183 template<
typename... T>
int push_luavalue(const Outfit &outfit)
void rawSeti(int n, int index=-2)
void connectLuaField(const std::string &field, const std::function< T > &f, bool pushFront=false)
void luaGetMetatable()
Get object's metatable.
static void call(const LuaObjectPtr &obj, const std::string &field, const Lambda &f, bool pushFront)
void callGlobalField(const std::string &global, const std::string &field, const T &... args)
void luaGetFieldsTable()
Gets the table containing all stored fields of this lua object, the result is pushed onto the stack.
bool isFunction(int index=-1)
std::string getClassName()
Returns the derived class name, its the same name used in Lua.
std::enable_if< std::is_constructible< decltype(&Lambda::operator())>::value, void >::type connect(const LuaObjectPtr &obj, const std::string &field, const Lambda &f, bool pushFront=false)
void getField(const char *key, int index=-1)
int polymorphicPush(const T &v, const Args &... args)
Pushes any type onto the stack.
void releaseLuaFieldsTable()
Release fields table reference.
R callLuaField(const std::string &field, const T &... args)
void luaSetField(const std::string &key)
Sets a field from this lua object, the value must be on the stack.
void luaGetField(const std::string &key)
Gets a field from this lua object, the result is pushed onto the stack.
T polymorphicPop()
Same as castValue but also pops.
void pushObject(const LuaObjectPtr &obj)
LuaObjectPtr asLuaObject()
void setLuaField(const std::string &key, const T &value)
Sets a field in this lua object.
int signalCall(int numArgs=0, int numRets=-1)
bool isTable(int index=-1)
T getLuaField(const std::string &key)
Gets a field from this lua object.
bool hasLuaField(const std::string &field)
Returns true if the lua field exists.
int luaCallLuaField(const std::string &field, const T &... args)
LuaObject, all script-able classes have it as base.
void operator=(const LuaObject &)