Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
XBMCAddon::Python::PythonCallbackHandler Class Reference

#include <CallbackHandler.h>

Inheritance diagram for XBMCAddon::Python::PythonCallbackHandler:
XBMCAddon::RetardedAsyncCallbackHandler XBMCAddon::CallbackHandler XBMCAddon::AddonClass

Public Member Functions

 PythonCallbackHandler ()
 
bool isStateOk (AddonClass *obj) override
 
bool shouldRemoveCallback (AddonClass *obj, void *threadState) override
 
- Public Member Functions inherited from XBMCAddon::RetardedAsyncCallbackHandler
 ~RetardedAsyncCallbackHandler () override
 
void invokeCallback (Callback *cb) override
 
- Public Member Functions inherited from XBMCAddon::AddonClass
 AddonClass ()
 
virtual ~AddonClass ()
 
const char * GetClassname () const
 
LanguageHookGetLanguageHook ()
 
bool isDeallocating ()
 
void Release () const
 
void Acquire () const
 

Additional Inherited Members

- Static Public Member Functions inherited from XBMCAddon::RetardedAsyncCallbackHandler
static void makePendingCalls ()
 
static void clearPendingCalls (void *userData)
 
- Static Public Member Functions inherited from XBMCAddon::AddonClass
static short getNumAddonClasses ()
 
- Protected Member Functions inherited from XBMCAddon::RetardedAsyncCallbackHandler
 RetardedAsyncCallbackHandler ()=default
 
- Protected Member Functions inherited from XBMCAddon::CallbackHandler
 CallbackHandler ()=default
 
- Protected Member Functions inherited from XBMCAddon::AddonClass
virtual void deallocating ()
 
- Static Protected Member Functions inherited from XBMCAddon::AddonClass
static short getNextClassIndex ()
 
- Protected Attributes inherited from XBMCAddon::AddonClass
LanguageHooklanguageHook
 

Detailed Description

This class represents a specialization of the callback handler that specifically checks to see if we're in an OK thread state based on Python specifics.

Constructor & Destructor Documentation

◆ PythonCallbackHandler()

XBMCAddon::Python::PythonCallbackHandler::PythonCallbackHandler ( )

We are ASS-U-MEing that this construction is happening within the context of a Python call. This way we can store off the PyThreadState to later verify that we're handling callbacks in the appropriate thread.

Member Function Documentation

◆ isStateOk()

bool XBMCAddon::Python::PythonCallbackHandler::isStateOk ( AddonClass * obj)
overridevirtual

Now we are answering the question as to whether or not we are in the PyThreadState that we were in when we started.

Implements XBMCAddon::RetardedAsyncCallbackHandler.

◆ shouldRemoveCallback()

bool XBMCAddon::Python::PythonCallbackHandler::shouldRemoveCallback ( AddonClass * obj,
void * threadState )
overridevirtual

For this method we expect the PyThreadState to be passed as the user data for the check.

Todo
This is a stupid way to get this information back to the handler. there should be a more language neutral means.

Implements XBMCAddon::RetardedAsyncCallbackHandler.


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