Jpp  15.0.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JResultTitle.hh
Go to the documentation of this file.
1 #ifndef __JCOMPAREHISTOGRAMS__JRESULTTITLE_T__
2 #define __JCOMPAREHISTOGRAMS__JRESULTTITLE_T__
3 
4 #include <string>
5 
6 #include "Jeep/JPrint.hh"
7 #include "Jeep/JProperties.hh"
8 
9 
10 /**
11  * \author rgruiz
12  */
13 
14 namespace JCOMPAREHISTOGRAMS {}
15 namespace JPP { using namespace JCOMPAREHISTOGRAMS; }
16 
17 namespace JCOMPAREHISTOGRAMS {
18 
19  /**
20  * Class dedicated to standardize the title of the graphical objects produced by the JTest_t() derived classes.
21  */
22  class JResultTitle:
23  public JProperties
24  {
25  public:
26  /**
27  * Default constructor
28  */
30  {
31  this->setEndOfLine(":");
32  this->insert(gmake_property(name));
33  this->insert(gmake_property(parameter));
34  this->insert(gmake_property(value));
35  this->insert(gmake_property(passed));
36  };
37 
38 
39  /**
40  * Constructor
41  *
42  * \param Name Test name
43  * \param Parameter Name of the parameter used to decide if the test passes.
44  * \param Value Value of the parameter used to decide if the test passes.
45  * \param Passed True if the test passes, false if it fails.
46  */
47  JResultTitle(std::string Name, std::string Parameter, bool Passed, double Value):
48  name (Name),
49  parameter (Parameter),
50  value (Value)
51  {
52  this->setEndOfLine(":");
53  passed = Passed ? "TRUE" : "FALSE";
54 
55  this->insert(gmake_property(name));
56  this->insert(gmake_property(parameter));
57  this->insert(gmake_property(value));
58  this->insert(gmake_property(passed));
59  }
60 
61  /**
62  * Returns a standard string to be used as title of a graphical root object.
63  */
64  std::string getTitle(){
65  return MAKE_STRING(*this);
66  }
67 
68  std::string name; /*!< Test name. */
69  std::string parameter; /*!< Name of the parameter used to evaluate the test. */
70  std::string passed; /*!< Human readable version of "passed". */
71  double value; /*!< Value of the parameter used to evaluate the test.*/
72  };
73 }
74 
75 #endif
#define gmake_property(A)
macro to convert (template) parameter to JPropertiesElement object
Class dedicated to standardize the title of the graphical objects produced by the JTest_t() derived c...
Definition: JResultTitle.hh:22
Utility class to parse parameter values.
Definition: JProperties.hh:496
JResultTitle(std::string Name, std::string Parameter, bool Passed, double Value)
Constructor.
Definition: JResultTitle.hh:47
void setEndOfLine(const std::string &eol)
Set end of line characters.
Utility class to parse parameter values.
#define MAKE_STRING(A)
Make string.
Definition: JPrint.hh:142
I/O formatting auxiliaries.
JResultTitle()
Default constructor.
Definition: JResultTitle.hh:29
std::string getTitle()
Returns a standard string to be used as title of a graphical root object.
Definition: JResultTitle.hh:64