CombineHarvester
Object.cc
Go to the documentation of this file.
2 #include <iostream>
3 namespace ch {
4 
6  : bin_(""),
7  process_(""),
8  signal_(false),
9  analysis_(""),
10  era_(""),
11  channel_(""),
12  bin_id_(0),
13  mass_("") {
14  }
15 
17 
18 void swap(Object& first, Object& second) {
19  using std::swap;
20  swap(first.bin_, second.bin_);
21  swap(first.process_, second.process_);
22  swap(first.signal_, second.signal_);
23  swap(first.analysis_, second.analysis_);
24  swap(first.era_, second.era_);
25  swap(first.channel_, second.channel_);
26  swap(first.bin_id_, second.bin_id_);
27  swap(first.mass_, second.mass_);
28  swap(first.attributes_, second.attributes_);
29 }
30 
31 Object::Object(Object const& other)
32  : bin_(other.bin_),
33  process_(other.process_),
34  signal_(other.signal_),
35  analysis_(other.analysis_),
36  era_(other.era_),
37  channel_(other.channel_),
38  bin_id_(other.bin_id_),
39  mass_(other.mass_),
40  attributes_(other.attributes_) {
41 }
42 
44  : bin_(""),
45  process_(""),
46  signal_(false),
47  analysis_(""),
48  era_(""),
49  channel_(""),
50  bin_id_(0),
51  mass_("") {
52  swap(*this, other);
53 }
54 
55 void Object::set_attribute(std::string const& attr_label, std::string const& attr_value){
56  if(attributes_.count(attr_label)>0){
57  attributes_[attr_label]=attr_value;
58  } else {
59  attributes_.insert(std::pair<std::string,std::string>(attr_label,attr_value));
60  }
61 }
62 
64  swap(*this, other);
65  return (*this);
66 }
67 }
virtual void set_attribute(std::string const &attr_label, std::string const &attr_value)
Definition: Object.cc:55
Object & operator=(Object other)
Definition: Object.cc:63
friend void swap(Object &first, Object &second)
Definition: Object.cc:18
Object()
Definition: Object.cc:5
virtual ~Object()
Definition: Object.cc:16
Definition: Algorithm.h:10
void swap(CombineHarvester &first, CombineHarvester &second)
void swap(Object &first, Object &second)
Definition: Object.cc:18