SimpleFastOpenAtomicVisualiser
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
LuaArray< DIM > Struct Template Reference

Interop for a fixed size numeric array in Lua. More...

#include <LuaArray.h>

Public Member Functions

 LuaArray ()
 Construct an array of 0s.
 
void read (lua_State *lua, int index)
 Read the array from stack index index.
 
bool readField (lua_State *lua, const char *name)
 Read the array from a table field.
 
bool readGlobal (lua_State *lua, const char *name)
 Read the array from a global table field.
 
doubleoperator[] (size_t i)
 
 operator std::array< double, DIM > ()
 

Public Attributes

std::array< double, DIMelements
 

Detailed Description

template<size_t DIM>
struct LuaArray< DIM >

Interop for a fixed size numeric array in Lua.

Template Parameters
DIMthe array's size.

Constructor & Destructor Documentation

◆ LuaArray()

template<size_t DIM>
LuaArray< DIM >::LuaArray ( )
inline

Construct an array of 0s.

Member Function Documentation

◆ operator std::array< double, DIM >()

template<size_t DIM>
LuaArray< DIM >::operator std::array< double, DIM > ( )
inline

◆ operator[]()

template<size_t DIM>
double & LuaArray< DIM >::operator[] ( size_t  i)
inline

◆ read()

template<size_t DIM>
void LuaArray< DIM >::read ( lua_State lua,
int  index 
)
inline

Read the array from stack index index.

Parameters
luathe Lua context.
indexthe stack index.

◆ readField()

template<size_t DIM>
bool LuaArray< DIM >::readField ( lua_State lua,
const char name 
)
inline

Read the array from a table field.

Parameters
luathe Lua context.
namethe field name.
Returns
true succesful read.
false unsuccesful read.

◆ readGlobal()

template<size_t DIM>
bool LuaArray< DIM >::readGlobal ( lua_State lua,
const char name 
)
inline

Read the array from a global table field.

Parameters
luathe Lua context.
namethe field name.
Returns
true succesful read.
false unsuccesful read.

Member Data Documentation

◆ elements

template<size_t DIM>
std::array<double, DIM> LuaArray< DIM >::elements

The documentation for this struct was generated from the following file: