te::vm::python::VirtualMachine Class Reference

#include <VirtualMachine.h>

Inheritance diagram for te::vm::python::VirtualMachine:
te::vm::core::VirtualMachine QObject

Public Slots

void execute ()
 
void readline (QString msg)
 
void stop ()
 
void write (const QString &str)
 

Signals

void output (QString msg)
 output Signal emmited when the Virtual Machine receives a string. More...
 
void requestReadline ()
 Signal emmited when the Virtual Machine needs to execute a input operation. More...
 

Public Member Functions

std::string getDescription () const
 Returns a brief description about the underlying Virtual Machine. More...
 
std::string getName () const
 
std::string getTitle () const
 Return the title of Virtual Machine: a name that can be used by applications to show in a GUI. More...
 
std::string readline ()
 readline Method to be used by the language of the Virtual Machine when doing a input operation. More...
 
void setFileName (QString file)
 setFileName Sets the file that will be used in the Virtual Machine. More...
 
 VirtualMachine ()
 
 ~VirtualMachine ()
 Virtual destructor. More...
 

Private Attributes

std::string m_filename
 
PyThreadState * m_mainThreadState
 
QEventLoop * m_readlineLoop
 
std::string m_readlineStr
 
VirtualMachineOutput m_stderr
 
VirtualMachineInput m_stdin
 
VirtualMachineOutput m_stdout
 

Detailed Description

Definition at line 81 of file python/VirtualMachine.h.

Constructor & Destructor Documentation

te::vm::python::VirtualMachine::VirtualMachine ( )
te::vm::python::VirtualMachine::~VirtualMachine ( )
virtual

Virtual destructor.

Reimplemented from te::vm::core::VirtualMachine.

Definition at line 87 of file python/VirtualMachine.cpp.

References m_mainThreadState, and m_readlineLoop.

Member Function Documentation

void te::vm::python::VirtualMachine::execute ( )
slot
std::string te::vm::python::VirtualMachine::getDescription ( ) const
virtual

Returns a brief description about the underlying Virtual Machine.

Implements te::vm::core::VirtualMachine.

Definition at line 187 of file python/VirtualMachine.cpp.

References TE_TR.

std::string te::vm::python::VirtualMachine::getName ( ) const
virtual

the name of the Virtual Machine: it is also an identifier about the VM type.

Implements te::vm::core::VirtualMachine.

Definition at line 174 of file python/VirtualMachine.cpp.

std::string te::vm::python::VirtualMachine::getTitle ( ) const
virtual

Return the title of Virtual Machine: a name that can be used by applications to show in a GUI.

Implements te::vm::core::VirtualMachine.

Definition at line 179 of file python/VirtualMachine.cpp.

References TE_TR.

void te::vm::core::VirtualMachine::output ( QString  msg)
signalinherited

output Signal emmited when the Virtual Machine receives a string.

Parameters
msgString received from the Virtual Machine.

Referenced by te::vm::lua::VirtualMachine::execute(), te::vm::lua::VirtualMachine::write(), and write().

std::string te::vm::python::VirtualMachine::readline ( )
virtual

readline Method to be used by the language of the Virtual Machine when doing a input operation.

Returns
A string containing the user input.

Implements te::vm::core::VirtualMachine.

Definition at line 152 of file python/VirtualMachine.cpp.

References m_readlineLoop, m_readlineStr, and te::vm::core::VirtualMachine::requestReadline().

void te::vm::python::VirtualMachine::readline ( QString  msg)
slot

Definition at line 160 of file python/VirtualMachine.cpp.

References m_readlineLoop, and m_readlineStr.

void te::vm::core::VirtualMachine::requestReadline ( )
signalinherited

Signal emmited when the Virtual Machine needs to execute a input operation.

Referenced by readline().

void te::vm::python::VirtualMachine::setFileName ( QString  file)
virtual

setFileName Sets the file that will be used in the Virtual Machine.

Parameters
fileThe full path filename.

Implements te::vm::core::VirtualMachine.

Definition at line 96 of file python/VirtualMachine.cpp.

References m_filename.

void te::vm::python::VirtualMachine::stop ( )
slot

Definition at line 166 of file python/VirtualMachine.cpp.

References m_readlineLoop.

void te::vm::python::VirtualMachine::write ( const QString &  str)
slot

Definition at line 146 of file python/VirtualMachine.cpp.

References te::vm::core::VirtualMachine::output().

Member Data Documentation

std::string te::vm::python::VirtualMachine::m_filename
private

Definition at line 107 of file python/VirtualMachine.h.

Referenced by execute(), and setFileName().

PyThreadState* te::vm::python::VirtualMachine::m_mainThreadState
private

Definition at line 112 of file python/VirtualMachine.h.

Referenced by VirtualMachine(), and ~VirtualMachine().

QEventLoop* te::vm::python::VirtualMachine::m_readlineLoop
private

Definition at line 113 of file python/VirtualMachine.h.

Referenced by readline(), stop(), and ~VirtualMachine().

std::string te::vm::python::VirtualMachine::m_readlineStr
private

Definition at line 111 of file python/VirtualMachine.h.

Referenced by readline().

VirtualMachineOutput te::vm::python::VirtualMachine::m_stderr
private

Definition at line 110 of file python/VirtualMachine.h.

Referenced by execute().

VirtualMachineInput te::vm::python::VirtualMachine::m_stdin
private

Definition at line 108 of file python/VirtualMachine.h.

Referenced by execute().

VirtualMachineOutput te::vm::python::VirtualMachine::m_stdout
private

Definition at line 109 of file python/VirtualMachine.h.

Referenced by execute().


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