mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 13:23:59 +00:00
[traffic] Comparison operators for TrafficImpact, TraffLocation and Point
Signed-off-by: mvglasow <michael -at- vonglasow.com>
This commit is contained in:
@@ -159,6 +159,21 @@ bool IsoTime::operator> (IsoTime & rhs)
|
||||
return t_lhs > t_rhs;
|
||||
}
|
||||
|
||||
bool operator==(TrafficImpact const & lhs, TrafficImpact const & rhs)
|
||||
{
|
||||
if ((lhs.m_speedGroup == traffic::SpeedGroup::TempBlock)
|
||||
&& (rhs.m_speedGroup == traffic::SpeedGroup::TempBlock))
|
||||
return true;
|
||||
return (lhs.m_speedGroup == rhs.m_speedGroup)
|
||||
&& (lhs.m_maxspeed == rhs.m_maxspeed)
|
||||
&& (lhs.m_delayMins == rhs.m_delayMins);
|
||||
}
|
||||
|
||||
bool operator==(Point const & lhs, Point const & rhs)
|
||||
{
|
||||
return lhs.m_coordinates == rhs.m_coordinates;
|
||||
}
|
||||
|
||||
openlr::LocationReferencePoint Point::ToLrp()
|
||||
{
|
||||
openlr::LocationReferencePoint result;
|
||||
@@ -166,6 +181,15 @@ openlr::LocationReferencePoint Point::ToLrp()
|
||||
return result;
|
||||
}
|
||||
|
||||
bool operator==(TraffLocation const & lhs, TraffLocation const & rhs)
|
||||
{
|
||||
return (lhs.m_from == rhs.m_from)
|
||||
&& (lhs.m_at == rhs.m_at)
|
||||
&& (lhs.m_via == rhs.m_via)
|
||||
&& (lhs.m_notVia == rhs.m_notVia)
|
||||
&& (lhs.m_to == rhs.m_to);
|
||||
}
|
||||
|
||||
openlr::LinearLocationReference TraffLocation::ToLinearLocationReference(bool backwards)
|
||||
{
|
||||
openlr::LinearLocationReference locationReference;
|
||||
|
||||
Reference in New Issue
Block a user