DefaultDistribution.h

Go to the documentation of this file.
00001 /*
00002  *  BEEN: Benchmarking Environment
00003  *  ==============================
00004  *
00005  *  File author: Branislav Repcek
00006  *
00007  *  GNU Lesser General Public License Version 2.1
00008  *  ---------------------------------------------
00009  *  Copyright (C) 2004-2006 Distributed Systems Research Group,
00010  *  Faculty of Mathematics and Physics, Charles University in Prague
00011  *
00012  *  This library is free software; you can redistribute it and/or
00013  *  modify it under the terms of the GNU Lesser General Public
00014  *  License version 2.1, as published by the Free Software Foundation.
00015  *
00016  *  This library is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019  *  Lesser General Public License for more details.
00020  *
00021  *  You should have received a copy of the GNU Lesser General Public
00022  *  License along with this library; if not, write to the Free Software
00023  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00024  *  MA  02111-1307  USA
00025  */
00026 
00034 #ifndef DEFAULT_DISTRIBUTION_INCLUDED
00035 #define DEFAULT_DISTRIBUTION_INCLUDED
00036 
00037 #include "../common/UnicodeString.h"
00038 #include "../common/MessageReporter.h"
00039 #include "../common/BasicFeatures.h"
00040 #include "../common/OperatingSystem.h"
00041 #include "LinuxAdvancedFeatures.h"
00042 
00043 namespace hwdet
00044 {
00051     class DefaultDistribution : public Distribution
00052     {
00053     public:
00055         #define DEFAULT_DISTRO_FITNESS 0.3f
00056         
00061         DefaultDistribution(MessageReporter *parent_reporter) :
00062         Distribution(TXT("DefaultDistribution"), parent_reporter)
00063         {
00064             // No packagers are registered.
00065         }
00066         
00069         virtual ~DefaultDistribution(void)
00070         {
00071         }
00072         
00084         virtual bool DetectOS(XMLElement *root_node) 
00085         {
00086             ReportMessage("Detecting OS properties.");
00087             
00088             BasicFeatures *basic = new BasicFeatures(uts_name,
00089                                                      TXT("unknown"), 
00090                                                      uts_machine);
00091             LinuxAdvancedFeatures *advanced = new LinuxAdvancedFeatures(TXT("unknown"),
00092                                                                         TXT("unknown"),
00093                                                                         uts_release, 
00094                                                                         uts_version, 
00095                                                                         kernel_version_parsed);
00096             
00097             root_node->AddSubNode(new OperatingSystem(basic, advanced));
00098             
00099             return true;
00100         }
00101         
00105         virtual float GetFitness(void)
00106         {
00107             return DEFAULT_DISTRO_FITNESS;
00108         }
00109     };
00110 }
00111 
00112 #endif

Generated on Tue Dec 19 17:43:51 2006 for Detector for Linux by  doxygen 1.4.7