ValueBase class reference
[Base module]

Declaration  

This abstract class is for internal use only.

#include <QtLua/ValueBase>

namespace QtLua {
class ValueBase;
};

This class is a member of the QtLua namespace.

This abstract class is declared in QtLua/qtluavaluebase.hh source file, line 59.

This abstract class contains pure virtuals.

Description  

This base class contains lua value operations common to Value and ValueRef class.

Members  

Types  

Private type  

Functions  

Protected functions  

Private functions  

Static function  

  • static String type_name(ValueBase::ValueType t)

Protected static functions  

  • static uint qHash(lua_State *st, int index)
  • static String to_string_p(lua_State *st, int index, bool quote_string)

Protected fields  

Members detail  

ValueBase(const State *ls)  

This constructor is declared in QtLua/qtluavaluebase.hh source file, line 66.

This member access is private.

virtual ~ValueBase()  

This virtual destructor is declared in QtLua/qtluavaluebase.hh source file, line 68.

This member access is private.

enum Bool  

This enum is declared in QtLua/qtluavaluebase.hh source file, line 248.

Boolean type used for Value constructor.

The native C++ bool type is not used here due to implicit cast between bool and pointers which prevent proper constructor overloading.

IdentifierValueDescription
False0
True1

enum Operation  

This enum is declared in QtLua/qtluavaluebase.hh source file, line 169.

Specify lua operations performed on lua values.

IdentifierValueDescription
OpAdd0x0001Lua add binary operator +
OpSub0x0002Lua subtract binary operator -
OpMul0x0004Lua multiply binary operator *
OpDiv0x0008Lua divied binary operator /
OpMod0x0010Lua modulo binary operator %
OpPow0x0020Lua power binary operator ^
OpUnm0x0040Lua negative unary operator -
OpConcat0x0080Lua concatenation binary operator ..
OpLen0x0100Lua length unary operator #
OpEq0x0200Lua equal binary operator ==
OpLt0x0400Lua less than binary operator <
OpLe0x0800Lua less than or equal binary operator <=
OpIndex0x1000Table index operation
OpNewindex0x2000Table newindex operation
OpCall0x4000Function call operation
OpIterate0x8000Iteration operation
OpAll0xffffAll operations mask

See also UserData::meta_operation function, UserData::support function and ValueBase::Operations typedef.

typedef ValueBase::Operation Operations  

This typedef is declared in QtLua/qtluavaluebase.hh source file, line 191.

enum ValueType  

This enum is declared in QtLua/qtluavaluebase.hh source file, line 152.

Specify lua value types. This is the same as LUA_T* macros defined in lua headers

IdentifierValueDescription
TNone-1No type
TNil0Nil value
TBool1Boolean value
TNumber3Number value
TString4String value
TTable5Lua table value
TFunction6Lua function value
TUserData7Lua userdata value
TThread8Lua thread value

Value at(const Value &key) const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 442.

Index operation on a lua userdata or lua table value.

template <typename T> Value at(const T &key) const  

This template function is declared in QtLua/qtluavaluebase.hh source file, line 445.

Index operation on a lua userdata or lua table value.

ValueBase::iterator begin()  

This function is declared in QtLua/qtluavaluebase.hh source file, line 269.

Get an ValueBase::iterator to traverse a lua userdata or lua table value.

ValueBase::const_iterator begin() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 273.

Get a ValueBase::const_iterator to traverse a lua userdata or lua table value.

ValueBase::List call(const ValueBase::List &args) const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 255.

Call operation on a lua userdata or lua function value. When invoked on a lua thread value, the thread is resumed.

ValueBase::const_iterator cbegin() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 275.

Get a ValueBase::const_iterator to traverse a lua userdata or lua table value.

ValueBase::const_iterator cend() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 276.

Get a ValueBase::const_iterator to traverse a lua userdata or lua table value.

bool connect(QObject *obj, const char *signal)  

This function is declared in QtLua/qtluavaluebase.hh source file, line 543.

Connect a QObject signal to a lua value. The value will be called when the signal is emited.

See also ValueBase::disconnect function, QObject::connect and QObject wrapping section.

bool disconnect(QObject *obj, const char *signal)  

This function is declared in QtLua/qtluavaluebase.hh source file, line 551.

Disconnect a QObject signal from a lua value.

See also ValueBase::connect function, QObject::disconnect and QObject wrapping section.

ValueBase::iterator end()  

This function is declared in QtLua/qtluavaluebase.hh source file, line 270.

Get an ValueBase::iterator to traverse a lua userdata or lua table value.

