Dobby
3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
|
Class that tracks dependencies between plugins. More...
#include <DobbyRdkPluginDependencySolver.h>
Public Member Functions | |
bool | addPlugin (const std::string &name) |
Adds a plugin to the solver. More... | |
bool | addDependency (const std::string &pluginName, const std::string &dependencyName) |
Adds a dependency between two plugins to the solver. More... | |
std::vector< std::string > | getOrderOfDependency () const |
Gets the names of the plugins in order of their dependency. More... | |
std::vector< std::string > | getReversedOrderOfDependency () const |
Gets the names of the plugins in reversed order of their dependency. More... | |
Private Attributes | |
Graph | mDependencyGraph |
StringVertexDescriptorMap | mDescriptorMap |
Class that tracks dependencies between plugins.
It can be used to get the order in which the plugins should be launched.
bool DobbyRdkPluginDependencySolver::addDependency | ( | const std::string & | pluginName, |
const std::string & | dependencyName | ||
) |
Adds a dependency between two plugins to the solver.
If plugin A depends on plugin B, then the call is:
[in] | pluginName | The name of the plugin which depends on dependencyName . |
[in] | dependencyName | The name of the plugin on which pluginName depends. |
bool DobbyRdkPluginDependencySolver::addPlugin | ( | const std::string & | name | ) |
Adds a plugin to the solver.
Each plugin must be known to the solver - added by this method before its dependencies are tracked.
[in] | name | Name of the plugin |
std::vector< std::string > DobbyRdkPluginDependencySolver::getOrderOfDependency | ( | ) | const |
Gets the names of the plugins in order of their dependency.
"Order of dependency" here means that if plugin A depends on plugin B, plugin B will be placed before plugin A in the returned vector, e.g. with this code:
,
is
.
If there is a dependency cycle, an error message is printed and the function returns an empty vector.
std::vector< std::string > DobbyRdkPluginDependencySolver::getReversedOrderOfDependency | ( | ) | const |
Gets the names of the plugins in reversed order of their dependency.
"Reversed order of dependency" here means that if plugin A depends on plugin B, plugin B will be placed after plugin A in the returned vector, e.g. with this code:
,
is
.
If there is a dependency cycle, an error message is printed and the function returns an empty vector.