VotingBin.cpp
Go to the documentation of this file.
1 
18 #include "VotingBin.hpp"
19 
20 //Global includes
21 #include <map>
22 #include <vector>
23 
24 namespace ISM
25 {
26  void VotingBin::insert(const VotedPosePtr & vote)
27  {
28 
29  TypeToInnerMap::iterator typeIt = votes.find(vote->vote->objectType);
30  if (typeIt == votes.end())
31  {
32  typeIt = votes.insert(std::make_pair(vote->vote->objectType, IdToVoteMap())).first;
33  }
34 
35  IdToVoteMap::iterator idIt = typeIt->second.find(vote->vote->observedId);
36  if (idIt == typeIt->second.end())
37  {
38  idIt = typeIt->second.insert(std::make_pair(vote->vote->observedId,
39  VotedPosePtrs())).first;
40  }
41  idIt->second.push_back(vote);
42  }
43 }
void insert(const VotedPosePtr &vote)
Definition: VotingBin.cpp:26
TypeToInnerMap votes
Definition: VotingBin.hpp:35
std::vector< VotedPosePtr > VotedPosePtrs
Definition: typedef.hpp:59
boost::shared_ptr< VotedPose > VotedPosePtr
Definition: typedef.hpp:31
this namespace contains all generally usable classes.
std::map< std::string, VotedPosePtrs > IdToVoteMap
Definition: typedef.hpp:70


asr_lib_ism
Author(s): Hanselmann Fabian, Heller Florian, Heizmann Heinrich, Kübler Marcel, Mehlhaus Jonas, Meißner Pascal, Qattan Mohamad, Reckling Reno, Stroh Daniel
autogenerated on Wed Jan 8 2020 04:02:41