A singleton for managing TerraLib Virtual Machines. More...
#include <VirtualMachineManager.h>
Classes | |
| struct | Impl |
Public Member Functions | |
| void | clear () |
| It releases all VM. More... | |
| void | erase (const std::string &id) |
| It removes a given virtual machine. More... | |
| VirtualMachine * | get (const std::string &id) const |
| It returns the VM identified by id. More... | |
| void | insert (const std::string &id, std::unique_ptr< VirtualMachine > vm) |
| It adds a new VM to be managed. More... | |
Static Public Member Functions | |
| static VirtualMachineManager & | instance () |
| Return a reference to the singleton. More... | |
Private Member Functions | |
| VirtualMachineManager & | operator= (const VirtualMachineManager &) |
| VirtualMachineManager () | |
| Singleton constructor. More... | |
| VirtualMachineManager (const VirtualMachineManager &) | |
| ~VirtualMachineManager () | |
| Singleton destructor. More... | |
Private Attributes | |
| Impl * | m_pimpl |
A singleton for managing TerraLib Virtual Machines.
Definition at line 57 of file VirtualMachineManager.h.
|
private |
|
private |
|
private |
| void te::vm::core::VirtualMachineManager::clear | ( | void | ) |
It releases all VM.
Definition at line 69 of file VirtualMachineManager.cpp.
References m_pimpl, and te::vm::core::VirtualMachineManager::Impl::m_vms.
| void te::vm::core::VirtualMachineManager::erase | ( | const std::string & | id | ) |
It removes a given virtual machine.
| id | The VM id. |
| te::OutOfRangeException | If there is no virtual machine registered with the given id. |
Definition at line 75 of file VirtualMachineManager.cpp.
References m_pimpl, te::vm::core::VirtualMachineManager::Impl::m_vms, and TE_TR.
| te::vm::core::VirtualMachine * te::vm::core::VirtualMachineManager::get | ( | const std::string & | id | ) | const |
It returns the VM identified by id.
| id | The VM identifier. Example: lua, python. |
| te::OutOfRangeException | If there is no virtual machine registered with the given id. |
Definition at line 47 of file VirtualMachineManager.cpp.
References m_pimpl, te::vm::core::VirtualMachineManager::Impl::m_vms, and TE_TR.
Referenced by main(), and te::ce::CodeEditorDialog::onRunButtonClicked().
| void te::vm::core::VirtualMachineManager::insert | ( | const std::string & | id, |
| std::unique_ptr< VirtualMachine > | vm | ||
| ) |
It adds a new VM to be managed.
| id | The VM id. |
| lvm | The VM to be managed. The singleton will take the VM ownership. |
| te::InvalidArgumentException | It throws an exception if a VM with the same ID already exists. |
Definition at line 58 of file VirtualMachineManager.cpp.
References m_pimpl, te::vm::core::VirtualMachineManager::Impl::m_vms, and TE_TR.
Referenced by te::vm::lua::TERRALIB_CPP_PLUGIN_BEGIN(), and te::vm::python::TERRALIB_CPP_PLUGIN_BEGIN().
|
static |
Return a reference to the singleton.
Definition at line 86 of file VirtualMachineManager.cpp.
Referenced by main(), te::ce::CodeEditorDialog::onRunButtonClicked(), te::vm::lua::TERRALIB_CPP_PLUGIN_BEGIN(), and te::vm::python::TERRALIB_CPP_PLUGIN_BEGIN().
|
private |
|
private |
Definition at line 111 of file VirtualMachineManager.h.
Referenced by clear(), erase(), get(), insert(), VirtualMachineManager(), and ~VirtualMachineManager().