ValueBase::const_iterator end() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 274.

Get a ValueBase::const_iterator to traverse a lua userdata or lua table value.

State * get_state() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 534.

Get associated lua state.

bool is_dead() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 482.

Returns true if the value is a coroutine which is not resumable. This function always returns false if State::lua_version() returns a value less than 501.

bool is_empty() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 477.

Check if a table or userdata contains at leasts one entry. For lua tables this is different from comparing the result of the ValueBase::len function with zero because this function will return true even if the table keys are not integers.

bool is_nil() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 471.

Check if the value is nil

int len() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 503.

Return the lua len of tables and strings. Return the result of the ValueBase::OpLen operation on UserData objects if ValueBase::OpLen is supported.

Ref<Iterator> new_iterator() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 280.

Return an Iterator object suitable to iterate over lua value. This works for lua tables and UserData objects.

operator Bool() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 305.

Convert a lua value to a boolean. Throw exception if conversion fails.

template <typename Key, typename Val> operator QHash<Key,Val>() const  

This template function is declared in QtLua/qtluavaluebase.hh source file, line 348.

Create a QHash with elements from lua table.

See also Qt/Lua types conversion section.

template <typename X> operator QList<X>() const  

This template function is declared in QtLua/qtluavaluebase.hh source file, line 327.

Create a QList with elements from lua table. Table keys are searched from 1.

See also Qt/Lua types conversion section.

template <typename Key, typename Val> operator QMap<Key,Val>() const  

This template function is declared in QtLua/qtluavaluebase.hh source file, line 358.

Create a QMap with elements from lua table.

See also Qt/Lua types conversion section.

operator QString() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 312.

Convert a lua string value to a String object. Throw exception if conversion fails.

operator QVariant() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 431.

Convert a bool, string or number value to a QVariant. The ValueBase::to_qvariant alternate function can be used to attempt a conversion of the value to a specified registered Qt type.

See also Qt/Lua types conversion section.

template <typename X> operator QVector<X>() const  

This template function is declared in QtLua/qtluavaluebase.hh source file, line 338.

Create a QVector with elements from lua table. Table keys are searched from 1.

See also Qt/Lua types conversion section.

template <typename X> operator Ref<X>() const  

This template function is declared in QtLua/qtluavaluebase.hh source file, line 406.

See also ValueBase::to_userdata_cast function.

operator String() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 311.

Convert a lua string value to a String object. Throw exception if conversion fails.

operator Value() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 282.

operator double() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 287.

Convert a lua number value to a double. Throw exception if conversion fails.

operator float() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 288.

Convert a lua number value to a double. Throw exception if conversion fails.

operator signed char() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 293.

Convert a lua number value to an integer. Throw exception if conversion fails.

operator signed int() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 297.

Convert a lua number value to an integer. Throw exception if conversion fails.

operator signed long() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 299.

Convert a lua number value to an integer. Throw exception if conversion fails.

operator signed short() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 295.

Convert a lua number value to an integer. Throw exception if conversion fails.

operator unsigned char() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 294.

Convert a lua number value to an integer. Throw exception if conversion fails.

operator unsigned int() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 298.

Convert a lua number value to an integer. Throw exception if conversion fails.

operator unsigned long() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 300.

Convert a lua number value to an integer. Throw exception if conversion fails.

operator unsigned short() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 296.

Convert a lua number value to an integer. Throw exception if conversion fails.

ValueBase::List operator()() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 256.

Call operation on a lua userdata or lua function value. When invoked on a lua thread value, the thread is resumed.

ValueBase::List operator()(const Value &arg1) const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 257.

Call operation on a lua userdata or lua function value. When invoked on a lua thread value, the thread is resumed.

ValueBase::List operator()(const Value &arg1, const Value &arg2) const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 258.

Call operation on a lua userdata or lua function value. When invoked on a lua thread value, the thread is resumed.

ValueBase::List operator()(const Value &arg1, const Value &arg2, const Value &arg3) const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 259.

Call operation on a lua userdata or lua function value. When invoked on a lua thread value, the thread is resumed.

ValueBase::List operator()(const Value &arg1, const Value &arg2, const Value &arg3, const Value &arg4) const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 260.

Call operation on a lua userdata or lua function value. When invoked on a lua thread value, the thread is resumed.

ValueBase::List operator()(const Value &arg1, const Value &arg2, const Value &arg3, const Value &arg4, const Value &arg5) const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 261.

Call operation on a lua userdata or lua function value. When invoked on a lua thread value, the thread is resumed.

ValueBase::List operator()(const Value &arg1, const Value &arg2, const Value &arg3, const Value &arg4, const Value &arg5, const Value &arg6) const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 262.

Call operation on a lua userdata or lua function value. When invoked on a lua thread value, the thread is resumed.

bool operator<(const Value &lv) const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 517.

Compare two lua values. This function may not give the same result as the lua compare operation depending on value type. This function is designed to be used by ordered containers like QMap. This function can compare values of different types and never fails.

bool operator==(const Value &lv) const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 524.

Compare two lua values. This function may not give the same result as the lua compare operation depending on value type. UserData values are considered equals if pointing to the same object. Other values are compared using the lua_rawequal function of the lua API. This function never fails.

bool operator==(const String &str) const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 527.

Compare the lua value with the given string.

bool operator==(const char *str) const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 529.

Compare the lua value with the given C string.

bool operator==(double n) const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 531.

Compare the lua value with the given number.

Value operator[](const Value &key) const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 453.

Index operation on a lua userdata or lua table value. The ValueBase::at function is prefered for read access on non-const objects because construction of a ValueRef is not needed.

template <typename T> Value operator[](const T &key) const  

This template function is declared in QtLua/qtluavaluebase.hh source file, line 458.

Index operation on a lua userdata or lua table value. The ValueBase::at function is prefered for read access on non-const objects because construction of a ValueRef is not needed.

ValueRef operator[](const Value &key)  

This function is declared in QtLua/qtluavaluebase.hh source file, line 463.

Index operation on a lua userdata or lua table value. The ValueBase::at function is prefered for read access on non-const objects because construction of a ValueRef is not needed.

template <typename T> ValueRef operator[](const T &key)  

This template function is declared in QtLua/qtluavaluebase.hh source file, line 468.

Index operation on a lua userdata or lua table value. The ValueBase::at function is prefered for read access on non-const objects because construction of a ValueRef is not needed.

ValueBase::List start(const Value &main, const ValueBase::List &args) const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 266.

This function starts execution of a lua thread value. Resume after yield can be performed by invocation of the ValueBase::call function.

bool support(ValueBase::Operation c) const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 511.

Check given operation support.

See also UserData::support function.

void table_shift(int pos, int count, const Value &init, int len = -1)  

This function is declared in QtLua/qtluavaluebase.hh source file, line 507.

Make room in a lua table at given position if count > 0 or remove entries if count < 0.

void table_shift(int pos, int count, int len = -1)  

This function is declared in QtLua/qtluavaluebase.hh source file, line 508.

Make room in a lua table at given position if count > 0 or remove entries if count < 0.

ValueBase::Bool to_boolean() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 304.

Convert a lua value to a boolean. Throw exception if conversion fails.

QByteArray to_bytecode() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 485.

Dump the bytecode for a function object

template <typename X> X * to_class_cast() const  

This template function is declared in QtLua/qtluavaluebase.hh source file, line 422.

Convert a lua value into a Ref pointer to an UserData and perform a dynamic_cast<X*>. Throw exception if either conversion fails, pointer is null or cast fails.

See also ValueBase::to_class_cast_null function.

template <typename X> X * to_class_cast_null() const  

This template function is declared in QtLua/qtluavaluebase.hh source file, line 414.

Convert a lua value into a Ref pointer to an UserData and perform a dynamic_cast<X*>. Throw exception if conversion or cast fails.

See also ValueBase::to_class_cast function.

int to_integer() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 292.

Convert a lua number value to an integer. Throw exception if conversion fails.

double to_number() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 286.

Convert a lua number value to a double. Throw exception if conversion fails.

template <typename Key, typename Val> QHash<Key, Val> to_qhash() const  

This template function is declared in QtLua/qtluavaluebase.hh source file, line 346.

Create a QHash with elements from lua table.

See also Qt/Lua types conversion section.

template <typename X> QList<X> to_qlist() const  

This template function is declared in QtLua/qtluavaluebase.hh source file, line 325.

Create a QList with elements from lua table. Table keys are searched from 1.

See also Qt/Lua types conversion section.

template <typename Key, typename Val> QMap<Key, Val> to_qmap() const  

This template function is declared in QtLua/qtluavaluebase.hh source file, line 356.

Create a QMap with elements from lua table.

See also Qt/Lua types conversion section.

QObject * to_qobject() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 365.

Convert a lua value to a QObject pointer. Throw exception if conversion or cast fails.

See also ValueBase::to_qobject_cast function.

