UWARG Computer Vision
metadata_input.h
Go to the documentation of this file.
1 
16 #ifndef METADATA_INPUT_H_INCLUDED
17 #define METADATA_INPUT_H_INCLUDED
18 
19 #include "metadata.h"
20 #include <unordered_map>
21 #include <vector>
22 #include <string>
23 #include <unordered_map>
24 #include <boost/asio.hpp>
25 
26 class MetadataReader;
27 
33 public:
34  /*
35  * @brief constructor for MetadataInput
36  */
37  MetadataInput();
38 
39  ~MetadataInput();
40 
49  Metadata get_metadata(double timestamp);
50 
60 
65  void add_source(MetadataReader *reader);
66 
70  int num_sources();
71 
76  int check_data_order();
77 private:
78 
90  Metadata metadata_at_index(int index, double timestamp);
91 
92  /*
93  * @brief helper for running binary search on the log
94  *
95  * @param value value to be queried
96  * @param begin min position in the log to search
97  * @param end max position in the log to search
98  * @param field column of the log to query
99  * @return result of the query
100  */
101  Metadata bisearcher(double value, int begin, int end, std::string field);
102 
108  void push_back(std::unordered_map<std::string, std::string> newEntry);
109 
110  int cameraStatus=0;
111 
112  int size;
113 
117  std::vector<std::string> heads;
118 
124  std::unordered_map<std::string, std::vector<std::string> > data;
125 
126  std::vector<long> time;
127 
128  std::vector<MetadataReader *> sources;
129 
130  friend class MetadataReader;
131 };
132 
133 #endif // METADATA_INPUT_H_INCLUDED
Definition: metadata.h:43
Structure for storing plane status information from the time that an image was taken.
int check_data_order()
Definition: metadata_input.cpp:130
Metadata get_metadata(double timestamp)
searches for the closest log entry to the given timestamp
Definition: metadata_input.cpp:112
A class for storing and searching telemetry logs.
Definition: metadata_input.h:32
void add_source(MetadataReader *reader)
Adds a new metadata source.
Definition: metadata_input.cpp:122
Metadata next_metadata()
retrieves the next log entry corresponding to a time when the log notes a photograph was triggered ...
Definition: metadata_input.cpp:117
int num_sources()
returns the number of sources
Definition: metadata_input.cpp:126
A class for reading telemetry logs.
Definition: metadata_reader.h:30