File tree Expand file tree Collapse file tree 4 files changed +15
-5
lines changed Expand file tree Collapse file tree 4 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 3
3
## 0.41.0 - TBD
4
4
5
5
### Enhancements
6
- - Add static ` Builder() ` methods to the clients
7
- - Improve debug logging in live clients
6
+ - Added static ` Builder() ` methods to the clients
7
+ - Improved debug logging in live clients
8
+ - Added ` PUBLISHER_SPECIFIC ` flag
8
9
9
10
### Breaking changes
10
11
- Removed unused ` Received ` variant from ` JobState ` enum
Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ class FlagSet {
24
24
static constexpr Repr kBadTsRecv = 1 << 3 ;
25
25
// Indicates an unrecoverable gap was detected in the channel.
26
26
static constexpr Repr kMaybeBadBook = 1 << 2 ;
27
+ // Indicates a publisher-specific event.
28
+ static constexpr Repr kPublisherSpecific = 1 << 1 ;
27
29
28
30
friend std::ostream& operator <<(std::ostream&, FlagSet);
29
31
@@ -77,11 +79,16 @@ class FlagSet {
77
79
bits_.maybe_bad_book = true ;
78
80
return *this ;
79
81
}
82
+ constexpr bool IsPublisherSpecific () const { return bits_.publisher_specific ; }
83
+ FlagSet SetPublisherSpecific () {
84
+ bits_.publisher_specific = true ;
85
+ return *this ;
86
+ }
80
87
81
88
private:
82
89
struct BitFlags {
83
90
bool reserved0 : 1 ;
84
- bool reserved1 : 1 ;
91
+ bool publisher_specific : 1 ;
85
92
bool maybe_bad_book : 1 ;
86
93
bool bad_ts_recv : 1 ;
87
94
bool mbp : 1 ;
Original file line number Diff line number Diff line change 6
6
7
7
namespace databento {
8
8
std::ostream& operator <<(std::ostream& stream, FlagSet flag_set) {
9
- const std::array<std::pair<bool (FlagSet::*)() const , const char *>, 6 >
9
+ const std::array<std::pair<bool (FlagSet::*)() const , const char *>, 7 >
10
10
kFlagsAndNames = {{
11
11
{&FlagSet::IsLast, " LAST" },
12
12
{&FlagSet::IsTob, " TOB" },
13
13
{&FlagSet::IsSnapshot, " SNAPSHOT" },
14
14
{&FlagSet::IsMbp, " MBP" },
15
15
{&FlagSet::IsBadTsRecv, " BAD_TS_RECV" },
16
16
{&FlagSet::IsMaybeBadBook, " MAYBE_BAD_BOOK" },
17
+ {&FlagSet::IsPublisherSpecific, " PUBLISHER_SPECIFIC" },
17
18
}};
18
19
19
20
bool has_written_flag = false ;
Original file line number Diff line number Diff line change @@ -46,7 +46,8 @@ TEST(FlagSetTests, ToStringThreeSet) {
46
46
TEST (FlagSetTests, ToStringReservedSet) {
47
47
constexpr FlagSet kTarget {255 };
48
48
ASSERT_EQ (ToString (kTarget ),
49
- " LAST | TOB | SNAPSHOT | MBP | BAD_TS_RECV | MAYBE_BAD_BOOK (255)" );
49
+ " LAST | TOB | SNAPSHOT | MBP | BAD_TS_RECV | MAYBE_BAD_BOOK | "
50
+ " PUBLISHER_SPECIFIC (255)" );
50
51
}
51
52
52
53
TEST (FlagSetTests, ConstantBitFieldEquivalence) {
You can’t perform that action at this time.
0 commit comments