SimpleFastOpenAtomicVisualiser
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
LuaVec Struct Reference

Interop for a variable size numeric array (vector) in Lua. More...

#include <LuaVec.h>

Public Member Functions

 LuaVec ()
 Construct an empty vector.
 
void read (lua_State *lua, int index)
 Read the vector from stack index index.
 
bool readField (lua_State *lua, const char *name)
 Read the vector from a table field.
 
bool readGlobal (lua_State *lua, const char *name)
 Read the vector from a global table field.
 
doubleoperator[] (size_t i)
 
size_t size () const
 
 operator std::vector< double > ()
 

Public Attributes

std::vector< doubleelements
 

Detailed Description

Interop for a variable size numeric array (vector) in Lua.

Constructor & Destructor Documentation

◆ LuaVec()

LuaVec::LuaVec ( )
inline

Construct an empty vector.

Member Function Documentation

◆ operator std::vector< double >()

LuaVec::operator std::vector< double > ( )
inline

◆ operator[]()

double & LuaVec::operator[] ( size_t  i)
inline

◆ read()

void LuaVec::read ( lua_State lua,
int  index 
)
inline

Read the vector from stack index index.

Parameters
luathe Lua context.
indexthe stack index.

◆ readField()

bool LuaVec::readField ( lua_State lua,
const char name 
)
inline

Read the vector from a table field.

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

◆ readGlobal()

bool LuaVec::readGlobal ( lua_State lua,
const char name 
)
inline

Read the vector from a global table field.

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

◆ size()

size_t LuaVec::size ( ) const
inline

Member Data Documentation

◆ elements

std::vector<double> LuaVec::elements

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