libwreport  3.29
tableinfo.h
1 #ifndef WREPORT_TABLEINFO_H
2 #define WREPORT_TABLEINFO_H
3 
4 #include <cstdint>
5 #include <cstdio>
6 #include <wreport/fwd.h>
7 
8 namespace wreport {
9 
14 {
15 public:
16  uint16_t originating_centre = 0xffff;
17  uint16_t originating_subcentre = 0xffff;
18  uint8_t master_table_number = 0xff;
19  uint8_t master_table_version_number = 0xff;
20  uint8_t master_table_version_number_local = 0xff;
21 
22  BufrTableID() {}
24  uint16_t originating_centre, uint16_t originating_subcentre,
25  uint8_t master_table_number, uint8_t master_table_version_number, uint8_t master_table_version_number_local)
26  : originating_centre(originating_centre), originating_subcentre(originating_subcentre),
27  master_table_number(master_table_number), master_table_version_number(master_table_version_number), master_table_version_number_local(master_table_version_number_local) {}
28 
29  bool operator<(const BufrTableID& o) const;
30 
31  bool is_acceptable_replacement(const BufrTableID& id) const;
32  bool is_acceptable_replacement(const CrexTableID& id) const;
33  int closest_match(const BufrTableID& first, const BufrTableID& second) const;
34  int closest_match(const CrexTableID& first, const CrexTableID& second) const;
35  int closest_match(const BufrTableID& first, const CrexTableID& second) const;
36 
37  void print(FILE* out) const;
38 };
39 
44 {
45 public:
46  uint8_t edition_number = 0xff;
47  uint16_t originating_centre = 0xffff;
48  uint16_t originating_subcentre = 0xffff;
49  uint8_t master_table_number = 0xff;
50  uint8_t master_table_version_number = 0xff;
51  uint8_t master_table_version_number_bufr = 0xff;
52  uint8_t master_table_version_number_local = 0xff;
53 
54  CrexTableID() {}
56  uint8_t edition_number,
57  uint16_t originating_centre, uint16_t originating_subcentre,
58  uint8_t master_table_number,
59  uint8_t master_table_version_number,
60  uint8_t master_table_version_number_bufr,
61  uint8_t master_table_version_number_local
62  )
63  : edition_number(edition_number),
64  originating_centre(originating_centre), originating_subcentre(originating_subcentre),
65  master_table_number(master_table_number),
66  master_table_version_number(master_table_version_number),
67  master_table_version_number_bufr(master_table_version_number_bufr),
68  master_table_version_number_local(master_table_version_number_local) {}
69 
70  bool operator<(const CrexTableID& o) const;
71 
72  bool is_acceptable_replacement(const BufrTableID& id) const;
73  bool is_acceptable_replacement(const CrexTableID& id) const;
74  int closest_match(const BufrTableID& first, const BufrTableID& second) const;
75  int closest_match(const CrexTableID& first, const CrexTableID& second) const;
76  int closest_match(const BufrTableID& first, const CrexTableID& second) const;
77 
78  void print(FILE* out) const;
79 };
80 
81 }
82 #endif
83 
wreport::BufrTableID
Identifying information for one distinct instance of BUFR tables.
Definition: tableinfo.h:14
wreport::CrexTableID
Identifying information for one distinct instance of CREX tables.
Definition: tableinfo.h:44
wreport
String functions.
Definition: benchmark.h:13