23 #ifndef IDobbyRdkPlugin_H
24 #define IDobbyRdkPlugin_H
26 #include "DobbyRdkPluginUtils.h"
27 #include "rt_dobby_schema.h"
29 #if defined(DOBBY_BUILD)
32 #include <Dobby/Logging.h>
35 #include <sys/types.h>
60 virtual std::string
name()
const = 0;
71 PostInstallationFlag = (1 << 0),
72 PreCreationFlag = (1 << 1),
73 CreateRuntimeFlag = (1 << 2),
74 CreateContainerFlag = (1 << 3),
75 #ifdef USE_STARTCONTAINER_HOOK
76 StartContainerFlag = (1 << 4),
78 PostStartFlag = (1 << 5),
79 PostHaltFlag = (1 << 6),
80 PostStopFlag = (1 << 7),
101 virtual bool postInstallation() = 0;
104 virtual bool preCreation() = 0;
107 virtual bool createRuntime() = 0;
110 virtual bool createContainer() = 0;
112 #ifdef USE_STARTCONTAINER_HOOK
114 virtual bool startContainer() = 0;
118 virtual bool postStart() = 0;
121 virtual bool postHalt() = 0;
124 virtual bool postStop() = 0;
148 #define PUBLIC_FN __attribute__((visibility("default")))
163 #define REGISTER_RDK_PLUGIN(_class) \
164 extern "C" PUBLIC_FN IDobbyRdkPlugin *createIDobbyRdkPlugin(std::shared_ptr<rt_dobby_schema>& containerConfig, const std::shared_ptr<DobbyRdkPluginUtils> &utils, const std::string& rootfsPath); \
165 extern "C" PUBLIC_FN IDobbyRdkPlugin *createIDobbyRdkPlugin(std::shared_ptr<rt_dobby_schema>& containerConfig, const std::shared_ptr<DobbyRdkPluginUtils> &utils, const std::string& rootfsPath) \
167 return new _class(containerConfig, utils, rootfsPath); \
169 extern "C" PUBLIC_FN void destroyIDobbyRdkPlugin(_class const *_plugin); \
170 extern "C" PUBLIC_FN void destroyIDobbyRdkPlugin(_class const *_plugin) \
172 return delete _plugin; \
Interface that plugin libraries have to implement.
Definition: IDobbyRdkPlugin.h:49
HintFlags
Bit flags that should be returned by hookHints.
Definition: IDobbyRdkPlugin.h:70
virtual std::string name() const =0
Should return the name of the plugin.
virtual std::vector< std::string > getDependencies() const =0
Should return the names of the plugins this plugin depends on.
virtual unsigned hookHints() const =0
Should return a bitfield of the hook points implemented by the plugin.