ad_rss
RelativeObjectState.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 <memory>
22 #include <sstream>
30 namespace ad {
34 namespace rss {
38 namespace core {
39 
48 {
52  typedef std::shared_ptr<RelativeObjectState> Ptr;
53 
57  typedef std::shared_ptr<RelativeObjectState const> ConstPtr;
58 
62  RelativeObjectState() = default;
63 
67  ~RelativeObjectState() = default;
68 
72  RelativeObjectState(const RelativeObjectState &other) = default;
73 
78 
87 
96 
104  bool operator==(const RelativeObjectState &other) const
105  {
106  return (object_type == other.object_type) && (dynamics == other.dynamics)
109  }
110 
118  bool operator!=(const RelativeObjectState &other) const
119  {
120  return !operator==(other);
121  }
122 
127 
132 
137 
142 };
143 
144 } // namespace core
145 } // namespace rss
146 } // namespace ad
147 
151 #ifndef GEN_GUARD_AD_RSS_CORE_RELATIVEOBJECTSTATE
152 #define GEN_GUARD_AD_RSS_CORE_RELATIVEOBJECTSTATE
156 namespace ad {
160 namespace rss {
164 namespace core {
165 
175 inline std::ostream &operator<<(std::ostream &os, RelativeObjectState const &_value)
176 {
177  os << "RelativeObjectState(";
178  os << "object_type:";
179  os << _value.object_type;
180  os << ",";
181  os << "dynamics:";
182  os << _value.dynamics;
183  os << ",";
184  os << "unstructured_object_state:";
185  os << _value.unstructured_object_state;
186  os << ",";
187  os << "structured_object_state:";
188  os << _value.structured_object_state;
189  os << ")";
190  return os;
191 }
192 
193 } // namespace core
194 } // namespace rss
195 } // namespace ad
196 
197 namespace std {
201 inline std::string to_string(::ad::rss::core::RelativeObjectState const &value)
202 {
203  stringstream sstream;
204  sstream << value;
205  return sstream.str();
206 }
207 } // namespace std
208 
212 template <> struct fmt::formatter<::ad::rss::core::RelativeObjectState> : formatter<string_view>
213 {
214  template <typename FormatContext> auto format(::ad::rss::core::RelativeObjectState const &value, FormatContext &ctx)
215  {
216  return formatter<string_view>::format(std::to_string(value), ctx);
217  }
218 };
219 
220 #endif // GEN_GUARD_AD_RSS_CORE_RELATIVEOBJECTSTATE
std::string to_string(::ad::rss::core::LateralRelativePosition const &value)
overload of the std::to_string for LateralRelativePosition
Definition: LateralRelativePosition.hpp:162
std::ostream & operator<<(std::ostream &os, LateralRelativePosition const &value)
standard ostream operator
Definition: LateralRelativePosition.hpp:149
ObjectType
DataType ObjectType.
Definition: ObjectType.hpp:44
namespace ad
Definition: LateralRelativePosition.hpp:28
DataType RelativeObjectState.
Definition: RelativeObjectState.hpp:48
::ad::rss::core::StructuredObjectState structured_object_state
Definition: RelativeObjectState.hpp:141
RelativeObjectState & operator=(const RelativeObjectState &other)=default
standard assignment operator
RelativeObjectState(RelativeObjectState &&other)=default
standard move constructor
RelativeObjectState()=default
standard constructor
bool operator!=(const RelativeObjectState &other) const
standard comparison operator
Definition: RelativeObjectState.hpp:118
::ad::rss::world::ObjectState unstructured_object_state
Definition: RelativeObjectState.hpp:136
std::shared_ptr< RelativeObjectState > Ptr
Smart pointer on RelativeObjectState.
Definition: RelativeObjectState.hpp:52
bool operator==(const RelativeObjectState &other) const
standard comparison operator
Definition: RelativeObjectState.hpp:104
RelativeObjectState & operator=(RelativeObjectState &&other)=default
standard move operator
::ad::rss::world::RssDynamics dynamics
Definition: RelativeObjectState.hpp:131
RelativeObjectState(const RelativeObjectState &other)=default
standard copy constructor
std::shared_ptr< RelativeObjectState const > ConstPtr
Smart pointer on constant RelativeObjectState.
Definition: RelativeObjectState.hpp:57
::ad::rss::world::ObjectType object_type
Definition: RelativeObjectState.hpp:126
~RelativeObjectState()=default
standard destructor
DataType StructuredObjectState.
Definition: StructuredObjectState.hpp:49
DataType ObjectState.
Definition: ObjectState.hpp:52
DataType RssDynamics.
Definition: RssDynamics.hpp:51