Skip to content

Commit e62d02e

Browse files
authored
VER: Release 0.12.0
2 parents d82b35b + d50fc39 commit e62d02e

File tree

9 files changed

+1236
-6
lines changed

9 files changed

+1236
-6
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 0.12.0 - 2023-08-24
4+
5+
##### Enhancements
6+
- Added the `Publisher`, `Venue`, and `Dataset` enums
7+
- Added `Publisher` getters to `Record` and `RecordHeader` to convert the
8+
`publisher_id` to its enum
9+
310
## 0.11.0 - 2023-08-10
411

512
#### Enhancements

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.14)
44
# Project details
55
#
66

7-
project("databento" VERSION 0.11.0 LANGUAGES CXX)
7+
project("databento" VERSION 0.12.0 LANGUAGES CXX)
88
string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPERCASE)
99

1010
#

cmake/SourcesAndHeaders.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ set(headers
1616
include/databento/live_threaded.hpp
1717
include/databento/log.hpp
1818
include/databento/metadata.hpp
19+
include/databento/publishers.hpp
1920
include/databento/record.hpp
2021
include/databento/symbology.hpp
2122
include/databento/timeseries.hpp
@@ -46,6 +47,7 @@ set(sources
4647
src/live_threaded.cpp
4748
src/log.cpp
4849
src/metadata.cpp
50+
src/publishers.cpp
4951
src/record.cpp
5052
src/symbology.cpp
5153
src/detail/file_stream.cpp

include/databento/enums.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#include <iosfwd>
55
#include <string>
66

7+
#include "databento/publishers.hpp" // Dataset, Publisher, Venue, FromString
8+
79
namespace databento {
810
// Represents a historical data center gateway location.
911
enum class HistoricalGateway : std::uint8_t {
@@ -286,8 +288,6 @@ std::ostream& operator<<(std::ostream& out, StatType stat_type);
286288
std::ostream& operator<<(std::ostream& out,
287289
StatUpdateAction stat_update_action);
288290

289-
template <typename T>
290-
T FromString(const std::string& str);
291291
template <>
292292
Schema FromString(const std::string& str);
293293
template <>

include/databento/publishers.hpp

Lines changed: 244 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
1+
#pragma once
2+
3+
#include <cstdint>
4+
#include <iosfwd>
5+
#include <string>
6+
7+
namespace databento {
8+
// A trading execution venue.
9+
enum class Venue : std::uint16_t {
10+
// CME GLOBEX
11+
Glbx = 1,
12+
// NASDAQ
13+
Xnas = 2,
14+
// NASDAQ OMX BX
15+
Xbos = 3,
16+
// NASDAQ OMX PSX
17+
Xpsx = 4,
18+
// CBOE BZX U.S. EQUITIES EXCHANGE
19+
Bats = 5,
20+
// CBOE BYX U.S. EQUITIES EXCHANGE
21+
Baty = 6,
22+
// CBOE EDGA U.S. EQUITIES EXCHANGE
23+
Edga = 7,
24+
// CBOE EDGX U.S. EQUITIES EXCHANGE
25+
Edgx = 8,
26+
// New York Stock Exchange
27+
Xnys = 9,
28+
// NYSE NATIONAL, INC.
29+
Xcis = 10,
30+
// NYSE AMERICAN
31+
Xase = 11,
32+
// NYSE ARCA
33+
Arcx = 12,
34+
// NYSE CHICAGO, INC.
35+
Xchi = 13,
36+
// INVESTORS EXCHANGE
37+
Iexg = 14,
38+
// FINRA/NASDAQ TRF CARTERET
39+
Finn = 15,
40+
// FINRA/NASDAQ TRF CHICAGO
41+
Finc = 16,
42+
// FINRA/NYSE TRF
43+
Finy = 17,
44+
// MEMX LLC EQUITIES
45+
Memx = 18,
46+
// MIAX PEARL EQUITIES
47+
Eprl = 19,
48+
// NYSE AMERICAN OPTIONS
49+
Amxo = 20,
50+
// BOX OPTIONS EXCHANGE
51+
Xbox = 21,
52+
// CBOE OPTIONS EXCHANGE
53+
Xcbo = 22,
54+
// MIAX EMERALD
55+
Emld = 23,
56+
// Cboe EDGX Options Exchange
57+
Edgo = 24,
58+
// NASDAQ GEMX
59+
Gmni = 25,
60+
// NASDAQ ISE
61+
Xisx = 26,
62+
// NASDAQ MRX
63+
Mcry = 27,
64+
// MIAX INTERNATIONAL SECURITIES
65+
Xmio = 28,
66+
// NYSE ARCA OPTIONS
67+
Arco = 29,
68+
// OPRA
69+
Opra = 30,
70+
// MIAX PEARL
71+
Mprl = 31,
72+
// NASDAQ OPTIONS MARKET
73+
Xndq = 32,
74+
// NASDAQ BX OPTIONS
75+
Xbxo = 33,
76+
// CBOE C2 OPTIONS EXCHANGE
77+
C2Ox = 34,
78+
// NASDAQ PHLX
79+
Xphl = 35,
80+
// CBOE BZX Options Exchange
81+
Bato = 36,
82+
// MEMX Options Exchange
83+
Mxop = 37,
84+
};
85+
86+
// A source of data.
87+
enum class Dataset : std::uint16_t {
88+
// CME MDP 3.0 Market Data
89+
GlbxMdp3 = 1,
90+
// Nasdaq XNAS TotalView-ITCH
91+
XnasItch = 2,
92+
// Nasdaq XBOS TotalView-ITCH
93+
XbosItch = 3,
94+
// Nasdaq XPSX TotalView-ITCH
95+
XpsxItch = 4,
96+
// CBOE BZX
97+
BatsPitch = 5,
98+
// CBOE BYX
99+
BatyPitch = 6,
100+
// CBOE EDGA
101+
EdgaPitch = 7,
102+
// CBOE EDGX
103+
EdgxPitch = 8,
104+
// NYSE
105+
XnysPillar = 9,
106+
// NYSE National
107+
XcisPillar = 10,
108+
// NYSE American
109+
XasePillar = 11,
110+
// NYSE Chicago
111+
XchiPillar = 12,
112+
// NYSE National BBO
113+
XcisBbo = 13,
114+
// NYSE National TRADES
115+
XcisTrades = 14,
116+
// MEMX Memoir Depth
117+
MemxMemoir = 15,
118+
// MIAX Pearl Depth
119+
EprlDom = 16,
120+
// Finra/Nasdaq TRF
121+
FinnNls = 17,
122+
// Finra/NYSE TRF
123+
FinyTrades = 18,
124+
// OPRA Binary Recipient
125+
OpraPillar = 19,
126+
// Databento Equities Basic
127+
DbeqBasic = 20,
128+
// NYSE Arca
129+
ArcxPillar = 21,
130+
// Investors Exchange TOPS
131+
IexgTops = 22,
132+
};
133+
134+
// A specific Venue from a specific data source.
135+
enum class Publisher : std::uint16_t {
136+
// CME Globex MDP 3.0
137+
GlbxMdp3Glbx = 1,
138+
// Nasdaq TotalView ITCH
139+
XnasItchXnas = 2,
140+
// Nasdaq XBOS TotalView ITCH
141+
XbosItchXbos = 3,
142+
// Nasdaq XPSX TotalView ITCH
143+
XpsxItchXpsx = 4,
144+
// CBOE BZX
145+
BatsPitchBats = 5,
146+
// CBOE BYX
147+
BatyPitchBats = 6,
148+
// CBOE EDGA
149+
EdgaPitchEdga = 7,
150+
// CBOE EDGX
151+
EdgxPitchEdgx = 8,
152+
// NYSE
153+
XnysPillarXnys = 9,
154+
// NYSE National
155+
XcisPillarXcis = 10,
156+
// NYSE American
157+
XasePillarXase = 11,
158+
// NYSE Chicago
159+
XchiPillarXchi = 12,
160+
// NYSE National BBO
161+
XcisBboXcis = 13,
162+
// NYSE National Trades
163+
XcisTradesXcis = 14,
164+
// MEMX Memoir Depth
165+
MemxMemoirMemx = 15,
166+
// MIAX Pearl Depth
167+
EprlDomEprl = 16,
168+
// FINRA/NASDAQ TRF CARTERET
169+
FinnNlsFinn = 17,
170+
// FINRA/NASDAQ TRF CHICAGO
171+
FinnNlsFinc = 18,
172+
// FINRA/NYSE TRF
173+
FinyTradesFiny = 19,
174+
// OPRA - NYSE AMERICAN OPTIONS
175+
OpraPillarAmxo = 20,
176+
// OPRA - BOX OPTIONS EXCHANGE
177+
OpraPillarXbox = 21,
178+
// OPRA - CBOE OPTIONS EXCHANGE
179+
OpraPillarXcbo = 22,
180+
// OPRA - MIAX EMERALD
181+
OpraPillarEmld = 23,
182+
// OPRA - Cboe EDGX Options Exchange
183+
OpraPillarEdgo = 24,
184+
// OPRA - NASDAQ GEMX
185+
OpraPillarGmni = 25,
186+
// OPRA - NASDAQ ISE
187+
OpraPillarXisx = 26,
188+
// OPRA - NASDAQ MRX
189+
OpraPillarMcry = 27,
190+
// OPRA - MIAX INTERNATIONAL SECURITIES
191+
OpraPillarXmio = 28,
192+
// OPRA - NYSE ARCA OPTIONS
193+
OpraPillarArco = 29,
194+
// OPRA - OPRA
195+
OpraPillarOpra = 30,
196+
// OPRA - MIAX PEARL
197+
OpraPillarMprl = 31,
198+
// OPRA - NASDAQ OPTIONS MARKET
199+
OpraPillarXndq = 32,
200+
// OPRA - NASDAQ BX OPTIONS
201+
OpraPillarXbxo = 33,
202+
// OPRA - CBOE C2 OPTIONS EXCHANGE
203+
OpraPillarC2Ox = 34,
204+
// OPRA - NASDAQ PHLX
205+
OpraPillarXphl = 35,
206+
// OPRA - CBOE BZX Options Exchange
207+
OpraPillarBato = 36,
208+
// OPRA - MEMX OPTIONS EXCHANGE
209+
OpraPillarMxop = 37,
210+
// Investors Exchange TOPS
211+
IexgTopsIexg = 38,
212+
// DBEQ Basic - Nyse Chicago
213+
DbeqBasicXchi = 39,
214+
// DBEQ Basic - Nyse National
215+
DbeqBasicXcis = 40,
216+
// DBEQ Basic - Investors Exchange
217+
DbeqBasicIexg = 41,
218+
// DBEQ Basic - MIAX Pearl
219+
DbeqBasicEprl = 42,
220+
};
221+
222+
// Get a Publisher's Venue.
223+
Venue PublisherVenue(Publisher publisher);
224+
225+
// Get a Publisher's Dataset.
226+
Dataset PublisherDataset(Publisher publisher);
227+
228+
template <typename T>
229+
T FromString(const std::string& str);
230+
const char* ToString(Venue venue);
231+
std::ostream& operator<<(std::ostream& out, Venue venue);
232+
template <>
233+
Venue FromString(const std::string& str);
234+
235+
const char* ToString(Dataset dataset);
236+
std::ostream& operator<<(std::ostream& out, Dataset dataset);
237+
template <>
238+
Dataset FromString(const std::string& str);
239+
240+
const char* ToString(Publisher publisher);
241+
std::ostream& operator<<(std::ostream& out, Publisher publisher);
242+
template <>
243+
Publisher FromString(const std::string& str);
244+
} // namespace databento

include/databento/record.hpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
#include "databento/datetime.hpp" // UnixNanos
1212
#include "databento/enums.hpp"
13-
#include "databento/flag_set.hpp" // FlagSet
13+
#include "databento/flag_set.hpp" // FlagSet
14+
#include "databento/publishers.hpp" // Publisher
1415

1516
namespace databento {
1617
// Common data for all Databento Records.
@@ -21,14 +22,19 @@ struct RecordHeader {
2122
std::uint8_t length;
2223
// The record type.
2324
RType rtype;
24-
// The publisher ID assigned by Databento.
25+
// The publisher ID assigned by Databento, which denotes the dataset and
26+
// venue.
2527
std::uint16_t publisher_id;
2628
// The numeric ID assigned to the instrument.
2729
std::uint32_t instrument_id;
2830
// The exchange timestamp in UNIX epoch nanoseconds.
2931
UnixNanos ts_event;
3032

3133
std::size_t Size() const;
34+
// Retrieve the publisher based on the publisher ID.
35+
enum Publisher Publisher() const {
36+
return static_cast<enum Publisher>(publisher_id);
37+
}
3238
};
3339

3440
class Record {
@@ -37,6 +43,7 @@ class Record {
3743

3844
const RecordHeader& Header() const { return *record_; }
3945
::databento::RType RType() const { return record_->rtype; }
46+
enum Publisher Publisher() const { return Header().Publisher(); }
4047

4148
template <typename T>
4249
bool Holds() const {

pkg/PKGBUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Maintainer: Databento <support@databento.com>
22
_pkgname=databento-cpp
33
pkgname=databento-cpp-git
4-
pkgver=0.11.0
4+
pkgver=0.12.0
55
pkgrel=1
66
pkgdesc="Official C++ client for Databento"
77
arch=('any')

0 commit comments

Comments
 (0)