CMS 3D CMS Logo

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