ra4_stats  0341147a0dc35f80f4e12c6003afb76a38e2ed6e
block.cpp
Go to the documentation of this file.
1 #include "block.hpp"
2 
3 #include <string>
4 #include <vector>
5 #include <initializer_list>
6 
7 using namespace std;
8 
9 Block::Block(const string &name, const vector<vector<Bin> > &bins):
10  bins_(bins),
11  name_(name){
12  }
13 
14 Block::Block(const string &name, initializer_list<vector<Bin> > bins):
15  bins_(bins),
16  name_(name){
17  }
18 
19 const string & Block::Name() const{
20  return name_;
21 }
22 
23 Block & Block::Name(const std::string &name){
24  name_ = name;
25  return *this;
26 }
27 
28 const vector<vector<Bin> > & Block::Bins() const{
29  return bins_;
30 }
31 
32 vector<vector<Bin> > & Block::Bins(){
33  return bins_;
34 }
35 
36 bool Block::operator<(const Block &b) const{
37  return bins_ < b.bins_;
38 }
39 
40 bool Block::operator==(const Block &b) const{
41  return bins_ == b.bins_;
42 }
43 
44 ostream & operator<<(ostream &stream, const Block &block){
45  stream << "Block::" << block.Name();
46  return stream;
47 }
STL namespace.
bool operator==(const Block &b) const
Definition: block.cpp:40
ostream & operator<<(ostream &stream, const Block &block)
Definition: block.cpp:44
std::string name_
Definition: block.hpp:28
Definition: block.hpp:12
std::vector< std::vector< Bin > > bins_
Definition: block.hpp:27
const std::string & Name() const
Definition: block.cpp:19
const std::vector< std::vector< Bin > > & Bins() const
Definition: block.cpp:28
bool operator<(const Block &b) const
Definition: block.cpp:36
Block(const std::string &name, const std::vector< std::vector< Bin > > &bins)