41 for(
const auto & location : locations)
45 if(nemId_ == targetNEMId)
49 if(localPOV_.
update(location.getPosition(),
50 location.getOrientation(),
51 location.getVelocity()))
53 locationInfoCache_.clear();
58 auto iter = locationStore_.find(targetNEMId);
60 if(iter != locationStore_.end())
64 if(iter->second.update(location.getPosition(),
65 location.getOrientation(),
66 location.getVelocity()))
68 locationInfoCache_.erase(targetNEMId);
73 locationStore_.insert({targetNEMId,{location.getPosition(),
74 location.getOrientation(),
75 location.getVelocity()}});
84 if(!localPOV_ ==
false)
86 auto cacheIter = locationInfoCache_.find(remoteNEMId);
88 if(cacheIter != locationInfoCache_.end())
90 return {cacheIter->second,
true};
94 auto iter = locationStore_.find(remoteNEMId);
96 if(iter != locationStore_.end())
100 locationInfoCache_[remoteNEMId] = locationInfo;
102 return {locationInfo,
true};
void update(const Events::Locations &locations)
bool update(const Position &position, const std::pair< const Orientation &, bool > &orientation, const std::pair< const Velocity &, bool > &velocity)
std::list< Location > Locations
std::pair< LocationInfo, bool > getLocationInfo(NEMId remoteNEMId)
LocationManager(NEMId nemId)