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 33## 0.41.0 - TBD
44
55### 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
89
910### Breaking changes
1011- Removed unused ` Received ` variant from ` JobState ` enum
Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ class FlagSet {
2424 static constexpr Repr kBadTsRecv = 1 << 3 ;
2525 // Indicates an unrecoverable gap was detected in the channel.
2626 static constexpr Repr kMaybeBadBook = 1 << 2 ;
27+ // Indicates a publisher-specific event.
28+ static constexpr Repr kPublisherSpecific = 1 << 1 ;
2729
2830 friend std::ostream& operator <<(std::ostream&, FlagSet);
2931
@@ -77,11 +79,16 @@ class FlagSet {
7779 bits_.maybe_bad_book = true ;
7880 return *this ;
7981 }
82+ constexpr bool IsPublisherSpecific () const { return bits_.publisher_specific ; }
83+ FlagSet SetPublisherSpecific () {
84+ bits_.publisher_specific = true ;
85+ return *this ;
86+ }
8087
8188 private:
8289 struct BitFlags {
8390 bool reserved0 : 1 ;
84- bool reserved1 : 1 ;
91+ bool publisher_specific : 1 ;
8592 bool maybe_bad_book : 1 ;
8693 bool bad_ts_recv : 1 ;
8794 bool mbp : 1 ;
Original file line number Diff line number Diff line change 66
77namespace databento {
88std::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 >
1010 kFlagsAndNames = {{
1111 {&FlagSet::IsLast, " LAST" },
1212 {&FlagSet::IsTob, " TOB" },
1313 {&FlagSet::IsSnapshot, " SNAPSHOT" },
1414 {&FlagSet::IsMbp, " MBP" },
1515 {&FlagSet::IsBadTsRecv, " BAD_TS_RECV" },
1616 {&FlagSet::IsMaybeBadBook, " MAYBE_BAD_BOOK" },
17+ {&FlagSet::IsPublisherSpecific, " PUBLISHER_SPECIFIC" },
1718 }};
1819
1920 bool has_written_flag = false ;
Original file line number Diff line number Diff line change @@ -46,7 +46,8 @@ TEST(FlagSetTests, ToStringThreeSet) {
4646TEST (FlagSetTests, ToStringReservedSet) {
4747 constexpr FlagSet kTarget {255 };
4848 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)" );
5051}
5152
5253TEST (FlagSetTests, ConstantBitFieldEquivalence) {
You can’t perform that action at this time.
0 commit comments