CARLA
 
载入中...
搜索中...
未找到
DVSEvent.h
浏览该文件的文档.
1// Copyright (c) 2020 Robotics and Perception Group (GPR)
2// University of Zurich and ETH Zurich
3//
4// This work is licensed under the terms of the MIT license.
5// For a copy, see <https://opensource.org/licenses/MIT>.
6
7#pragma once
8
9#include <cstdint>
10
11namespace carla {
12namespace sensor {
13namespace data {
14
15#pragma pack(push, 1)
16struct DVSEvent {
17 /// Default constructor
18 DVSEvent() = default;
19
20 /// Copy Constructor
21 DVSEvent(const DVSEvent &arg)
22 : x(arg.x), y(arg.y), t(arg.t), pol(arg.pol) {}
23
24 /// Moving constructor
25 DVSEvent(const DVSEvent &&arg)
26 : x(std::move(arg.x)),
27 y(std::move(arg.y)),
28 t(std::move(arg.t)),
29 pol(std::move(arg.pol)) {}
30
31 /// Constructor
32 DVSEvent(std::uint16_t x, std::uint16_t y, std::int64_t t, bool pol)
33 : x(x), y(y), t(t), pol(pol) {}
34
35 /// Assignement operator
36 DVSEvent &operator=(const DVSEvent &other) {
37 x = other.x;
38 y = other.y;
39 t = other.t;
40 pol = other.pol;
41 return *this;
42 }
43
44 /// Move Assignement operator
45 DVSEvent &operator=(const DVSEvent &&other) {
46 x = std::move(other.x);
47 y = std::move(other.y);
48 t = std::move(other.t);
49 pol = std::move(other.pol);
50 return *this;
51 }
52
53 bool operator==(const DVSEvent &rhs) const {
54 return (x == rhs.x) && (y == rhs.y) && (t == rhs.t) && (pol == rhs.pol);
55 }
56
57 bool operator!=(const DVSEvent &rhs) const {
58 return !(*this == rhs);
59 }
60
61 std::uint16_t x;
62 std::uint16_t y;
63 std::int64_t t;
64 bool pol;
65
66 };
67#pragma pack(pop)
68} // namespace data
69} // namespace sensor
70} // namespace carla
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133
bool operator==(const DVSEvent &rhs) const
Definition DVSEvent.h:53
DVSEvent & operator=(const DVSEvent &other)
Assignement operator
Definition DVSEvent.h:36
DVSEvent(const DVSEvent &&arg)
Moving constructor
Definition DVSEvent.h:25
bool operator!=(const DVSEvent &rhs) const
Definition DVSEvent.h:57
DVSEvent()=default
Default constructor
DVSEvent(std::uint16_t x, std::uint16_t y, std::int64_t t, bool pol)
Constructor
Definition DVSEvent.h:32
DVSEvent(const DVSEvent &arg)
Copy Constructor
Definition DVSEvent.h:21
DVSEvent & operator=(const DVSEvent &&other)
Move Assignement operator
Definition DVSEvent.h:45