rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes
LuaHandle Class Referencefinal

#include <rusefi_lua.h>

Collaboration diagram for LuaHandle:
Collaboration graph
[legend]

Public Member Functions

 LuaHandle ()
 
 LuaHandle (lua_State *ptr)
 
 LuaHandle (const LuaHandle &)=delete
 
LuaHandleoperator= (const LuaHandle &)=delete
 
 LuaHandle (LuaHandle &&rhs)
 
LuaHandleoperator= (LuaHandle &&rhs)
 
 ~LuaHandle ()
 
 operator lua_State * () const
 

Private Attributes

lua_State * m_ptr
 

Detailed Description

Definition at line 7 of file rusefi_lua.h.

Constructor & Destructor Documentation

◆ LuaHandle() [1/4]

LuaHandle::LuaHandle ( )
inline

Definition at line 9 of file rusefi_lua.h.

9: LuaHandle(nullptr) { }

◆ LuaHandle() [2/4]

LuaHandle::LuaHandle ( lua_State *  ptr)
inline

Definition at line 10 of file rusefi_lua.h.

10: m_ptr(ptr) { }
lua_State * m_ptr
Definition rusefi_lua.h:41

◆ LuaHandle() [3/4]

LuaHandle::LuaHandle ( const LuaHandle )
delete

◆ LuaHandle() [4/4]

LuaHandle::LuaHandle ( LuaHandle &&  rhs)
inline

Definition at line 17 of file rusefi_lua.h.

17 {
18 m_ptr = rhs.m_ptr;
19 rhs.m_ptr = nullptr;
20 }

◆ ~LuaHandle()

LuaHandle::~LuaHandle ( )
inline

Definition at line 31 of file rusefi_lua.h.

31 {
32 if (m_ptr) {
33 efiPrintf("LUA: Tearing down instance...");
34 lua_close(m_ptr);
35 }
36 }

Member Function Documentation

◆ operator lua_State *()

LuaHandle::operator lua_State * ( ) const
inline

Definition at line 38 of file rusefi_lua.h.

38{ return m_ptr; }

◆ operator=() [1/2]

LuaHandle & LuaHandle::operator= ( const LuaHandle )
delete

◆ operator=() [2/2]

LuaHandle & LuaHandle::operator= ( LuaHandle &&  rhs)
inline

Definition at line 23 of file rusefi_lua.h.

23 {
24 m_ptr = rhs.m_ptr;
25 rhs.m_ptr = nullptr;
26
27 return *this;
28 }

Field Documentation

◆ m_ptr

lua_State* LuaHandle::m_ptr
private

Definition at line 41 of file rusefi_lua.h.

Referenced by LuaHandle(), operator lua_State *(), operator=(), and ~LuaHandle().


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