Agrarsense
DVSEvent.h
Go to the documentation of this file.
1// Copyright (c) 2023 FrostBit Software Lab at the Lapland University of Applied Sciences
2//
3// This work is licensed under the terms of the MIT license.
4// For a copy, see <https://opensource.org/licenses/MIT>.
5
6#pragma once
7
8#include <cstdint>
9
11{
13 DVSEvent() = default;
14
16 DVSEvent(const DVSEvent& arg)
17 : x(arg.x), y(arg.y), t(arg.t), pol(arg.pol) {}
18
20 DVSEvent(const DVSEvent&& arg)
21 : x(std::move(arg.x)),
22 y(std::move(arg.y)),
23 t(std::move(arg.t)),
24 pol(std::move(arg.pol)) {}
25
27 DVSEvent(std::uint16_t x, std::uint16_t y, std::int32_t t, bool pol)
28 : x(x), y(y), t(t), pol(pol) {}
29
31 DVSEvent& operator=(const DVSEvent& other)
32 {
33 x = other.x;
34 y = other.y;
35 t = other.t;
36 pol = other.pol;
37 return *this;
38 }
39
41 DVSEvent& operator=(const DVSEvent&& other)
42 {
43 x = std::move(other.x);
44 y = std::move(other.y);
45 t = std::move(other.t);
46 pol = std::move(other.pol);
47 return *this;
48 }
49
50 bool operator==(const DVSEvent& rhs) const
51 {
52 return (x == rhs.x) && (y == rhs.y) && (t == rhs.t) && (pol == rhs.pol);
53 }
54
55 bool operator!=(const DVSEvent& rhs) const
56 {
57 return !(*this == rhs);
58 }
59
60 std::uint16_t x;
61 std::uint16_t y;
62 std::int32_t t;
63 bool pol;
64
65};
std::int32_t t
Definition: DVSEvent.h:62
bool operator==(const DVSEvent &rhs) const
Definition: DVSEvent.h:50
std::uint16_t y
Definition: DVSEvent.h:61
DVSEvent(const DVSEvent &arg)
Copy Constructor.
Definition: DVSEvent.h:16
DVSEvent(std::uint16_t x, std::uint16_t y, std::int32_t t, bool pol)
Constructor.
Definition: DVSEvent.h:27
DVSEvent & operator=(const DVSEvent &other)
Assignement operator.
Definition: DVSEvent.h:31
DVSEvent(const DVSEvent &&arg)
Moving constructor.
Definition: DVSEvent.h:20
bool pol
Definition: DVSEvent.h:63
std::uint16_t x
Definition: DVSEvent.h:60
DVSEvent()=default
Default constructor.
bool operator!=(const DVSEvent &rhs) const
Definition: DVSEvent.h:55
DVSEvent & operator=(const DVSEvent &&other)
Move Assignement operator.
Definition: DVSEvent.h:41