Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CPythonInvoker Class Referenceabstract

#include <PythonInvoker.h>

Inheritance diagram for CPythonInvoker:
ILanguageInvoker CAddonPythonInvoker CHTTPPythonInvoker CContextItemAddonInvoker CHTTPPythonWsgiInvoker

Public Types

typedef std::unique_ptr< PyObject, PyObjectDeleter > PyObjectPtr
 

Public Member Functions

 CPythonInvoker (ILanguageInvocationHandler *invocationHandler)
 
 ~CPythonInvoker () override
 
bool Execute (const std::string &script, const std::vector< std::string > &arguments=std::vector< std::string >()) override
 
bool IsStopping () const override
 
- Public Member Functions inherited from ILanguageInvoker
 ILanguageInvoker (ILanguageInvocationHandler *invocationHandler)
 
virtual ~ILanguageInvoker ()
 
virtual bool Stop (bool abort=false)
 
void SetId (int id)
 
int GetId () const
 
const ADDON::AddonPtrGetAddon () const
 
void SetAddon (const ADDON::AddonPtr &addon)
 
InvokerState GetState () const
 
bool IsActive () const
 
bool IsRunning () const
 
void Reset ()
 

Protected Member Functions

bool execute (const std::string &script, const std::vector< std::string > &arguments) override
 
virtual void executeScript (FILE *fp, const std::string &script, PyObject *moduleDict)
 
bool stop (bool abort) override
 
void onExecutionDone () override
 
void onExecutionFailed () override
 
virtual const char * getInitializationScript () const =0
 
virtual void onInitialization ()
 
virtual void onPythonModuleInitialization (void *moduleDict)
 
virtual void onDeinitialization ()
 
virtual void onSuccess ()
 
virtual void onAbort ()
 
virtual void onError (const std::string &exceptionType="", const std::string &exceptionValue="", const std::string &exceptionTraceback="")
 
- Protected Member Functions inherited from ILanguageInvoker
virtual void AbortNotification ()
 
virtual void pulseGlobalEvent ()
 
virtual bool onExecutionInitialized ()
 
virtual void onExecutionFinalized ()
 
void setState (InvokerState state)
 

Protected Attributes

std::string m_sourceFile
 
CCriticalSection m_critical
 
- Protected Attributes inherited from ILanguageInvoker
ADDON::AddonPtr m_addon
 

Member Typedef Documentation

◆ PyObjectPtr

std::unique_ptr<PyObject, PyObjectDeleter> CPythonInvoker::PyObjectPtr

Constructor & Destructor Documentation

◆ CPythonInvoker()

CPythonInvoker::CPythonInvoker ( ILanguageInvocationHandler * invocationHandler)
explicit

◆ ~CPythonInvoker()

CPythonInvoker::~CPythonInvoker ( )
override

Member Function Documentation

◆ Execute()

bool CPythonInvoker::Execute ( const std::string & script,
const std::vector< std::string > & arguments = std::vector<std::string>() )
overridevirtual

Reimplemented from ILanguageInvoker.

◆ execute()

bool CPythonInvoker::execute ( const std::string & script,
const std::vector< std::string > & arguments )
overrideprotectedvirtual

Implements ILanguageInvoker.

◆ executeScript()

void CPythonInvoker::executeScript ( FILE * fp,
const std::string & script,
PyObject * moduleDict )
protectedvirtual

Reimplemented in CHTTPPythonWsgiInvoker.

◆ getInitializationScript()

virtual const char * CPythonInvoker::getInitializationScript ( ) const
protectedpure virtual

◆ IsStopping()

bool CPythonInvoker::IsStopping ( ) const
inlineoverridevirtual

Reimplemented from ILanguageInvoker.

◆ onAbort()

virtual void CPythonInvoker::onAbort ( )
inlineprotectedvirtual

Reimplemented in CHTTPPythonInvoker.

◆ onDeinitialization()

void CPythonInvoker::onDeinitialization ( )
protectedvirtual

◆ onError()

void CPythonInvoker::onError ( const std::string & exceptionType = "",
const std::string & exceptionValue = "",
const std::string & exceptionTraceback = "" )
protectedvirtual

Reimplemented in CHTTPPythonInvoker.

◆ onExecutionDone()

void CPythonInvoker::onExecutionDone ( )
overrideprotectedvirtual

Reimplemented from ILanguageInvoker.

◆ onExecutionFailed()

void CPythonInvoker::onExecutionFailed ( )
overrideprotectedvirtual

Reimplemented from ILanguageInvoker.

◆ onInitialization()

void CPythonInvoker::onInitialization ( )
protectedvirtual

◆ onPythonModuleInitialization()

void CPythonInvoker::onPythonModuleInitialization ( void * moduleDict)
protectedvirtual

Reimplemented in CContextItemAddonInvoker.

◆ onSuccess()

virtual void CPythonInvoker::onSuccess ( )
inlineprotectedvirtual

◆ stop()

bool CPythonInvoker::stop ( bool abort)
overrideprotectedvirtual

Implements ILanguageInvoker.

Member Data Documentation

◆ m_critical

CCriticalSection CPythonInvoker::m_critical
protected

◆ m_sourceFile

std::string CPythonInvoker::m_sourceFile
protected

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