template <typename X> X * to_qobject_cast() const  

This template function is declared in QtLua/qtluavaluebase.hh source file, line 374.

Convert a lua value to a QObject subclass pointer. Subclass must have the Q_OBJECT macro in it's definition. Throw exception if conversion or cast fails.

See also ValueBase::to_qobject function.

QString to_qstring() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 310.

Convert a lua string value to a String object. Throw exception if conversion fails.

QVariant to_qvariant() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 430.

Convert a bool, string or number value to a QVariant. The ValueBase::to_qvariant alternate function can be used to attempt a conversion of the value to a specified registered Qt type.

See also Qt/Lua types conversion section.

QVariant to_qvariant(int qt_type) const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 439.

Convert a lua value to a QVariant. The lua value will be converted to an object of requested Qt type if possible.

See also Qt/Lua types conversion section.

template <typename X> QVector<X> to_qvector() const  

This template function is declared in QtLua/qtluavaluebase.hh source file, line 336.

Create a QVector with elements from lua table. Table keys are searched from 1.

See also Qt/Lua types conversion section.

String to_string() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 309.

Convert a lua string value to a String object. Throw exception if conversion fails.

String to_string_p(bool quote_string = true) const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 316.

Convert any type to a string representation suitable for pretty printing. Never throw.

Ref<UserData> to_userdata() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 382.

Convert a lua value into a Ref pointer to an UserData. Throw exception if conversion fails.

See also ValueBase::to_userdata_cast_null function and ValueBase::to_userdata_cast function.

template <typename X> Ref<X> to_userdata_cast() const  

This template function is declared in QtLua/qtluavaluebase.hh source file, line 402.

Convert a lua value into a Ref pointer to an UserData and dynamic cast to given Ref pointer to requested type. Throw exception if either conversion fails, pointer is null or cast fails.

See also ValueBase::to_userdata function and ValueBase::to_userdata_cast function.

template <typename X> Ref<X> to_userdata_cast_null() const  

This template function is declared in QtLua/qtluavaluebase.hh source file, line 392.

Convert a lua value into a Ref pointer to an UserData and dynamic cast to given Ref pointer to requested type. Throw exception if conversion or cast fails.

See also ValueBase::to_userdata function and ValueBase::to_userdata_cast function.

ValueBase::ValueType type() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 488.

Get lua value type.

String type_name() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 491.

Get value raw lua type name.

static String type_name(ValueBase::ValueType t)  

This function is declared in QtLua/qtluavaluebase.hh source file, line 494.

Get value raw lua type name.

String type_name_u() const  

This function is declared in QtLua/qtluavaluebase.hh source file, line 498.

Get value type name, if the value is a UserData, the type name is extracted using the UserData::get_type_name function.

static double _id_counter  

This variable is for internal use only.

This variable is declared in QtLua/qtluavaluebase.hh source file, line 581.

This member access is protected.

This variable is for internal use only.

This variable is declared in QtLua/qtluavaluebase.hh source file, line 579.

This member access is protected.

void check_state() const  

This function is for internal use only.

This function is declared in QtLua/qtluavaluebase.hh source file, line 576.

This member access is protected.

void convert_error(ValueBase::ValueType type) const  

This function is for internal use only.

This function is declared in QtLua/qtluavaluebase.hh source file, line 574.

This member access is protected.

virtual void push_value(lua_State *st) const = 0;  

This pure virtual function is for internal use only.

This pure virtual function is declared in QtLua/qtluavaluebase.hh source file, line 563.

This member access is protected.

static uint qHash(lua_State *st, int index)  

This function is for internal use only.

This function is declared in QtLua/qtluavaluebase.hh source file, line 571.

This member access is protected.

template <typename HashContainer> HashContainer to_hash() const  

This template function is for internal use only.

This template function is declared in QtLua/qtluavaluebase.hh source file, line 556.

This member access is protected.

template <typename ListContainer> ListContainer to_list() const  

This template function is for internal use only.

This template function is declared in QtLua/qtluavaluebase.hh source file, line 560.

This member access is protected.

static String to_string_p(lua_State *st, int index, bool quote_string)  

This function is for internal use only.

This function is declared in QtLua/qtluavaluebase.hh source file, line 568.

This member access is protected.

virtual Value value() const = 0;  

This pure virtual function is for internal use only.

This pure virtual function is declared in QtLua/qtluavaluebase.hh source file, line 565.

This member access is protected.

Valid XHTML 1.0 StrictGenerated by diaxen on Sat Mar 30 16:23:03 2013 using MkDoc