OpenWalnut  1.4.0
Public Member Functions | Private Attributes
WScriptEngine Class Reference

The script engine. More...

#include <WScriptEngine.h>

List of all members.

Public Member Functions

 WScriptEngine (boost::shared_ptr< WModuleContainer > const &rootContainer)
 Constructs a new script engine.
virtual ~WScriptEngine ()
 Destructor.
boost::shared_ptr
< WScriptInterpreter
getInterpreterByFileExtension (std::string const &ext)
 This finds an interpreter suitable for executing script files ending with the given extension.
boost::shared_ptr
< WScriptInterpreter
getInterpreter (std::string const &name)
 This finds an interpreter by script language name.
std::size_t getNumInterpreters () const
 Get the number of script interpreters available.
boost::shared_ptr
< WScriptInterpreter
getInterpreter (std::size_t index)
 Get the i'th script interpreter.

Private Attributes

std::vector< boost::shared_ptr
< WScriptInterpreter > > 
m_interpreters
 The list of available script interpreters.

Detailed Description

The script engine.

Provides all script interpreters available for the OpenWalnut installation. Which interpreters are available depends on the libs available at OpenWalnut build time.

Definition at line 41 of file WScriptEngine.h.


Constructor & Destructor Documentation

WScriptEngine::WScriptEngine ( boost::shared_ptr< WModuleContainer > const &  rootContainer) [explicit]

Constructs a new script engine.

Parameters:
rootContainerThe root module container to use for modules inserted via scripts.

Definition at line 31 of file WScriptEngine.cpp.

References m_interpreters.

Destructor.

Definition at line 44 of file WScriptEngine.cpp.


Member Function Documentation

boost::shared_ptr< WScriptInterpreter > WScriptEngine::getInterpreter ( std::string const &  name)

This finds an interpreter by script language name.

Parameters:
nameThe name of the script language.
Returns:
The matching script interpreter or a NULL-pointer, if no such interpreter was available.

Definition at line 60 of file WScriptEngine.cpp.

References m_interpreters.

boost::shared_ptr< WScriptInterpreter > WScriptEngine::getInterpreter ( std::size_t  index)

Get the i'th script interpreter.

Parameters:
indexThe index of the script interpreter to retrieve, must be in [0,getNumInterpreters()-1].
Returns:
The script interpreter or a NULL-pointer if the index was invalid.

Definition at line 77 of file WScriptEngine.cpp.

References m_interpreters.

boost::shared_ptr< WScriptInterpreter > WScriptEngine::getInterpreterByFileExtension ( std::string const &  ext)

This finds an interpreter suitable for executing script files ending with the given extension.

Parameters:
extThe extension of the script file to execute.
Returns:
The matching script interpreter or a NULL-pointer, if no such interpreter was available.

Definition at line 48 of file WScriptEngine.cpp.

References m_interpreters.

std::size_t WScriptEngine::getNumInterpreters ( ) const

Get the number of script interpreters available.

Returns:
The number of available script interpreters.

Definition at line 72 of file WScriptEngine.cpp.

References m_interpreters.


Member Data Documentation

std::vector< boost::shared_ptr< WScriptInterpreter > > WScriptEngine::m_interpreters [private]

The list of available script interpreters.

Definition at line 92 of file WScriptEngine.h.

Referenced by getInterpreter(), getInterpreterByFileExtension(), getNumInterpreters(), and WScriptEngine().


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