DataCollector.hpp
Go to the documentation of this file.
1 
18 #pragma once
19 
20 #include <boost/shared_ptr.hpp>
21 #include "common_type/Tracks.hpp"
22 #include "common_type/Track.hpp"
23 #include <vector>
24 
25 namespace ISM {
26  struct TracksWithRef {
29  TracksWithRef(TracksPtr tracks, TrackPtr refTrack) : tracks(tracks), refTrack(refTrack) {};
30  };
31  typedef boost::shared_ptr<TracksWithRef> TracksWithRefPtr;
32 
33  struct CollectedData {
35  std::vector<TracksWithRef> tracksWithRef;
36  };
37 
38  typedef boost::shared_ptr<CollectedData> CollectedDataPtr;
39 
40  class DataCollector {
41  private:
44  public:
45  static CollectedDataPtr getData() {
46  static CollectedDataPtr data;
47  if (!data) {
48  data = CollectedDataPtr(new CollectedData());
49  data->shouldCollect = false;
50  }
51  return data;
52  }
53 
54  static void setCollect(bool newCollect) {
55  getData()->shouldCollect = newCollect;
56  }
57 
58  static bool shouldCollect() {
59  return getData()->shouldCollect;
60  }
61 
62  static void release() {
63  bool shouldCollect = getData()->shouldCollect;
64  getData().reset();
65  getData()->shouldCollect = shouldCollect;
66  }
67  };
68 }
std::vector< TracksWithRef > tracksWithRef
static bool shouldCollect()
static CollectedDataPtr getData()
static void release()
boost::shared_ptr< Tracks > TracksPtr
Definition: Tracks.hpp:42
TracksWithRef(TracksPtr tracks, TrackPtr refTrack)
boost::shared_ptr< Track > TrackPtr
Definition: Track.hpp:55
this namespace contains all generally usable classes.
boost::shared_ptr< TracksWithRef > TracksWithRefPtr
boost::shared_ptr< CollectedData > CollectedDataPtr
static void setCollect(bool newCollect)


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:40