-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See release notes.
- Loading branch information
Showing
13 changed files
with
206 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Maintainer: Databento <[email protected]> | ||
_pkgname=databento-cpp | ||
pkgname=databento-cpp-git | ||
pkgver=0.17.1 | ||
pkgver=0.18.0 | ||
pkgrel=1 | ||
pkgdesc="Official C++ client for Databento" | ||
arch=('any') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include "databento/flag_set.hpp" | ||
|
||
#include <array> | ||
|
||
#include "stream_op_helper.hpp" | ||
|
||
namespace databento { | ||
constexpr FlagSet::Repr FlagSet::kLast; | ||
constexpr FlagSet::Repr FlagSet::kTob; | ||
constexpr FlagSet::Repr FlagSet::kSnapshot; | ||
constexpr FlagSet::Repr FlagSet::kMbp; | ||
constexpr FlagSet::Repr FlagSet::kBadTsRecv; | ||
constexpr FlagSet::Repr FlagSet::kMaybeBadBook; | ||
|
||
std::ostream& operator<<(std::ostream& stream, FlagSet flag_set) { | ||
const std::array<std::pair<bool (FlagSet::*)() const, const char*>, 6> | ||
kFlagsAndNames = {{ | ||
{&FlagSet::IsLast, "LAST"}, | ||
{&FlagSet::IsTob, "TOB"}, | ||
{&FlagSet::IsSnapshot, "SNAPSHOT"}, | ||
{&FlagSet::IsMbp, "MBP"}, | ||
{&FlagSet::IsBadTsRecv, "BAD_TS_RECV"}, | ||
{&FlagSet::IsMaybeBadBook, "MAYBE_BAD_BOOK"}, | ||
}}; | ||
|
||
bool has_written_flag = false; | ||
for (const auto& pair : kFlagsAndNames) { | ||
if ((flag_set.*pair.first)()) { | ||
if (has_written_flag) { | ||
stream << " | " << pair.second; | ||
} else { | ||
stream << pair.second; | ||
has_written_flag = true; | ||
} | ||
} | ||
} | ||
// Cast to uint16_t to avoid being formatted as char | ||
const auto raw = static_cast<std::uint16_t>(flag_set.Raw()); | ||
if (has_written_flag) { | ||
stream << " (" << raw << ')'; | ||
} else { | ||
stream << raw; | ||
} | ||
return stream; | ||
} | ||
|
||
std::string ToString(FlagSet flags) { return MakeString(flags); } | ||
} // namespace databento |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.