ad_rss
generated
include
ad
rss
world
Object.hpp
Go to the documentation of this file.
1
/*
2
* ----------------- BEGIN LICENSE BLOCK ---------------------------------
3
*
4
* Copyright (C) 2018-2022 Intel Corporation
5
*
6
* SPDX-License-Identifier: LGPL-2.1-only
7
*
8
* ----------------- END LICENSE BLOCK -----------------------------------
9
*/
10
18
#pragma once
19
20
#include <iostream>
21
#include <limits>
22
#include <memory>
23
#include <sstream>
24
#include "
ad/rss/world/ObjectId.hpp
"
25
#include "
ad/rss/world/ObjectState.hpp
"
26
#include "
ad/rss/world/ObjectType.hpp
"
27
#include "
ad/rss/world/OccupiedRegionVector.hpp
"
28
#include "
ad/rss/world/Velocity.hpp
"
32
namespace
ad
{
36
namespace
rss {
40
namespace
world {
41
48
struct
Object
49
{
53
typedef
std::shared_ptr<Object>
Ptr
;
54
58
typedef
std::shared_ptr<Object const>
ConstPtr
;
59
63
Object
() =
default
;
64
68
~Object
() =
default
;
69
73
Object
(
const
Object
&other) =
default
;
74
78
Object
(
Object
&&other) =
default
;
79
87
Object
&
operator=
(
const
Object
&other) =
default
;
88
96
Object
&
operator=
(
Object
&&other) =
default
;
97
105
bool
operator==
(
const
Object
&other)
const
106
{
107
return
(
object_id
== other.
object_id
) && (
object_type
== other.
object_type
)
108
&& (
occupied_regions
== other.
occupied_regions
) && (
velocity
== other.
velocity
) && (
state
== other.
state
);
109
}
110
118
bool
operator!=
(
const
Object
&other)
const
119
{
120
return
!
operator==
(other);
121
}
122
126
::ad::rss::world::ObjectId
object_id
;
127
131
::ad::rss::world::ObjectType
object_type
{
::ad::rss::world::ObjectType::Invalid
};
132
136
::ad::rss::world::OccupiedRegionVector
occupied_regions
;
137
141
::ad::rss::world::Velocity
velocity
;
142
146
::ad::rss::world::ObjectState
state
;
147
};
148
149
}
// namespace world
150
}
// namespace rss
151
}
// namespace ad
152
156
#ifndef GEN_GUARD_AD_RSS_WORLD_OBJECT
157
#define GEN_GUARD_AD_RSS_WORLD_OBJECT
161
namespace
ad
{
165
namespace
rss {
169
namespace
world {
170
180
inline
std::ostream &
operator<<
(std::ostream &os,
Object
const
&_value)
181
{
182
os <<
"Object("
;
183
os <<
"object_id:"
;
184
os << _value.
object_id
;
185
os <<
","
;
186
os <<
"object_type:"
;
187
os << _value.
object_type
;
188
os <<
","
;
189
os <<
"occupied_regions:"
;
190
os << _value.
occupied_regions
;
191
os <<
","
;
192
os <<
"velocity:"
;
193
os << _value.
velocity
;
194
os <<
","
;
195
os <<
"state:"
;
196
os << _value.
state
;
197
os <<
")"
;
198
return
os;
199
}
200
201
}
// namespace world
202
}
// namespace rss
203
}
// namespace ad
204
205
namespace
std {
209
inline
std::string
to_string
(::
ad::rss::world::Object
const
&value)
210
{
211
stringstream sstream;
212
sstream << value;
213
return
sstream.str();
214
}
215
}
// namespace std
216
220
template
<>
struct
fmt::formatter<::
ad::rss::world::Object
> : formatter<string_view>
221
{
222
template
<
typename
FormatContext>
auto
format(::
ad::rss::world::Object
const
&value, FormatContext &ctx)
223
{
224
return
formatter<string_view>::format(std::to_string(value), ctx);
225
}
226
};
227
228
#endif
// GEN_GUARD_AD_RSS_WORLD_OBJECT
std::to_string
std::string to_string(::ad::rss::core::LateralRelativePosition const &value)
overload of the std::to_string for LateralRelativePosition
Definition:
LateralRelativePosition.hpp:162
ObjectId.hpp
ObjectState.hpp
ObjectType.hpp
OccupiedRegionVector.hpp
Velocity.hpp
ad::rss::world::ObjectType
ObjectType
DataType ObjectType.
Definition:
ObjectType.hpp:44
ad::rss::world::ObjectType::Invalid
@ Invalid
ad::rss::world::ObjectId
uint64_t ObjectId
DataType ObjectId.
Definition:
ObjectId.hpp:39
ad::rss::world::OccupiedRegionVector
std::vector<::ad::rss::world::OccupiedRegion > OccupiedRegionVector
DataType OccupiedRegionVector.
Definition:
OccupiedRegionVector.hpp:42
ad::rss::world::operator<<
std::ostream & operator<<(std::ostream &os, Constellation const &_value)
standard ostream operator
Definition:
Constellation.hpp:198
ad
namespace ad
Definition:
LateralRelativePosition.hpp:28
ad::rss::world::ObjectState
DataType ObjectState.
Definition:
ObjectState.hpp:52
ad::rss::world::Object
DataType Object.
Definition:
Object.hpp:49
ad::rss::world::Object::Object
Object()=default
standard constructor
ad::rss::world::Object::Object
Object(const Object &other)=default
standard copy constructor
ad::rss::world::Object::object_type
::ad::rss::world::ObjectType object_type
Definition:
Object.hpp:131
ad::rss::world::Object::velocity
::ad::rss::world::Velocity velocity
Definition:
Object.hpp:141
ad::rss::world::Object::object_id
::ad::rss::world::ObjectId object_id
Definition:
Object.hpp:126
ad::rss::world::Object::ConstPtr
std::shared_ptr< Object const > ConstPtr
Smart pointer on constant Object.
Definition:
Object.hpp:58
ad::rss::world::Object::operator=
Object & operator=(const Object &other)=default
standard assignment operator
ad::rss::world::Object::operator!=
bool operator!=(const Object &other) const
standard comparison operator
Definition:
Object.hpp:118
ad::rss::world::Object::Object
Object(Object &&other)=default
standard move constructor
ad::rss::world::Object::operator=
Object & operator=(Object &&other)=default
standard move operator
ad::rss::world::Object::~Object
~Object()=default
standard destructor
ad::rss::world::Object::operator==
bool operator==(const Object &other) const
standard comparison operator
Definition:
Object.hpp:105
ad::rss::world::Object::occupied_regions
::ad::rss::world::OccupiedRegionVector occupied_regions
Definition:
Object.hpp:136
ad::rss::world::Object::Ptr
std::shared_ptr< Object > Ptr
Smart pointer on Object.
Definition:
Object.hpp:53
ad::rss::world::Object::state
::ad::rss::world::ObjectState state
Definition:
Object.hpp:146
ad::rss::world::Velocity
DataType Velocity.
Definition:
Velocity.hpp:48
Generated by
1.9.1