EICd
EIC data model
FloatPair.h
Go to the documentation of this file.
1 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2 
3 #ifndef EICD_FloatPair_H
4 #define EICD_FloatPair_H
5 
6 #include <tuple>
7 #include <ostream>
8 
9 namespace eic {
10 
11 
12 class FloatPair {
13 public:
14  float first{};
15  float second{};
16 
17  FloatPair() : first{0}, second{0} {}
18  FloatPair(double a, double b) : first{static_cast<float>(a)}, second{static_cast<float>(b)} {}
19  FloatPair(const std::pair<float, float>& p) : first{p.first}, second{p.second} {}
20  FloatPair& operator=(const std::pair<float, float>& p) {first = p.first; second = p.second; return *this;}
21  float& operator[](unsigned i) {return *(&first + i);}
22  const float& operator[](unsigned i) const {return *(&first + i);}
23  operator std::pair<float, float>() const {return {first, second};}
24 
25 
26 };
27 
28 inline std::ostream& operator<<(std::ostream& o, const eic::FloatPair& value) {
29  o << value.first << " ";
30  o << value.second << " ";
31 
32  return o;
33 }
34 
35 } // namespace eic
36 
37 
38 
39 #endif
eic::operator<<
std::ostream & operator<<(std::ostream &o, const ConstBasicParticle &value)
Definition: BasicParticle.cc:102
eic::FloatPair::operator[]
float & operator[](unsigned i)
Definition: FloatPair.h:21
eic::FloatPair::FloatPair
FloatPair(const std::pair< float, float > &p)
Definition: FloatPair.h:19
eic
Definition: BasicParticle.cc:13
eic::FloatPair::first
float first
Definition: FloatPair.h:14
eic::FloatPair::second
float second
Definition: FloatPair.h:15
eic::FloatPair::operator=
FloatPair & operator=(const std::pair< float, float > &p)
Definition: FloatPair.h:20
eic::FloatPair::operator[]
const float & operator[](unsigned i) const
Definition: FloatPair.h:22
eic::FloatPair::FloatPair
FloatPair()
Definition: FloatPair.h:17
eic::FloatPair
Definition: FloatPair.h:12
eic::FloatPair::FloatPair
FloatPair(double a, double b)
Definition: FloatPair.h:18