File indexing completed on 2024-11-15 09:35:46
0001
0002
0003 #ifndef EDM4HEP_Vector2i_H
0004 #define EDM4HEP_Vector2i_H
0005
0006 #include <cstdint>
0007 #include <ostream>
0008
0009 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0010 #include "nlohmann/json_fwd.hpp"
0011 #endif
0012
0013 namespace edm4hep {
0014
0015
0016
0017
0018
0019 class Vector2i {
0020 public:
0021 std::int32_t a{};
0022 std::int32_t b{};
0023
0024 constexpr Vector2i() : a(0), b(0) {
0025 }
0026 constexpr Vector2i(int32_t aa, int32_t bb) : a(aa), b(bb) {
0027 }
0028 constexpr Vector2i(const int32_t* v) : a(v[0]), b(v[1]) {
0029 }
0030 constexpr bool operator==(const Vector2i& v) const {
0031 return (a == v.a && b == v.b);
0032 }
0033 constexpr int operator[](unsigned i) const {
0034 return *(&a + i);
0035 }
0036 };
0037
0038 std::ostream& operator<<(std::ostream& o, const edm4hep::Vector2i& value);
0039
0040 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0041 void to_json(nlohmann::json& j, const Vector2i& value);
0042 #endif
0043
0044 }
0045
0046 #endif