#include <DistributionRegistry.h>
Public Member Functions | |
DistributionRegistry (MessageReporter *parent_reporter) | |
Create new registry. | |
~DistributionRegistry (void) | |
Destroy registry. | |
void | Register (Distribution *distro) |
Register new distro handler. | |
Distribution * | GetBestFit (void) |
Get best handler for current OS. | |
Private Member Functions | |
DistributionRegistry (const DistributionRegistry &) | |
Private copy ctor. | |
DistributionRegistry | operator= (const DistributionRegistry &) |
Undefined to prevent copying. | |
Private Attributes | |
std::vector< Distribution * > | registry |
List of registered distribution handlers. | |
DefaultDistribution * | default_distro |
Default distribution. |
This class maintains registry of all user-defined handlers for specific distributions of Linux. It can select handler that is most suitable for current operating system. Note that handler registration is not automatic and you have to register handlers via the Register method.
hwdet::DistributionRegistry::DistributionRegistry | ( | MessageReporter * | parent_reporter | ) | [inline] |
Create new registry.
parent_reporter | Reported used by the DefaultDistribution class to dispatch messages. |
hwdet::DistributionRegistry::~DistributionRegistry | ( | void | ) | [inline] |
Destroy registry.
hwdet::DistributionRegistry::DistributionRegistry | ( | const DistributionRegistry & | ) | [inline, private] |
Private copy ctor.
Distribution* hwdet::DistributionRegistry::GetBestFit | ( | void | ) | [inline] |
Get best handler for current OS.
This will pick most suitable distribution handler for current system. Best handler is picked based on the value of its fitness function (as determined by the Distribution::GetFitness method). Highest fitness is best. For more detailed description of the fitness function, see documentation for the Distribution class. Note that this will always search all registered distros.
DistributionRegistry hwdet::DistributionRegistry::operator= | ( | const DistributionRegistry & | ) | [private] |
Undefined to prevent copying.
void hwdet::DistributionRegistry::Register | ( | Distribution * | distro | ) | [inline] |
Default distribution.
std::vector< Distribution * > hwdet::DistributionRegistry::registry [private] |
List of registered distribution handlers.