EvalCaseResults.cpp
Go to the documentation of this file.
1 //
2 // EvalCaseResults.cpp
3 //
4 
5 #include "EvalCaseResults.hpp"
6 #include <sstream>
7 
8 
9 namespace datatypes
10 {
11 
12 //
14 {
16 }
17 
18 
19 
21 {
23  m_sourceId = sourceId;
24 }
25 
26 
27 
28 // Default destructor
30 {
31 }
32 
33 // Estimate the memory usage of this object.
35 {
36  UINT32 sum = sizeof(*this);
37  EvalCaseResultVector::const_iterator iter;
38  for (iter = m_evalCases.begin(); iter != m_evalCases.end(); iter++)
39  {
40  sum += iter->getUsedMemory();
41  }
42  return sum;
43 }
44 
45 
46 std::string EvalCaseResults::toString() const
47 {
48  std::ostringstream os;
49  os << "There are " << size() << " EvalCaseResults:" << std::endl << std::endl;
50  for (size_t i = 0; i < size(); i++)
51  {
52  os << at(i).toString() << std::endl;
53  }
54 
55  return os.str();
56 }
57 
58 //
59 //
60 //
62 {
63  bool isTheSame = false;
64 
65  if (size() == other.size())
66  {
67  EvalCaseResultVector::const_iterator iter1, iter2;
68  iter1 = m_evalCases.begin();
69  iter2 = other.m_evalCases.begin();
70  isTheSame = true;
71 
72  for (; iter1 != m_evalCases.end(); ++iter1, ++iter2)
73  {
74  if ((iter1->m_sCaseName != iter2->m_sCaseName) || (iter1->m_eCaseResult != iter2->m_eCaseResult))
75  {
76  isTheSame = false;
77  break;
78  }
79  }
80  }
81 
82  return isTheSame;
83 }
84 
85 
87 {
88  return ! operator==(other);
89 }
90 
91 } // END namespace datatypes
const EvalCaseResult & at(UINT8 n) const
uint32_t UINT32
bool operator!=(const EvalCaseResults &other)
std::string toString() const
std::string toString() const
EvalCaseResultVector m_evalCases
bool operator==(const EvalCaseResults &other)
const UINT32 getUsedMemory() const
uint8_t UINT8


libsick_ldmrs
Author(s): SICK AG , Martin Günther , Jochen Sprickerhof
autogenerated on Mon Oct 26 2020 03:27:30