get_table_integer_v Subroutine

private subroutine get_table_integer_v(val, ErrCode, L, thandle, key, pos, default)

This routine obtains a vectorial quantity with fixed length from a Lua table as a whole.

It is intented to ease the reading of vectors on the Fortran side by capsulating the parsing of the Lua table internally. Components which are not found are filled with the data given in the default vector. For each component an error code will be returned to indicate the success when reading it. If the vector is not defined at all, all components will be indicated as non-existent. Components, which are neither defined in the Lua script, nor in the default will be marked with the aoterr_Fatal flag.

Arguments

Type IntentOptional AttributesName
integer(kind=int_k), intent(out) :: val(:)

Vector read from the Lua table.

integer, intent(out) :: ErrCode(:)

Error code describing problems encountered in each of the components. This array has to have the same length as val.

type(flu_State) :: L

Handle to the lua script

integer, intent(in), optional :: thandle

Handle of the parent table

character(len=*), intent(in), optional :: key

Name of the variable (vector) to read.

integer, intent(in), optional :: pos

Position of the (vector) to read.

integer(kind=int_k), intent(in), optional :: default(:)

A default vector to use, if no proper definition is found. Components will be filled with the help of this default definition.


Calls

proc~~get_table_integer_v~~CallsGraph proc~get_table_integer_v get_table_integer_v proc~aot_type_of aot_type_of proc~get_table_integer_v->proc~aot_type_of interface~aot_top_get_val~2 aot_top_get_val proc~get_table_integer_v->interface~aot_top_get_val~2 proc~aot_table_push aot_table_push proc~aot_type_of->proc~aot_table_push proc~flu_type flu_type proc~aot_type_of->proc~flu_type proc~flu_getglobal flu_getglobal proc~aot_type_of->proc~flu_getglobal proc~get_top_extdouble_v get_top_extdouble_v interface~aot_top_get_val~2->proc~get_top_extdouble_v proc~aot_table_push->proc~flu_type proc~aot_table_push->proc~flu_getglobal proc~flu_pushnil flu_pushnil proc~aot_table_push->proc~flu_pushnil proc~flu_gettable flu_gettable proc~aot_table_push->proc~flu_gettable interface~flu_pushinteger flu_pushinteger proc~aot_table_push->interface~flu_pushinteger proc~flu_getfield flu_getfield proc~aot_table_push->proc~flu_getfield proc~flu_pop flu_pop proc~aot_table_push->proc~flu_pop proc~aot_table_length aot_table_length proc~get_top_extdouble_v->proc~aot_table_length proc~aot_table_top aot_table_top proc~get_top_extdouble_v->proc~aot_table_top proc~flu_next flu_next proc~get_top_extdouble_v->proc~flu_next proc~aot_table_first aot_table_first proc~get_top_extdouble_v->proc~aot_table_first proc~aot_table_close aot_table_close proc~get_top_extdouble_v->proc~aot_table_close interface~aot_top_get_val aot_top_get_val proc~get_top_extdouble_v->interface~aot_top_get_val interface~lua_type lua_type proc~flu_type->interface~lua_type interface~lua_getglobal lua_getglobal proc~flu_getglobal->interface~lua_getglobal interface~lua_pushnil lua_pushnil proc~flu_pushnil->interface~lua_pushnil interface~lua_gettable lua_gettable proc~flu_gettable->interface~lua_gettable proc~aot_table_length->proc~flu_next proc~aot_table_length->proc~aot_table_first proc~aot_table_length->proc~flu_pop proc~aot_table_top->proc~flu_pop proc~flu_gettop flu_gettop proc~aot_table_top->proc~flu_gettop proc~flu_istable flu_isTable proc~aot_table_top->proc~flu_istable interface~lua_next lua_next proc~flu_next->interface~lua_next proc~aot_table_first->proc~flu_pushnil proc~aot_table_first->proc~flu_next proc~flu_pushint flu_pushint interface~flu_pushinteger->proc~flu_pushint proc~flu_pushlong flu_pushlong interface~flu_pushinteger->proc~flu_pushlong proc~flu_settop flu_settop proc~aot_table_close->proc~flu_settop interface~lua_getfield lua_getfield proc~flu_getfield->interface~lua_getfield interface~lua_settop lua_settop proc~flu_pop->interface~lua_settop proc~aot_top_get_double aot_top_get_double interface~aot_top_get_val->proc~aot_top_get_double proc~aot_top_get_userdata aot_top_get_userdata interface~aot_top_get_val->proc~aot_top_get_userdata proc~aot_top_get_integer aot_top_get_integer interface~aot_top_get_val->proc~aot_top_get_integer proc~aot_top_get_logical aot_top_get_logical interface~aot_top_get_val->proc~aot_top_get_logical proc~aot_top_get_long aot_top_get_long interface~aot_top_get_val->proc~aot_top_get_long proc~aot_top_get_real aot_top_get_real interface~aot_top_get_val->proc~aot_top_get_real proc~aot_top_get_string aot_top_get_string interface~aot_top_get_val->proc~aot_top_get_string proc~aot_top_get_double->proc~flu_pop proc~flu_isnumber flu_isnumber proc~aot_top_get_double->proc~flu_isnumber proc~flu_isnoneornil flu_isNoneOrNil proc~aot_top_get_double->proc~flu_isnoneornil proc~flu_todouble flu_todouble proc~aot_top_get_double->proc~flu_todouble interface~lua_gettop lua_gettop proc~flu_gettop->interface~lua_gettop proc~flu_istable->interface~lua_type interface~lua_pushinteger lua_pushinteger proc~flu_pushint->interface~lua_pushinteger proc~aot_top_get_userdata->proc~flu_pop proc~flu_touserdata flu_touserdata proc~aot_top_get_userdata->proc~flu_touserdata proc~aot_top_get_userdata->proc~flu_isnoneornil proc~flu_islightuserdata flu_islightuserdata proc~aot_top_get_userdata->proc~flu_islightuserdata proc~aot_top_get_integer->proc~flu_pop proc~aot_top_get_integer->proc~flu_isnumber proc~aot_top_get_integer->proc~flu_isnoneornil proc~aot_top_get_integer->proc~flu_todouble proc~aot_top_get_logical->proc~flu_pop proc~flu_toboolean flu_toBoolean proc~aot_top_get_logical->proc~flu_toboolean proc~flu_isboolean flu_isBoolean proc~aot_top_get_logical->proc~flu_isboolean proc~aot_top_get_logical->proc~flu_isnoneornil proc~aot_top_get_long->proc~flu_pop proc~aot_top_get_long->proc~flu_isnumber proc~aot_top_get_long->proc~flu_isnoneornil proc~aot_top_get_long->proc~flu_todouble proc~flu_settop->interface~lua_settop proc~aot_top_get_real->proc~flu_pop proc~aot_top_get_real->proc~flu_isnumber proc~aot_top_get_real->proc~flu_isnoneornil proc~flu_tonumber flu_tonumber proc~aot_top_get_real->proc~flu_tonumber proc~aot_top_get_string->proc~flu_pop proc~flu_tolstring flu_tolstring proc~aot_top_get_string->proc~flu_tolstring proc~aot_top_get_string->proc~flu_isnoneornil proc~flu_isstring flu_isString proc~aot_top_get_string->proc~flu_isstring proc~flu_pushlong->interface~lua_pushinteger interface~lua_toboolean lua_toboolean proc~flu_toboolean->interface~lua_toboolean interface~lua_isnumber lua_isNumber proc~flu_isnumber->interface~lua_isnumber interface~lua_touserdata lua_touserdata proc~flu_touserdata->interface~lua_touserdata proc~flu_isboolean->interface~lua_type interface~lua_tolstring lua_tolstring proc~flu_tolstring->interface~lua_tolstring proc~flu_isnoneornil->interface~lua_type proc~flu_islightuserdata->interface~lua_type interface~lua_tonumberx lua_tonumberx proc~flu_todouble->interface~lua_tonumberx interface~lua_isstring lua_isString proc~flu_isstring->interface~lua_isstring proc~flu_tonumber->interface~lua_tonumberx

