ad_rss
Object.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 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 (objectId == other.objectId) && (objectType == other.objectType)
108  && (occupiedRegions == other.occupiedRegions) && (velocity == other.velocity) && (state == other.state);
109  }
110 
118  bool operator!=(const Object &other) const
119  {
120  return !operator==(other);
121  }
122 
127 
131  ::ad::rss::world::ObjectType objectType{::ad::rss::world::ObjectType::Invalid};
132 
137 
142 
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
158 
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 << "objectId:";
184  os << _value.objectId;
185  os << ",";
186  os << "objectType:";
187  os << _value.objectType;
188  os << ",";
189  os << "occupiedRegions:";
190  os << _value.occupiedRegions;
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 #endif // GEN_GUARD_AD_RSS_WORLD_OBJECT
ad
namespace ad
Definition: LateralRelativePosition.hpp:26
ad::rss::world::Object::state
::ad::rss::world::ObjectState state
Definition: Object.hpp:146
Velocity.hpp
ad::rss::world::Object::Ptr
std::shared_ptr< Object > Ptr
Smart pointer on Object.
Definition: Object.hpp:53
ad::rss::world::Object::objectType
::ad::rss::world::ObjectType objectType
Definition: Object.hpp:131
ad::rss::world::ObjectType
ObjectType
DataType ObjectType.
Definition: ObjectType.hpp:41
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::world::Object::~Object
~Object()=default
standard destructor
ad::rss::world::operator<<
std::ostream & operator<<(std::ostream &os, LaneDrivingDirection const &value)
standard ostream operator
Definition: LaneDrivingDirection.hpp:132
ad::rss::world::Object
DataType Object.
Definition: Object.hpp:48
ObjectType.hpp
ObjectState.hpp
ObjectId.hpp
ad::rss::world::ObjectState
DataType ObjectState.
Definition: ObjectState.hpp:51
ad::rss::world::Object::operator!=
bool operator!=(const Object &other) const
standard comparison operator
Definition: Object.hpp:118
ad::rss::world::Object::Object
Object()=default
standard constructor
ad::rss::world::ObjectId
uint64_t ObjectId
DataType ObjectId.
Definition: ObjectId.hpp:39
ad::rss::world::Object::operator==
bool operator==(const Object &other) const
standard comparison operator
Definition: Object.hpp:105
ad::rss::world::OccupiedRegionVector
std::vector<::ad::rss::world::OccupiedRegion > OccupiedRegionVector
DataType OccupiedRegionVector.
Definition: OccupiedRegionVector.hpp:42
ad::rss::world::Velocity
DataType Velocity.
Definition: Velocity.hpp:47
ad::rss::world::Object::objectId
::ad::rss::world::ObjectId objectId
Definition: Object.hpp:126
ad::rss::world::Object::occupiedRegions
::ad::rss::world::OccupiedRegionVector occupiedRegions
Definition: Object.hpp:136
ad::rss::world::Object::velocity
::ad::rss::world::Velocity velocity
Definition: Object.hpp:141
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
OccupiedRegionVector.hpp