Jpp  18.3.0-rc.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  using JEEP::JProperties;
20 
21 
22  /**
23  * Class dedicated to standardize the title of the graphical objects produced by the JTest_t() derived classes.
24  */
26  {
27  public:
28  /**
29  * Default constructor
30  */
32  {}
33 
34 
35  /**
36  * Constructor
37  *
38  * \param testName Test name
39  * \param parameterName Name of the parameter used to decide if the test passes.
40  * \param passed True if the test passes, false if it fails.
41  * \param value Value of the parameter used to decide if the test passes.
42  */
45  const bool passed,
46  const double value):
47  testName (testName),
48  parameterName (parameterName),
49  passed (passed ? "TRUE" : "FALSE"),
50  value (value)
51  {}
52 
53 
54  /**
55  * Returns a standard string to be used as title of a graphical root object.
56  */
58  {
59  return MAKE_STRING(getProperties(*this));
60  }
61 
62 
63  /**
64  * Stream input.
65  *
66  * \param in input stream
67  * \param title result title
68  * \return input stream
69  */
70  friend inline std::istream& operator>>(std::istream& in, JResultTitle& title)
71  {
72  return in >> getProperties(title);
73  }
74 
75 
76  /**
77  * Stream output.
78  *
79  * \param out output stream
80  * \param title result title
81  * \return output stream
82  */
83  friend inline std::ostream& operator<<(std::ostream& out, const JResultTitle& title)
84  {
85  return out << getProperties(title);
86  }
87 
88 
89  std::string testName; /*!< Test name. */
90  std::string parameterName; /*!< Name of the parameter used to evaluate the test. */
91  std::string passed; /*!< Human readable version of "passed". */
92  double value; /*!< Value of the parameter used to evaluate the test.*/
93 
94 
95  private:
96  /**
97  * Get properties of this class.
98  *
99  * \param object result title object
100  * \return properties
101  */
102  template<class JResultTitle_t>
103  static inline JProperties getProperties(JResultTitle_t& object)
104  {
105  JProperties properties;
106 
107  properties.setEndOfLine(":");
108 
109  properties.insert(gmake_property(object.testName));
110  properties.insert(gmake_property(object.parameterName));
111  properties.insert(gmake_property(object.passed));
112  properties.insert(gmake_property(object.value));
113 
114  return properties;
115  }
116  };
117 }
118 
119 #endif
std::string getTitle() const
Returns a standard string to be used as title of a graphical root object.
Definition: JResultTitle.hh:57
#define gmake_property(A)
macros 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:25
Utility class to parse parameter values.
Definition: JProperties.hh:497
void setEndOfLine(const std::string &eol)
Set end of line characters.
friend std::istream & operator>>(std::istream &in, JResultTitle &title)
Stream input.
Definition: JResultTitle.hh:70
Utility class to parse parameter values.
#define MAKE_STRING(A)
Make string.
Definition: JPrint.hh:127
JResultTitle(const std::string &testName, const std::string &parameterName, const bool passed, const double value)
Constructor.
Definition: JResultTitle.hh:43
I/O formatting auxiliaries.
friend std::ostream & operator<<(std::ostream &out, const JResultTitle &title)
Stream output.
Definition: JResultTitle.hh:83
then awk string
JResultTitle()
Default constructor.
Definition: JResultTitle.hh:31
static JProperties getProperties(JResultTitle_t &object)
Get properties of this class.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:48