CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
BlobComplex.cc
Go to the documentation of this file.
1 #include <iostream>
2 
4 
5 void BlobComplexData::fill(unsigned int &serial) {
6  a = ++serial;
7  b = ++serial;
8  for (unsigned int i = 0; i < 10; i++)
9  values.push_back(++serial);
10 }
11 
12 void BlobComplexData::print() const {
13  std::cout << " a = " << a << std::endl;
14  std::cout << " b = " << b << std::endl;
15  for (std::vector<unsigned int>::const_iterator iter = values.begin(); iter != values.end(); iter++)
16  std::cout << " value[" << (iter - values.begin()) << "] = " << *iter << std::endl;
17 }
18 
20  if (a != rhs.a)
21  return false;
22  if (b != rhs.b)
23  return false;
24  if (values.size() != rhs.values.size())
25  return false;
26  std::vector<unsigned int>::const_iterator iter1 = values.begin();
27  std::vector<unsigned int>::const_iterator iter2 = rhs.values.begin();
28  while (iter1 != values.end())
29  if (*iter1++ != *iter2++)
30  return false;
31  return true;
32 }
33 
34 void BlobComplexContent::fill(unsigned int &serial) {
35  data1.first.fill(serial);
36  data1.second = ++serial;
37  data2.first.fill(serial);
38  data2.second = ++serial;
39  data3.first.fill(serial);
40  data3.second = ++serial;
41 }
42 
44  std::cout << " first = " << std::endl;
45  data.first.print();
46  std::cout << " second = " << data.second << std::endl;
47 }
48 
50  std::cout << " data1 = " << std::endl;
52  std::cout << " data2 = " << std::endl;
54  std::cout << " data3 = " << std::endl;
56 }
57 
59  if (data1.first != rhs.data1.first || data1.second != rhs.data1.second)
60  return false;
61  if (data2.first != rhs.data2.first || data2.second != rhs.data2.second)
62  return false;
63  if (data3.first != rhs.data3.first || data3.second != rhs.data3.second)
64  return false;
65  return true;
66 }
67 
68 void BlobComplexObjects::fill(unsigned int &serial) {
69  a = ++serial;
70  b = ++serial;
71  for (unsigned int i = 0; i < 3; i++) {
72  content.push_back(BlobComplexContent());
73  content.back().fill(serial);
74  }
75 }
76 
78  std::cout << " a = " << a << std::endl;
79  std::cout << " b = " << b << std::endl;
80  for (std::vector<BlobComplexContent>::const_iterator iter = content.begin(); iter != content.end(); iter++) {
81  std::cout << " content[" << (iter - content.begin()) << "] =" << std::endl;
82  iter->print();
83  }
84 }
85 
87  if (a != rhs.a)
88  return false;
89  if (b != rhs.b)
90  return false;
91  if (content.size() != rhs.content.size())
92  return false;
93  std::vector<BlobComplexContent>::const_iterator iter1 = content.begin();
94  std::vector<BlobComplexContent>::const_iterator iter2 = rhs.content.begin();
95  while (iter1 != content.end())
96  if (*iter1++ != *iter2++)
97  return false;
98  return true;
99 }
100 
101 void BlobComplex::fill(unsigned int &serial) {
102  for (unsigned int i = 0; i < 3; i++) {
103  objects.push_back(BlobComplexObjects());
104  objects.back().fill(serial);
105  }
106 }
107 
108 void BlobComplex::print() const {
109  for (std::vector<BlobComplexObjects>::const_iterator iter = objects.begin(); iter != objects.end(); iter++) {
110  std::cout << "objects[" << (iter - objects.begin()) << "] =" << std::endl;
111  iter->print();
112  }
113 }
114 
115 bool BlobComplex::operator==(const BlobComplex &rhs) const {
116  if (objects.size() != rhs.objects.size())
117  return false;
118  std::vector<BlobComplexObjects>::const_iterator iter1 = objects.begin();
119  std::vector<BlobComplexObjects>::const_iterator iter2 = rhs.objects.begin();
120  while (iter1 != objects.end())
121  if (*iter1++ != *iter2++)
122  return false;
123  return true;
124 }
bool operator==(const BlobComplex &rhs) const
Definition: BlobComplex.cc:115
void fill(unsigned int &serial)
Definition: BlobComplex.cc:5
std::pair< BlobComplexData, unsigned int > Data
Definition: BlobComplex.h:34
bool operator==(const BlobComplexContent &rhs) const
Definition: BlobComplex.cc:58
unsigned int a
Definition: BlobComplex.h:54
void print() const
Definition: BlobComplex.cc:77
unsigned int a
Definition: BlobComplex.h:20
void fill(unsigned int &serial)
Definition: BlobComplex.cc:34
unsigned int b
Definition: BlobComplex.h:20
unsigned int b
Definition: BlobComplex.h:54
bool operator==(const BlobComplexObjects &rhs) const
Definition: BlobComplex.cc:86
std::vector< BlobComplexObjects > objects
Definition: BlobComplex.h:68
void print() const
Definition: BlobComplex.cc:12
void print() const
Definition: BlobComplex.cc:49
static void printBlobComplexContentData(const BlobComplexContent::Data &data)
Definition: BlobComplex.cc:43
std::vector< BlobComplexContent > content
Definition: BlobComplex.h:55
std::vector< unsigned int > values
Definition: BlobComplex.h:21
void print() const
Definition: BlobComplex.cc:108
void fill(unsigned int &serial)
Definition: BlobComplex.cc:101
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
bool operator==(const BlobComplexData &rhs) const
Definition: BlobComplex.cc:19
tuple cout
Definition: gather_cfg.py:144
void fill(unsigned int &serial)
Definition: BlobComplex.cc:68