Bomberman
Public Member Functions | Private Attributes | List of all members
LuaG::State Class Reference

#include <LuaGate.hpp>

Collaboration diagram for LuaG::State:

Public Member Functions

 State ()
 ctor More...
 
 State (lua_State *L, bool shouldClose=false)
 ctor More...
 
 ~State ()
 dtor More...
 
 State (const State &)=delete
 No copy constrructor. More...
 
Stateoperator= (const State &)=delete
 No assign operator. More...
 
lua_State * getState (void)
 Get Lua state. More...
 
void getGlobal (std::string str)
 Get global value on top of the stack. More...
 
void dofile (std::string filepath)
 Execute a file in this state. More...
 
void dostring (std::string str)
 Execute a string in this state. More...
 
float getReturnNumber (void)
 Get return Number. More...
 
bool getReturnBool (void)
 Get return Number. More...
 
bool getBool (int index)
 Get bool at index in the stack. More...
 
float getNumber (int index)
 Get Number at index in the stack. More...
 
const void * getPointer (int index)
 Get Number at index in the stack. More...
 
int getFirstUpValueIdx (void)
 Get first upvalue index. More...
 
bool callFunction (int nbParams, int nbReturns)
 call a lua function More...
 
void setTable (void)
 setTable More...
 
void push (float val)
 push a number onto the lua stack More...
 
void push (std::string str)
 push a string onto the lua stack More...
 
void newTable (void)
 Creates a new table at the top of the stack. More...
 
void popLast (void)
 Pop last value on the stack. More...
 
void registerClosure (void *ptr, std::string funcName, lua_CFunction fn)
 

Private Attributes

lua_State * _state
 Lua state. More...
 
bool _shouldClose
 Should close the state at destruction. More...
 

Constructor & Destructor Documentation

◆ State() [1/3]

LuaG::State::State ( )

ctor

◆ State() [2/3]

LuaG::State::State ( lua_State *  L,
bool  shouldClose = false 
)

ctor

◆ ~State()

LuaG::State::~State ( )

dtor

◆ State() [3/3]

LuaG::State::State ( const State )
delete

No copy constrructor.

Member Function Documentation

◆ callFunction()

bool LuaG::State::callFunction ( int  nbParams,
int  nbReturns 
)

call a lua function

◆ dofile()

void LuaG::State::dofile ( std::string  filepath)

Execute a file in this state.

◆ dostring()

void LuaG::State::dostring ( std::string  str)

Execute a string in this state.

◆ getBool()

bool LuaG::State::getBool ( int  index)

Get bool at index in the stack.

◆ getFirstUpValueIdx()

int LuaG::State::getFirstUpValueIdx ( void  )

Get first upvalue index.

◆ getGlobal()

void LuaG::State::getGlobal ( std::string  str)

Get global value on top of the stack.

◆ getNumber()

float LuaG::State::getNumber ( int  index)

Get Number at index in the stack.

◆ getPointer()

const void * LuaG::State::getPointer ( int  index)

Get Number at index in the stack.

◆ getReturnBool()

bool LuaG::State::getReturnBool ( void  )

Get return Number.

◆ getReturnNumber()

float LuaG::State::getReturnNumber ( void  )

Get return Number.

◆ getState()

lua_State * LuaG::State::getState ( void  )

Get Lua state.

◆ newTable()

void LuaG::State::newTable ( void  )

Creates a new table at the top of the stack.

◆ operator=()

State& LuaG::State::operator= ( const State )
delete

No assign operator.

◆ popLast()

void LuaG::State::popLast ( void  )

Pop last value on the stack.

◆ push() [1/2]

void LuaG::State::push ( float  val)

push a number onto the lua stack

◆ push() [2/2]

void LuaG::State::push ( std::string  str)

push a string onto the lua stack

◆ registerClosure()

void LuaG::State::registerClosure ( void *  ptr,
std::string  funcName,
lua_CFunction  fn 
)

◆ setTable()

void LuaG::State::setTable ( void  )

setTable

Member Data Documentation

◆ _shouldClose

bool LuaG::State::_shouldClose
private

Should close the state at destruction.

◆ _state

lua_State* LuaG::State::_state
private

Lua state.


The documentation for this class was generated from the following files: