Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
orxonox::LuaState Class Reference

Representation of an interface to lua. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/core/LuaState.h>

Public Member Functions

 LuaState ()
 
 ~LuaState ()
 
void clearOutput ()
 
LuaFunctorcreateLuaFunctor (const std::string &code)
 
bool doFile (const std::string &filename)
 
bool doString (const std::string &code, const std::shared_ptr< ResourceInfo > &sourceFileInfo=std::shared_ptr< ResourceInfo >())
 
bool fileExists (const std::string &filename)
 
const std::shared_ptr< ResourceInfo > & getDefaultResourceInfo ()
 
lua_State * getInternalLuaState ()
 
const std::stringstream & getOutput () const
 
std::string getSourceCode (const std::string &filename)
 Returns the content of a file. More...
 
bool includeFile (const std::string &filename)
 
bool includeString (const std::string &code, const std::shared_ptr< ResourceInfo > &sourceFileInfo=std::shared_ptr< ResourceInfo >())
 
void luaOutput (orxonox::level::OutputLevel level, const std::string &context, const std::string &message)
 
void luaOutput (orxonox::level::OutputLevel level, const std::string &message)
 
void luaOutput (const std::string &message)
 
void luaPrint (const std::string &str)
 
void setDefaultResourceInfo (const std::shared_ptr< ResourceInfo > &sourceFileInfo)
 
void setIncludeParser (std::string(*function)(const std::string &))
 
void setTraceMap (std::shared_ptr< std::vector< std::vector< std::pair< std::string, size_t >>>> map)
 
bool usingIOConsole () const
 Tells about whether IOConsole was activated. The Lua debugger only works with a normal console. More...
 

Static Public Member Functions

static bool addToluaInterface (int(*function)(lua_State *), const std::string &name)
 
static void closeToluaInterfaces (lua_State *state)
 
static void openToluaInterfaces (lua_State *state)
 
static bool removeToluaInterface (const std::string &name)
 

Static Public Attributes

static const std::string ERROR_HANDLER_NAME = "errorHandler"
 

Private Types

typedef std::map< std::string, int(*)(lua_State *L)> ToluaInterfaceMap
 

Private Member Functions

std::shared_ptr< ResourceInfogetFileInfo (const std::string &filename)
 

Static Private Member Functions

static std::vector< LuaState * > & getInstances ()
 
static ToluaInterfaceMapgetToluaInterfaces ()
 

Private Attributes

bool bIsRunning_
 
std::string(* includeParseFunction_ )(const std::string &)
 
std::shared_ptr< std::vector< std::vector< std::pair< std::string, size_t > > > > lineTrace_
 
lua_State * luaState_
 
std::stringstream output_
 
std::map< std::string, std::string > sourceCodeMap_
 
std::shared_ptr< ResourceInfosourceFileInfo_
 

Detailed Description

Representation of an interface to lua.

Member Typedef Documentation

typedef std::map<std::string, int (*)(lua_State *L)> orxonox::LuaState::ToluaInterfaceMap
private

Constructor & Destructor Documentation

orxonox::LuaState::LuaState ( )
orxonox::LuaState::~LuaState ( )

Member Function Documentation

bool orxonox::LuaState::addToluaInterface ( int(*)(lua_State *)  function,
const std::string &  name 
)
static
void orxonox::LuaState::clearOutput ( )
inline
void orxonox::LuaState::closeToluaInterfaces ( lua_State *  state)
static
LuaFunctor* orxonox::LuaState::createLuaFunctor ( const std::string &  code)
inline
bool orxonox::LuaState::doFile ( const std::string &  filename)
bool orxonox::LuaState::doString ( const std::string &  code,
const std::shared_ptr< ResourceInfo > &  sourceFileInfo = std::shared_ptr<ResourceInfo>() 
)
bool orxonox::LuaState::fileExists ( const std::string &  filename)
const std::shared_ptr<ResourceInfo>& orxonox::LuaState::getDefaultResourceInfo ( )
inline
std::shared_ptr< ResourceInfo > orxonox::LuaState::getFileInfo ( const std::string &  filename)
private
std::vector< LuaState * > & orxonox::LuaState::getInstances ( )
staticprivate
lua_State* orxonox::LuaState::getInternalLuaState ( )
inline
const std::stringstream& orxonox::LuaState::getOutput ( ) const
inline
std::string orxonox::LuaState::getSourceCode ( const std::string &  filename)

Returns the content of a file.

LuaState::ToluaInterfaceMap & orxonox::LuaState::getToluaInterfaces ( )
staticprivate
bool orxonox::LuaState::includeFile ( const std::string &  filename)
bool orxonox::LuaState::includeString ( const std::string &  code,
const std::shared_ptr< ResourceInfo > &  sourceFileInfo = std::shared_ptr<ResourceInfo>() 
)
void orxonox::LuaState::luaOutput ( orxonox::level::OutputLevel  level,
const std::string &  context,
const std::string &  message 
)
void orxonox::LuaState::luaOutput ( orxonox::level::OutputLevel  level,
const std::string &  message 
)
void orxonox::LuaState::luaOutput ( const std::string &  message)
void orxonox::LuaState::luaPrint ( const std::string &  str)
void orxonox::LuaState::openToluaInterfaces ( lua_State *  state)
static
bool orxonox::LuaState::removeToluaInterface ( const std::string &  name)
static
void orxonox::LuaState::setDefaultResourceInfo ( const std::shared_ptr< ResourceInfo > &  sourceFileInfo)
inline
void orxonox::LuaState::setIncludeParser ( std::string(*)(const std::string &)  function)
inline
void orxonox::LuaState::setTraceMap ( std::shared_ptr< std::vector< std::vector< std::pair< std::string, size_t >>>>  map)
inline
bool orxonox::LuaState::usingIOConsole ( ) const

Tells about whether IOConsole was activated. The Lua debugger only works with a normal console.

Member Data Documentation

bool orxonox::LuaState::bIsRunning_
private
const std::string orxonox::LuaState::ERROR_HANDLER_NAME = "errorHandler"
static
std::string(* orxonox::LuaState::includeParseFunction_) (const std::string &)
private
std::shared_ptr<std::vector<std::vector<std::pair<std::string, size_t> > > > orxonox::LuaState::lineTrace_
private
lua_State* orxonox::LuaState::luaState_
private
std::stringstream orxonox::LuaState::output_
private
std::map<std::string, std::string> orxonox::LuaState::sourceCodeMap_
private
std::shared_ptr<ResourceInfo> orxonox::LuaState::sourceFileInfo_
private

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