-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMedianTextReader.hpp
More file actions
72 lines (51 loc) · 2.09 KB
/
MedianTextReader.hpp
File metadata and controls
72 lines (51 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef _MedianTextReader_hpp_
#define _MedianTextReader_hpp_
#include <string>
#include <vector>
#include <fstream>
/// Class to store Median Text Record
/// Photo-number PMT-bolt x y Person
/// 045 00555-24 3491 2020 PD3
///
class MedianTextRecord{
public:
MedianTextRecord( unsigned num, unsigned pmt, unsigned bolt, unsigned x, unsigned y, std::string id);
MedianTextRecord();
bool is_bolt();
// Getters
unsigned photo_num() const { return fNum; } // photo number
unsigned pmt_num() const { return fPMT; } // PMT number
unsigned bolt_num() const { return fBolt; } // Bolt number
unsigned x() const { return fX; } // X pixel location
unsigned y() const { return fY; } // Y pixel location
std::string id() const { return fID; } // ID of person locating feature
// Setters
void set_photo_num( unsigned num ) { fNum = num; } // photo number
void set_pmt_num( unsigned pmt ) { fPMT = pmt; } // PMT number
void set_bolt_num( unsigned bolt ) { fBolt = bolt; }// Bolt number
void set_x( unsigned x) { fX = x; } // X pixel location
void set_y( unsigned y) { fY = y; } // Y pixel location
void set_id( const std::string& id){ fID = id; } // ID of person locating feature
private:
unsigned fNum; // photo number
unsigned fPMT; // PMT number
unsigned fBolt; // Bolt number
unsigned fX; // X pixel location
unsigned fY; // Y pixel location
std::string fID; // ID of person locating feature
};
typedef std::vector< MedianTextRecord > MedianTextData;
std::istream& operator>>( std::istream& in, MedianTextRecord & rec );
/// Singleton class to read in data and store it
class MedianTextReader {
public:
static MedianTextReader* Get(); // get instance of clas
void set_input_file( const std::string& fname );
const MedianTextData & get_data() const {return fData; }
private:
MedianTextReader();
static MedianTextReader* instance;
MedianTextData fData;
};
std::ostream& operator<<( std::ostream& out, const MedianTextRecord& r );
#endif