23 #ifndef DOBBYRDKPLUGINMANAGER_H
24 #define DOBBYRDKPLUGINMANAGER_H
26 #include "IDobbyRdkPlugin.h"
27 #include "IDobbyRdkLoggingPlugin.h"
29 #include <sys/types.h>
51 const std::string &rootfsPath,
52 const std::string &pluginPath,
53 const std::shared_ptr<DobbyRdkPluginUtils> &utils);
60 const uint timeoutMs = 0)
const;
66 std::shared_ptr<rt_dobby_schema> getContainerConfig()
const
68 return mContainerConfig;
78 const uint timeoutMs)
const;
83 bool isLoaded(
const std::string &pluginName)
const;
84 bool isRequired(
const std::string &pluginName)
const;
85 inline std::shared_ptr<IDobbyRdkPlugin>
getPlugin(
const std::string &name)
const;
86 inline std::shared_ptr<IDobbyRdkLoggingPlugin>
getLogger(
const std::string &name)
const;
90 std::map<std::string, std::pair<void *, std::shared_ptr<IDobbyRdkLoggingPlugin>>> mLoggers;
91 std::map<std::string, std::pair<void *, std::shared_ptr<IDobbyRdkPlugin>>> mPlugins;
92 std::set<std::string> mRequiredPlugins;
93 std::shared_ptr<rt_dobby_schema> mContainerConfig;
94 const std::string mRootfsPath;
95 const std::string mPluginPath;
96 const std::shared_ptr<DobbyRdkPluginUtils> mUtils;
97 std::unique_ptr<DobbyRdkPluginDependencySolver> mDependencySolver;
Class that tracks dependencies between plugins.
Definition: DobbyRdkPluginDependencySolver.h:40
Class that manages all the RDK plugin hook libraries.
Definition: DobbyRdkPluginManager.h:48
bool executeHookTimeout(const std::string &pluginName, const IDobbyRdkPlugin::HintFlags hook, const uint timeoutMs) const
Definition: DobbyRdkPluginManager.cpp:687
std::shared_ptr< IDobbyRdkPlugin > getPlugin(const std::string &name) const
Get the plugin with the name, or nullptr if no plugin.
Definition: DobbyRdkPluginManager.cpp:521
~DobbyRdkPluginManager()
Definition: DobbyRdkPluginManager.cpp:74
bool runPlugins(const IDobbyRdkPlugin::HintFlags &hookPoint, const uint timeoutMs=0) const
Run the plugins specified in the container config at the given hook point. Returns true if all requir...
Definition: DobbyRdkPluginManager.cpp:853
std::string HookPointToString(const IDobbyRdkPlugin::HintFlags &hookPoint) const
Definition: DobbyRdkPluginManager.cpp:802
bool implementsHook(const std::string &pluginName, const IDobbyRdkPlugin::HintFlags hook) const
Check if a plugin implements the specified hook.
Definition: DobbyRdkPluginManager.cpp:605
std::shared_ptr< IDobbyRdkLoggingPlugin > getContainerLogger() const
Get the logging plugin specified in the container config. Each container can only have a single plugi...
Definition: DobbyRdkPluginManager.cpp:458
bool isLoaded(const std::string &pluginName) const
Check if a plugin is loaded.
Definition: DobbyRdkPluginManager.cpp:579
DobbyRdkPluginManager(std::shared_ptr< rt_dobby_schema > containerConfig, const std::string &rootfsPath, const std::string &pluginPath, const std::shared_ptr< DobbyRdkPluginUtils > &utils)
Create instance of DobbyRdkPlugin Manager and load all plugins that can be found in pluginPath.
Definition: DobbyRdkPluginManager.cpp:53
bool preprocessPlugins()
Prepares the dependency solver and required plugins data structures.
Definition: DobbyRdkPluginManager.cpp:358
const std::vector< std::string > listLoadedPlugins() const
Just return a list of all loaded plugin names.
Definition: DobbyRdkPluginManager.cpp:561
bool executeHook(const std::string &pluginName, const IDobbyRdkPlugin::HintFlags hook) const
Definition: DobbyRdkPluginManager.cpp:633
bool isRequired(const std::string &pluginName) const
Check if a plugin is required.
Definition: DobbyRdkPluginManager.cpp:591
std::shared_ptr< IDobbyRdkLoggingPlugin > getLogger(const std::string &name) const
Get the logger with the name, or nullptr if no plugin.
Definition: DobbyRdkPluginManager.cpp:429
void setExitStatus(int status) const
Set the exit status of the container.
Definition: DobbyRdkPluginManager.cpp:508
bool loadPlugins()
Scans the given path for any shared objects that implement the plugin entry points.
Definition: DobbyRdkPluginManager.cpp:152
const std::vector< std::string > listLoadedLoggers() const
Just return a list of all loaded logging plugin names.
Definition: DobbyRdkPluginManager.cpp:544
HintFlags
Bit flags that should be returned by hookHints.
Definition: IDobbyRdkPlugin.h:70