Track.hpp
Go to the documentation of this file.
1 
18 #pragma once
19 
20 #include <string>
21 #include <vector>
22 #include <boost/shared_ptr.hpp>
23 #include "Object.hpp"
24 
25 namespace ISM {
26 
30  struct Track {
31  std::string type;
32  std::string observedId;
33  std::vector<ObjectPtr> objects;
34  double weight;
35 
36  Track(std::string type = "", std::string observedId = "") : type(type), observedId(observedId), weight(1.0) {}
37  Track(const Track& other): type(other.type), observedId(other.observedId), weight(other.weight)
38  {
39  for (auto& objIt : other.objects)
40  {
41  if (objIt != 0)
42  {
43  this->objects.push_back(ObjectPtr(new Object(*objIt)));
44  }
45  else
46  {
47  //Unitialized shared_ptr on purpose. It represents timesteps in which the object wasnt present
48  this->objects.push_back(ObjectPtr());
49  }
50  }
51  }
52  void calculateWeight();
53  };
54 
55  typedef boost::shared_ptr<Track> TrackPtr;
56 
57  std::ostream& operator<<(std::ostream &strm, const ISM::Track &o);
58 
59  std::ostream& operator<<(std::ostream &strm, const ISM::TrackPtr &o);
60 }
double weight
Definition: Track.hpp:34
std::string type
Definition: Track.hpp:31
std::ostream & operator<<(std::ostream &strm, const ISM::ObjectRelation &r)
std::string observedId
Definition: Track.hpp:32
Track(std::string type="", std::string observedId="")
Definition: Track.hpp:36
Track(const Track &other)
Definition: Track.hpp:37
void calculateWeight()
Definition: Track.cpp:22
boost::shared_ptr< Track > TrackPtr
Definition: Track.hpp:55
this namespace contains all generally usable classes.
std::vector< ObjectPtr > objects
Definition: Track.hpp:33
boost::shared_ptr< Object > ObjectPtr
Definition: Object.hpp:82


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