-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbenchmark_structs.hpp
More file actions
206 lines (180 loc) · 4.59 KB
/
benchmark_structs.hpp
File metadata and controls
206 lines (180 loc) · 4.59 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
#pragma once
#include <string>
#include <vector>
#include <map>
#include <cstdint>
#include <optional>
#include <glaze/glaze.hpp>
// --- Canada.json Structs ---
namespace canada {
struct Geometry {
std::string type;
std::vector<std::vector<std::vector<double>>> coordinates;
};
struct Property {
std::string name;
};
struct Feature {
std::string type;
Property properties;
Geometry geometry;
};
struct FeatureCollection {
std::string type;
std::vector<Feature> features;
};
} // namespace canada
// --- Twitter.json Structs ---
namespace twitter {
struct Metadata {
std::string result_type;
std::string iso_language_code;
};
struct Url {
std::string url;
std::string expanded_url;
std::string display_url;
std::vector<int> indices;
};
struct UrlEntity {
std::vector<Url> urls;
};
struct UserEntities {
UrlEntity url;
UrlEntity description;
};
struct User {
uint64_t id;
std::string id_str;
std::string name;
std::string screen_name;
std::string location;
std::string description;
std::string url;
UserEntities entities;
bool protected_user;
int followers_count;
int friends_count;
int listed_count;
std::string created_at;
int favourites_count;
std::optional<int> utc_offset;
std::optional<std::string> time_zone;
bool geo_enabled;
bool verified;
int statuses_count;
std::string lang;
bool contributors_enabled;
bool is_translator;
bool is_translation_enabled;
std::string profile_background_color;
std::string profile_background_image_url;
std::string profile_background_image_url_https;
bool profile_background_tile;
std::string profile_image_url;
std::string profile_image_url_https;
std::string profile_banner_url;
std::string profile_link_color;
std::string profile_sidebar_border_color;
std::string profile_sidebar_fill_color;
std::string profile_text_color;
bool profile_use_background_image;
bool default_profile;
bool default_profile_image;
bool following;
bool follow_request_sent;
bool notifications;
};
struct Hashtag {
std::string text;
std::vector<int> indices;
};
struct UserMention {
std::string screen_name;
std::string name;
int64_t id;
std::string id_str;
std::vector<int> indices;
};
struct StatusEntities {
std::vector<Hashtag> hashtags;
std::vector<Hashtag> symbols;
std::vector<Url> urls;
std::vector<UserMention> user_mentions;
};
struct Status {
Metadata metadata;
std::string created_at;
uint64_t id;
std::string id_str;
std::string text;
std::string source;
bool truncated;
std::optional<uint64_t> in_reply_to_status_id;
std::optional<std::string> in_reply_to_status_id_str;
std::optional<uint64_t> in_reply_to_user_id;
std::optional<std::string> in_reply_to_user_id_str;
std::optional<std::string> in_reply_to_screen_name;
User user;
bool is_quote_status;
int retweet_count;
int favorite_count;
StatusEntities entities;
bool favorited;
bool retweeted;
std::string lang;
};
struct SearchMetadata {
double completed_in;
uint64_t max_id;
std::string max_id_str;
std::string next_results;
std::string query;
std::string refresh_url;
int count;
uint64_t since_id;
std::string since_id_str;
};
struct TwitterResult {
std::vector<Status> statuses;
SearchMetadata search_metadata;
};
} // namespace twitter
// --- CITM Catalog Structs ---
namespace citm {
struct Event {
uint64_t id;
std::string name;
std::string description;
std::string subtitle;
std::string logo;
int topicId;
};
struct Catalog {
std::map<std::string, std::string> areaNames;
std::map<std::string, std::string> audienceSubCategoryNames;
std::map<std::string, std::string> blockNames;
std::map<std::string, Event> events;
};
} // namespace citm
// --- Small Struct ---
namespace small {
struct Meta { bool active; double rank; };
struct Object {
int id;
std::string name;
bool checked;
std::vector<int> scores;
Meta meta;
std::string description;
};
}
// Glaze registration for small
template<> struct glz::meta<small::Meta> {
using T = small::Meta;
static constexpr auto value = object("active", &T::active, "rank", &T::rank);
};
template<> struct glz::meta<small::Object> {
using T = small::Object;
static constexpr auto value = object("id", &T::id, "name", &T::name, "checked", &T::checked, "scores", &T::scores, "meta", &T::meta, "description", &T::description);
};