kodi
CallbackHandler.h
1 /*
2  * Copyright (C) 2005-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "AddonClass.h"
12 #include "CallbackFunction.h"
13 
14 namespace XBMCAddon
15 {
21  class CallbackHandler : public AddonClass
22  {
23  protected:
24  inline CallbackHandler() = default;
25 
26  public:
27  virtual void invokeCallback(Callback* cb) = 0;
28  };
29 
43  {
44  protected:
45  inline RetardedAsyncCallbackHandler() = default;
46  public:
47 
48  ~RetardedAsyncCallbackHandler() override;
49 
50  void invokeCallback(Callback* cb) override;
51  static void makePendingCalls();
52  static void clearPendingCalls(void* userData);
53 
54  virtual bool isStateOk(AddonClass* obj) = 0;
55  virtual bool shouldRemoveCallback(AddonClass* obj, void* userData) = 0;
56  };
57 
58 }
This is the abstraction representing different ways to handle the execution of callbacks.
Definition: CallbackHandler.h:21
Defining LOG_LIFECYCLE_EVENTS will log all instantiations, deletions and also reference countings (in...
Definition: Addon.cpp:25
Definition: CallbackFunction.h:25
This class is primarily for Python support (hence the "Retarded" prefix).
Definition: CallbackHandler.h:42
This class is the superclass for all reference counted classes in the api.
Definition: AddonClass.h:57