ad_rss
Situation.hpp
Go to the documentation of this file.
1 /*
2  * ----------------- BEGIN LICENSE BLOCK ---------------------------------
3  *
4  * Copyright (C) 2018-2020 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>
32 namespace ad {
36 namespace rss {
40 namespace situation {
41 
53 struct Situation
54 {
58  typedef std::shared_ptr<Situation> Ptr;
59 
63  typedef std::shared_ptr<Situation const> ConstPtr;
64 
68  Situation() = default;
69 
73  ~Situation() = default;
74 
78  Situation(const Situation &other) = default;
79 
83  Situation(Situation &&other) = default;
84 
92  Situation &operator=(const Situation &other) = default;
93 
101  Situation &operator=(Situation &&other) = default;
102 
110  bool operator==(const Situation &other) const
111  {
112  return (situationId == other.situationId) && (objectId == other.objectId) && (situationType == other.situationType)
114  && (relativePosition == other.relativePosition);
115  }
116 
124  bool operator!=(const Situation &other) const
125  {
126  return !operator==(other);
127  }
128 
136 
141 
146 
151 
156 
161 };
162 
163 } // namespace situation
164 } // namespace rss
165 } // namespace ad
166 
170 #ifndef GEN_GUARD_AD_RSS_SITUATION_SITUATION
171 #define GEN_GUARD_AD_RSS_SITUATION_SITUATION
172 
175 namespace ad {
179 namespace rss {
183 namespace situation {
184 
194 inline std::ostream &operator<<(std::ostream &os, Situation const &_value)
195 {
196  os << "Situation(";
197  os << "situationId:";
198  os << _value.situationId;
199  os << ",";
200  os << "objectId:";
201  os << _value.objectId;
202  os << ",";
203  os << "situationType:";
204  os << _value.situationType;
205  os << ",";
206  os << "egoVehicleState:";
207  os << _value.egoVehicleState;
208  os << ",";
209  os << "otherVehicleState:";
210  os << _value.otherVehicleState;
211  os << ",";
212  os << "relativePosition:";
213  os << _value.relativePosition;
214  os << ")";
215  return os;
216 }
217 
218 } // namespace situation
219 } // namespace rss
220 } // namespace ad
221 
222 namespace std {
226 inline std::string to_string(::ad::rss::situation::Situation const &value)
227 {
228  stringstream sstream;
229  sstream << value;
230  return sstream.str();
231 }
232 } // namespace std
233 #endif // GEN_GUARD_AD_RSS_SITUATION_SITUATION
ad
namespace ad
Definition: LateralRelativePosition.hpp:26
ad::rss::situation::Situation
DataType Situation.
Definition: Situation.hpp:53
ad::rss::situation::Situation::objectId
::ad::rss::world::ObjectId objectId
Definition: Situation.hpp:140
ad::rss::situation::SituationId
uint64_t SituationId
DataType SituationId.
Definition: SituationId.hpp:39
VehicleState.hpp
ad::rss::situation::Situation::egoVehicleState
::ad::rss::situation::VehicleState egoVehicleState
Definition: Situation.hpp:150
ad::rss::situation::Situation::operator==
bool operator==(const Situation &other) const
standard comparison operator
Definition: Situation.hpp:110
ad::rss::situation::VehicleState
DataType VehicleState.
Definition: VehicleState.hpp:51
std::to_string
std::string to_string(::ad::rss::situation::LateralRelativePosition const &value)
overload of the std::to_string for LateralRelativePosition
Definition: LateralRelativePosition.hpp:160
ad::rss::situation::Situation::otherVehicleState
::ad::rss::situation::VehicleState otherVehicleState
Definition: Situation.hpp:155
ad::rss::situation::operator<<
std::ostream & operator<<(std::ostream &os, LateralRelativePosition const &value)
standard ostream operator
Definition: LateralRelativePosition.hpp:147
ObjectId.hpp
RelativePosition.hpp
ad::rss::situation::Situation::ConstPtr
std::shared_ptr< Situation const > ConstPtr
Smart pointer on constant Situation.
Definition: Situation.hpp:63
ad::rss::world::ObjectId
uint64_t ObjectId
DataType ObjectId.
Definition: ObjectId.hpp:39
ad::rss::situation::Situation::Situation
Situation()=default
standard constructor
ad::rss::situation::Situation::Ptr
std::shared_ptr< Situation > Ptr
Smart pointer on Situation.
Definition: Situation.hpp:58
SituationType.hpp
ad::rss::situation::Situation::relativePosition
::ad::rss::situation::RelativePosition relativePosition
Definition: Situation.hpp:160
ad::rss::situation::SituationType
SituationType
DataType SituationType.
Definition: SituationType.hpp:41
ad::rss::situation::Situation::situationId
::ad::rss::situation::SituationId situationId
Definition: Situation.hpp:135
ad::rss::situation::Situation::operator=
Situation & operator=(const Situation &other)=default
standard assignment operator
SituationId.hpp
ad::rss::situation::RelativePosition
DataType RelativePosition.
Definition: RelativePosition.hpp:45
ad::rss::situation::Situation::situationType
::ad::rss::situation::SituationType situationType
Definition: Situation.hpp:145
ad::rss::situation::Situation::~Situation
~Situation()=default
standard destructor
ad::rss::situation::Situation::operator!=
bool operator!=(const Situation &other) const
standard comparison operator
Definition: Situation.hpp:124