9 static ExchangeRegistry registry;
14 entries_.push_back(Entry{std::string(key), venue, factory});
19 for (
const auto &entry : entries_) {
30 std::vector<std::string> out;
31 out.reserve(entries_.size());
32 for (
const auto &entry : entries_) {
33 out.push_back(entry.key);
Factory find(std::string_view key) const noexcept
nullptr when no adapter for this key was built into the binary.
std::vector< std::unique_ptr< Exchange > >(*)(const nlohmann::json &config) Factory
A plain function pointer, not std::function - no allocation, no <functional>.
std::vector< std::string > keys() const
Registered keys, in registration order - for the startup banner and for the error message on an unkno...
static ExchangeRegistry & instance()
bool add(std::string_view key, Venue venue, Factory factory)
key is matched case-insensitively, the same way to_venue matches a venue name.
bool iequals(std::string_view a, std::string_view b) noexcept
ASCII case-insensitive compare, used for every venue-name lookup.
Helpers for a venue whose one config entry describes several independent exchange instances,...