Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
lua
LuaComponent.hpp
Go to the documentation of this file.
1
/*
2
* Lua-RTT bindings. LuaComponent.
3
*
4
* (C) Copyright 2010 Markus Klotzbuecher
5
* markus.klotzbuecher@mech.kuleuven.be
6
* Department of Mechanical Engineering,
7
* Katholieke Universiteit Leuven, Belgium.
8
*
9
* This library is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU General Public
11
* License as published by the Free Software Foundation;
12
* version 2 of the License.
13
*
14
* As a special exception, you may use this file as part of a free
15
* software library without restriction. Specifically, if other files
16
* instantiate templates or use macros or inline functions from this
17
* file, or you compile this file and link it with other files to
18
* produce an executable, this file does not by itself cause the
19
* resulting executable to be covered by the GNU General Public
20
* License. This exception does not however invalidate any other
21
* reasons why the executable file might be covered by the GNU General
22
* Public License.
23
*
24
* This library is distributed in the hope that it will be useful,
25
* but WITHOUT ANY WARRANTY; without even the implied warranty of
26
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27
* Lesser General Public License for more details.
28
*
29
* You should have received a copy of the GNU General Public
30
* License along with this library; if not, write to the Free Software
31
* Foundation, Inc., 59 Temple Place,
32
* Suite 330, Boston, MA 02111-1307 USA
33
*/
34
35
#ifndef OCL_LUACOMPONENT_HPP
36
#define OCL_LUACOMPONENT_HPP
37
38
#include <string>
39
#include <
rtt/os/Mutex.hpp
>
40
#include <
rtt/TaskContext.hpp
>
41
42
#include "
LuaStateHandle.hpp
"
43
44
struct
lua_State
;
45
#ifdef LUA_RTT_TLSF
46
struct
lua_tlsf_info
;
47
#endif
48
49
namespace
OCL
50
{
51
class
LuaComponent
:
public
RTT::TaskContext
52
{
53
protected
:
54
std::string
lua_string
;
55
std::string
lua_file
;
56
lua_State
*
L
;
57
RTT::os::MutexRecursive
m
;
58
59
public
:
60
LuaComponent
(std::string name);
61
~LuaComponent
();
62
63
bool
exec_file
(
const
std::string &file);
64
bool
exec_str
(
const
std::string &str);
65
66
bool
configureHook
();
67
bool
activateHook
();
68
bool
startHook
();
69
void
updateHook
();
70
void
stopHook
();
71
void
cleanupHook
();
72
void
errorHook
();
73
74
LuaStateHandle
getLuaState
();
75
};
76
77
#if LUA_RTT_TLSF
78
class
LuaTLSFComponent :
public
RTT::TaskContext
79
{
80
protected
:
81
std::string
lua_string
;
82
std::string
lua_file
;
83
lua_State
*
L
;
84
RTT::os::MutexRecursive
m
;
85
struct
lua_tlsf_info
*tlsf_inf;
86
87
public
:
88
LuaTLSFComponent(std::string name);
89
~LuaTLSFComponent();
90
91
bool
tlsf_incmem(
unsigned
int
size);
92
93
bool
exec_file
(
const
std::string &file);
94
bool
exec_str
(
const
std::string &str);
95
96
bool
configureHook
();
97
bool
activateHook
();
98
bool
startHook
();
99
void
updateHook
();
100
void
stopHook
();
101
void
cleanupHook
();
102
void
errorHook
();
103
104
LuaStateHandle
getLuaState
();
105
};
106
#endif // LUA_RTT_TLSF
107
}
// namespace OCL
108
109
#endif // OCL_LUACOMPONENT_HPP
OCL::LuaComponent::exec_str
bool exec_str(const std::string &str)
Definition:
LuaComponent.cpp:137
OCL::LuaComponent::updateHook
void updateHook()
Definition:
LuaComponent.cpp:169
Mutex.hpp
OCL::LuaComponent::stopHook
void stopHook()
Definition:
LuaComponent.cpp:175
OCL::LuaComponent::lua_file
std::string lua_file
Definition:
LuaComponent.hpp:55
OCL::LuaComponent::activateHook
bool activateHook()
Definition:
LuaComponent.cpp:157
OCL::LuaComponent::~LuaComponent
~LuaComponent()
Definition:
LuaComponent.cpp:109
OCL::LuaComponent::LuaComponent
LuaComponent(std::string name)
Definition:
LuaComponent.cpp:56
lua_State
struct lua_State lua_State
Definition:
lua-repl.h:54
OCL::LuaComponent::lua_string
std::string lua_string
Definition:
LuaComponent.hpp:54
OCL
Definition:
deployer-funcs.cpp:68
OCL::LuaComponent
Definition:
LuaComponent.hpp:51
TaskContext.hpp
OCL::LuaComponent::configureHook
bool configureHook()
Definition:
LuaComponent.cpp:147
OCL::LuaComponent::exec_file
bool exec_file(const std::string &file)
Definition:
LuaComponent.cpp:127
RTT::TaskContext
OCL::LuaComponent::cleanupHook
void cleanupHook()
Definition:
LuaComponent.cpp:181
lua_tlsf_info
Definition:
tlsf_rtt.h:10
RTT::os::MutexRecursive
OCL::LuaComponent::errorHook
void errorHook()
Definition:
LuaComponent.cpp:187
LuaStateHandle.hpp
OCL::LuaStateHandle
Definition:
LuaStateHandle.hpp:10
OCL::LuaComponent::startHook
bool startHook()
Definition:
LuaComponent.cpp:163
OCL::LuaComponent::m
RTT::os::MutexRecursive m
Definition:
LuaComponent.hpp:57
OCL::LuaComponent::getLuaState
LuaStateHandle getLuaState()
Definition:
LuaComponent.cpp:193
OCL::LuaComponent::L
lua_State * L
Definition:
LuaComponent.hpp:56
ocl
Author(s): OCL Development Team
autogenerated on Mon Mar 23 2020 04:47:19