[Compbench-devel] CompBenchmarks++/libcompbenchmarks/Base Result.cpp, NONE, 1.1 Result.h, NONE, 1.1
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2007-02-05 20:02:13
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Base In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv19535 Added Files: Result.cpp Result.h Log Message: First import. --- NEW FILE: Result.cpp --- /* ---------------------------------------------------------------------------- $Id: Result.cpp,v 1.1 2007/02/05 20:01:59 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #include <Base/Result.h> using namespace CBM; Result::Result(std::string _value, std::string _compilationTime, std::string _executionTime, std::string _tested, std::string _testOk) { node=new XMLNode("result"); node->addAttribute("value", _value); node->addAttribute("compilation-time", _compilationTime); node->addAttribute("execution-time", _executionTime); node->addAttribute("tested", _tested); node->addAttribute("test-ok", _testOk); } Result::Result(CBM::XMLNode *_node) { node=_node; } std::string Result::getAttributeStr(std::string _attr) { std::string result = "0"; CBM::XMLAttribute *att; att=node->getAttribute(_attr); if (att) result=att->Value(); return(result); } std::string Result::Value(void) { return(getAttributeStr("value")); } std::string Result::compilationTime(void) { return(getAttributeStr("compilation-time")); } std::string Result::executionTime(void) { return(getAttributeStr("execution-time")); } std::string Result::tested(void) { return(getAttributeStr("tested")); } std::string Result::testOk(void) { return(getAttributeStr("test-ok")); } CBM::XMLNode *Result::resultNode(void) { return(node); } Result::~Result() { } --- NEW FILE: Result.h --- /* ---------------------------------------------------------------------------- $Id: Result.h,v 1.1 2007/02/05 20:01:59 xfred Exp $ This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #ifndef H_CBMRESULT #define H_CBMRESULT 1 #include <Base/XML.h> namespace CBM { /** \brief Class for storing and managing results */ class Result { protected: XMLNode *node; virtual std::string getAttributeStr(std::string _attr); public: Result(std::string _value, std::string _compilationTime, std::string _executionTime, std::string _tested, std::string _testOk); Result(XMLNode *_node); virtual std::string Value(void); virtual std::string compilationTime(void); virtual std::string executionTime(void); virtual std::string tested(void); virtual std::string testOk(void); virtual XMLNode *resultNode(void); /** Destructor */ virtual ~Result(); }; } #endif |