QLua
Lua-Qt bindings
Public Member Functions | Protected Member Functions | Protected Attributes
qlua::LArgConstructor Class Reference

Abstract base class for return constructors which create Lua values from C++ values. More...

#include <LuaArguments.h>

Inheritance diagram for qlua::LArgConstructor:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void Push (lua_State *) const =0
 Push value on Lua stack, invoked when a value must be returned from a method invoked from Lua.
virtual void Push (lua_State *, void *) const =0
 Push value read from a specific memory location on Lua stack, invoked when calling a method as result of signal emission.
virtual ~LArgConstructor ()
 Virtual destructor.
virtual LArgConstructorClone () const =0
 Return copy of object.
virtual QMetaType::Type Type () const =0
 Return type of constructed data.
QGenericReturnArgument Argument () const
 Return QGenericReturnArguments holding a reference to the memory location where the returned value is stored.
virtual bool IsQObjectPtr () const
 Return true if type is a pointer to a QObject-derived object.

Protected Member Functions

template<typename T >
void SetArg (T &arg)
 Creates return argument of the proper type.

Protected Attributes

QGenericReturnArgument ga_
 Placeholder for returned data.

Detailed Description

Abstract base class for return constructors which create Lua values from C++ values.


Member Function Documentation

virtual bool qlua::LArgConstructor::IsQObjectPtr ( ) const [inline, virtual]

Return true if type is a pointer to a QObject-derived object.

This is required to have the QLua run-time add the passed QObject into the Lua context. The other option is to have LArgConstructors::Push receive a reference to a LuaContext which introduces a two-way dependency between LArgConstructor and LuaContext.

Reimplemented in qlua::ObjectStarLArgConstructor, and qlua::WidgetStarLArgConstructor.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Enumerator