Called by

proc~~get_table_integer_v~~CalledByGraph proc~get_table_integer_v get_table_integer_v interface~aot_get_val~2 aot_get_val interface~aot_get_val~2->proc~get_table_integer_v interface~aot_table_get_val~5 aot_table_get_val interface~aot_table_get_val~5->proc~get_table_integer_v

Contents

Source Code


Source Code

  subroutine get_table_integer_v(val, ErrCode, L, thandle, key, &
    &                         pos, default)
    type(flu_State) :: L !! Handle to the lua script
    integer, intent(in), optional :: thandle !! Handle of the parent table

    !> Vector read from the Lua table.
    integer(kind=int_k), intent(out) :: val(:)

    !> Error code describing problems encountered in each of the components.
    !! This array has to have the same length as val.
    integer, intent(out) :: ErrCode(:)

    !> Name of the variable (vector) to read.
    character(len=*), intent(in), optional :: key

    !> Position of the (vector) to read.
    integer, intent(in), optional :: pos

    !> A default vector to use, if no proper definition is found.
    !! Components will be filled with the help of this default definition.
    integer(kind=int_k), intent(in), optional :: default(:)

    integer :: toptype

    toptype = aot_type_of(L       = L,       &
      &                   thandle = thandle, &
      &                   key     = key,     &
      &                   pos     = pos      )

    if (toptype /= FLU_TNONE) then
      call aot_top_get_val(val, ErrCode, L, default)
    else
      ErrCode = ibSet(0, aoterr_NonExistent)
      ErrCode = ibSet(ErrCode, aoterr_Fatal)
    end if

  end subroutine get_table_integer_v