#include <ScriptInvocationManager.h>
|
void | Process () |
|
void | Uninitialize () |
|
void | RegisterLanguageInvocationHandler (ILanguageInvocationHandler *invocationHandler, const std::string &extension) |
|
void | RegisterLanguageInvocationHandler (ILanguageInvocationHandler *invocationHandler, const std::set< std::string > &extensions) |
|
void | UnregisterLanguageInvocationHandler (ILanguageInvocationHandler *invocationHandler) |
|
bool | HasLanguageInvoker (const std::string &script) const |
|
LanguageInvokerPtr | GetLanguageInvoker (const std::string &script) |
|
int | GetReusablePluginHandle (const std::string &script) |
| Returns addon_handle if last reusable invoker is ready to use.
|
|
int | ExecuteAsync (const std::string &script, const ADDON::AddonPtr &addon=ADDON::AddonPtr(), const std::vector< std::string > &arguments=std::vector< std::string >(), bool reuseable=false, int pluginHandle=-1) |
| Executes the given script asynchronously in a separate thread.
|
|
int | ExecuteAsync (const std::string &script, const LanguageInvokerPtr &languageInvoker, const ADDON::AddonPtr &addon=ADDON::AddonPtr(), const std::vector< std::string > &arguments=std::vector< std::string >(), bool reuseable=false, int pluginHandle=-1) |
| Executes the given script asynchronously in a separate thread.
|
|
int | ExecuteSync (const std::string &script, const ADDON::AddonPtr &addon=ADDON::AddonPtr(), const std::vector< std::string > &arguments=std::vector< std::string >(), uint32_t timeoutMs=0, bool waitShutdown=false) |
| Executes the given script synchronously.
|
|
int | ExecuteSync (const std::string &script, const LanguageInvokerPtr &languageInvoker, const ADDON::AddonPtr &addon=ADDON::AddonPtr(), const std::vector< std::string > &arguments=std::vector< std::string >(), uint32_t timeoutMs=0, bool waitShutdown=false) |
| Executes the given script synchronously.
|
|
bool | Stop (int scriptId, bool wait=false) |
|
bool | Stop (const std::string &scriptPath, bool wait=false) |
|
void | StopRunningScripts (bool wait=false) |
| Stop all running scripts.
|
|
bool | IsRunning (int scriptId) const |
|
bool | IsRunning (const std::string &scriptPath) const |
|
◆ ExecuteAsync() [1/2]
int CScriptInvocationManager::ExecuteAsync |
( |
const std::string & | script, |
|
|
const ADDON::AddonPtr & | addon = ADDON::AddonPtr(), |
|
|
const std::vector< std::string > & | arguments = std::vector<std::string>(), |
|
|
bool | reuseable = false, |
|
|
int | pluginHandle = -1 ) |
Executes the given script asynchronously in a separate thread.
- Parameters
-
script | Path to the script to be executed |
addon | (Optional) Addon to which the script belongs |
arguments | (Optional) List of arguments passed to the script |
- Returns
- -1 if an error occurred, otherwise the ID of the script
◆ ExecuteAsync() [2/2]
int CScriptInvocationManager::ExecuteAsync |
( |
const std::string & | script, |
|
|
const LanguageInvokerPtr & | languageInvoker, |
|
|
const ADDON::AddonPtr & | addon = ADDON::AddonPtr(), |
|
|
const std::vector< std::string > & | arguments = std::vector<std::string>(), |
|
|
bool | reuseable = false, |
|
|
int | pluginHandle = -1 ) |
Executes the given script asynchronously in a separate thread.
- Parameters
-
script | Path to the script to be executed |
languageInvoker | Language invoker to be used to execute the script |
addon | (Optional) Addon to which the script belongs |
arguments | (Optional) List of arguments passed to the script |
- Returns
- -1 if an error occurred, otherwise the ID of the script
◆ ExecuteSync() [1/2]
int CScriptInvocationManager::ExecuteSync |
( |
const std::string & | script, |
|
|
const ADDON::AddonPtr & | addon = ADDON::AddonPtr(), |
|
|
const std::vector< std::string > & | arguments = std::vector<std::string>(), |
|
|
uint32_t | timeoutMs = 0, |
|
|
bool | waitShutdown = false ) |
Executes the given script synchronously.
The script is actually executed asynchronously but the calling thread is blocked until either the script has finished or the given timeout has expired. If the given timeout has expired the script's execution is stopped and depending on the specified wait behaviour we wait for the script's execution to finish or not.
- Parameters
-
script | Path to the script to be executed |
addon | (Optional) Addon to which the script belongs |
arguments | (Optional) List of arguments passed to the script |
timeout | (Optional) Timeout (in milliseconds) for the script's execution |
waitShutdown | (Optional) Whether to wait when having to forcefully stop the script's execution or not. |
- Returns
- -1 if an error occurred, 0 if the script terminated or ETIMEDOUT if the given timeout expired
◆ ExecuteSync() [2/2]
int CScriptInvocationManager::ExecuteSync |
( |
const std::string & | script, |
|
|
const LanguageInvokerPtr & | languageInvoker, |
|
|
const ADDON::AddonPtr & | addon = ADDON::AddonPtr(), |
|
|
const std::vector< std::string > & | arguments = std::vector<std::string>(), |
|
|
uint32_t | timeoutMs = 0, |
|
|
bool | waitShutdown = false ) |
Executes the given script synchronously.
The script is actually executed asynchronously but the calling thread is blocked until either the script has finished or the given timeout has expired. If the given timeout has expired the script's execution is stopped and depending on the specified wait behaviour we wait for the script's execution to finish or not.
- Parameters
-
script | Path to the script to be executed |
languageInvoker | Language invoker to be used to execute the script |
addon | (Optional) Addon to which the script belongs |
arguments | (Optional) List of arguments passed to the script |
timeout | (Optional) Timeout (in milliseconds) for the script's execution |
waitShutdown | (Optional) Whether to wait when having to forcefully stop the script's execution or not. |
- Returns
- -1 if an error occurred, 0 if the script terminated or ETIMEDOUT if the given timeout expired
◆ GetInstance()
◆ GetLanguageInvoker()
LanguageInvokerPtr CScriptInvocationManager::GetLanguageInvoker |
( |
const std::string & | script | ) |
|
◆ GetReusablePluginHandle()
int CScriptInvocationManager::GetReusablePluginHandle |
( |
const std::string & | script | ) |
|
Returns addon_handle if last reusable invoker is ready to use.
◆ HasLanguageInvoker()
bool CScriptInvocationManager::HasLanguageInvoker |
( |
const std::string & | script | ) |
const |
◆ IsRunning() [1/2]
bool CScriptInvocationManager::IsRunning |
( |
const std::string & | scriptPath | ) |
const |
◆ IsRunning() [2/2]
bool CScriptInvocationManager::IsRunning |
( |
int | scriptId | ) |
const |
◆ OnExecutionDone()
void CScriptInvocationManager::OnExecutionDone |
( |
int | scriptId | ) |
|
|
protected |
◆ Process()
void CScriptInvocationManager::Process |
( |
| ) |
|
◆ RegisterLanguageInvocationHandler() [1/2]
void CScriptInvocationManager::RegisterLanguageInvocationHandler |
( |
ILanguageInvocationHandler * | invocationHandler, |
|
|
const std::set< std::string > & | extensions ) |
◆ RegisterLanguageInvocationHandler() [2/2]
◆ Stop() [1/2]
bool CScriptInvocationManager::Stop |
( |
const std::string & | scriptPath, |
|
|
bool | wait = false ) |
◆ Stop() [2/2]
bool CScriptInvocationManager::Stop |
( |
int | scriptId, |
|
|
bool | wait = false ) |
◆ StopRunningScripts()
void CScriptInvocationManager::StopRunningScripts |
( |
bool | wait = false | ) |
|
Stop all running scripts.
- Parameters
-
wait | if kodi should wait for each script to finish (default false) |
◆ Uninitialize()
void CScriptInvocationManager::Uninitialize |
( |
| ) |
|
◆ UnregisterLanguageInvocationHandler()
◆ CLanguageInvokerThread
The documentation for this class was generated from the following files: