-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathbatch.cpp
More file actions
28 lines (21 loc) · 811 Bytes
/
batch.cpp
File metadata and controls
28 lines (21 loc) · 811 Bytes
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
#include "databento/batch.hpp"
#include <algorithm> // find_if
#include <iostream>
#include "databento/constants.hpp"
#include "databento/historical.hpp"
int main() {
auto client = databento::HistoricalBuilder{}.SetKeyFromEnv().Build();
const auto job =
client.BatchSubmitJob(databento::dataset::kGlbxMdp3, {"GEZ2"},
databento::Schema::Trades, {"2022-08-26", "2022-09-27"});
const auto all_jobs = client.BatchListJobs();
const auto all_job_it = std::find_if(
all_jobs.begin(), all_jobs.end(),
[&job](const databento::BatchJob& a_job) { return job.id == a_job.id; });
if (all_job_it == all_jobs.end()) {
std::cout << "Couldn't find submitted job\n";
} else {
std::cout << "Found submitted job: " << *all_job_it << '\n';
}
return 0;
}