A model for the Lua debug state. More...
#include <debug.hpp>
Classes | |
struct | impl |
Internal implementation for lutok::debug. More... |
Public Member Functions | |
debug (void) | |
Constructor for an empty debug structure. | |
~debug (void) | |
Destructor. | |
void | get_info (state &, const std::string &) |
Wrapper around lua_getinfo. | |
void | get_stack (state &, const int) |
Wrapper around lua_getstack. | |
int | event (void) const |
Accessor for the 'event' field of lua_Debug. | |
std::string | name (void) const |
Accessor for the 'name' field of lua_Debug. | |
std::string | name_what (void) const |
Accessor for the 'namewhat' field of lua_Debug. | |
std::string | what (void) const |
Accessor for the 'what' field of lua_Debug. | |
std::string | source (void) const |
Accessor for the 'source' field of lua_Debug. | |
int | current_line (void) const |
Accessor for the 'currentline' field of lua_Debug. | |
int | n_ups (void) const |
Accessor for the 'nups' field of lua_Debug. | |
int | line_defined (void) const |
Accessor for the 'linedefined' field of lua_Debug. | |
int | last_line_defined (void) const |
Accessor for the 'lastlinedefined' field of lua_Debug. | |
std::string | short_src (void) const |
Accessor for the 'short_src' field of lua_Debug. |
Private Attributes | |
std::tr1::shared_ptr< impl > | _pimpl |
Pointer to the shared internal implementation. |
A model for the Lua debug state.
This extremely-simple class provides a mechanism to hide the internals of the C native lua_Debug type, exposing its internal fields using friendlier C++ types.
This class also acts as a complement to the state class by exposing any state-related functions as methods of this function. For example, while it might seem that get_info() belongs in state, we expose it from here because its result is really mutating a debug object, not the state object.
int lutok::debug::current_line | ( | void | ) | const |
Accessor for the 'currentline' field of lua_Debug.
int lutok::debug::event | ( | void | ) | const |
Accessor for the 'event' field of lua_Debug.
void lutok::debug::get_info | ( | state & | s, |
const std::string & | what_ | ||
) |
Wrapper around lua_getinfo.
s | The Lua state. |
what_ | The second parameter to lua_getinfo. |
void lutok::debug::get_stack | ( | state & | s, |
const int | level | ||
) |
Wrapper around lua_getstack.
s | The Lua state. |
level | The second parameter to lua_getstack. |
int lutok::debug::last_line_defined | ( | void | ) | const |
Accessor for the 'lastlinedefined' field of lua_Debug.
int lutok::debug::line_defined | ( | void | ) | const |
Accessor for the 'linedefined' field of lua_Debug.
int lutok::debug::n_ups | ( | void | ) | const |
Accessor for the 'nups' field of lua_Debug.
std::string lutok::debug::name | ( | void | ) | const |
Accessor for the 'name' field of lua_Debug.
std::string lutok::debug::name_what | ( | void | ) | const |
Accessor for the 'namewhat' field of lua_Debug.
std::string lutok::debug::short_src | ( | void | ) | const |
Accessor for the 'short_src' field of lua_Debug.
std::string lutok::debug::source | ( | void | ) | const |
Accessor for the 'source' field of lua_Debug.
std::string lutok::debug::what | ( | void | ) | const |
Accessor for the 'what' field of lua_Debug.