Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
lua
LuaStateHandle.cpp
Go to the documentation of this file.
1
#include "
LuaStateHandle.hpp
"
2
3
namespace
OCL
4
{
5
6
LuaStateHandle::LuaStateHandle
()
7
: L(0), m(0)
8
{}
9
10
LuaStateHandle::LuaStateHandle
(
lua_State
*
L
,
RTT::os::MutexInterface
&mutex)
11
: L(L),
m
(&mutex)
12
{
13
m
->
lock
();
14
}
15
16
LuaStateHandle::LuaStateHandle
(
const
LuaStateHandle
&
other
)
17
:
L
(other.
L
),
m
(other.
m
)
18
{
19
// take ownership of the mutex lock
20
other.
m
= 0;
21
}
22
23
LuaStateHandle::~LuaStateHandle
()
24
{
25
if
(
m
)
m
->
unlock
();
26
}
27
28
LuaStateHandle
&
LuaStateHandle::operator=
(
const
LuaStateHandle
&
other
)
29
{
30
if
(
this
== &other)
return
*
this
;
31
if
(
m
)
m
->
unlock
();
32
33
this->
L
= other.
L
;
34
this->
m
= other.
m
;
35
36
// take ownership of the mutex lock
37
other.
m
= 0;
38
39
return
*
this
;
40
}
41
42
lua_State
*
LuaStateHandle::get
()
const
43
{
44
return
L
;
45
}
46
47
}
// namespace OCL
OCL::LuaStateHandle::~LuaStateHandle
~LuaStateHandle()
Definition:
LuaStateHandle.cpp:23
OCL::LuaStateHandle::get
lua_State * get() const
Definition:
LuaStateHandle.cpp:42
RTT::os::MutexInterface::lock
virtual void lock()=0
OCL::LuaStateHandle::L
lua_State * L
Definition:
LuaStateHandle.hpp:13
lua_State
struct lua_State lua_State
Definition:
lua-repl.h:54
OCL::LuaStateHandle::LuaStateHandle
LuaStateHandle()
Definition:
LuaStateHandle.cpp:6
OCL
Definition:
deployer-funcs.cpp:68
other
rt_allocator< U > other
OCL::LuaStateHandle::operator=
LuaStateHandle & operator=(const LuaStateHandle &)
Definition:
LuaStateHandle.cpp:28
LuaStateHandle.hpp
OCL::LuaStateHandle
Definition:
LuaStateHandle.hpp:10
OCL::LuaStateHandle::m
RTT::os::MutexInterface * m
Definition:
LuaStateHandle.hpp:14
RTT::os::MutexInterface
RTT::os::MutexInterface::unlock
virtual void unlock()=0
ocl
Author(s): OCL Development Team
autogenerated on Wed Jun 26 2019 19:26:27