refactor: Move collections into lib_system
This commit is contained in:
1 parent
8ef2d42d3d
commit
299654e9d6
35 files changed
+95
-90
No files matched your search
@@ -1,8 +1,6 @@
|
||||
#include "BinanceSecurityRequestor.h"
|
||||
#include "spark/api/domain/SecurityType.pb.h"
|
||||
#include "spark/api/domain/Venue.pb.h"
|
||||
#include "spark/collections/Contains.h"
|
||||
#include "spark/collections/Remove.h"
|
||||
#include "spark/domain/Security.h"
|
||||
#include "spark/domain/SecurityCriteria.h"
|
||||
#include "spark/logging/logging.h"
|
||||
@@ -14,6 +12,8 @@
|
||||
#include "sparkd/md/ccapi/CCApiMessageHandler.h"
|
||||
#include "sparkd/md/ccapi/CCApiSession.h"
|
||||
#include "sparkd/md/ccapi/ICCApiMessageHandler.h"
|
||||
#include "system/collections/contains.h"
|
||||
#include "system/collections/remove.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <ccapi_cpp/ccapi_event_dispatcher.h>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "BinanceSubscription.h"
|
||||
#include "spark/api/domain/Venue.pb.h"
|
||||
#include "spark/api/md/BinanceMarketDataConfig.pb.h"
|
||||
#include "spark/collections/UnorderedSetFactory.h"
|
||||
#include "spark/core/FMT.h"
|
||||
#include "spark/domain/Security.h"
|
||||
#include "spark/domain/SecurityCriteria.h"
|
||||
@@ -19,6 +18,7 @@
|
||||
#include "sparkd/md/ccapi/CCApiMessageLogger.h"
|
||||
#include "sparkd/md/ccapi/CCApiSession.h"
|
||||
#include "sparkd/md/ccapi/CCApiTradeAdaptor.h"
|
||||
#include "system/collections/unordered_set_factory.h"
|
||||
|
||||
#include <ccapi_cpp/ccapi_event_dispatcher.h>
|
||||
#include <ccapi_cpp/ccapi_macro.h>
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#include "BinanceUsSecurityRequestor.h"
|
||||
#include "spark/api/domain/SecurityType.pb.h"
|
||||
#include "spark/api/domain/Venue.pb.h"
|
||||
#include "spark/collections/Contains.h"
|
||||
#include "spark/collections/Remove.h"
|
||||
#include "spark/domain/Security.h"
|
||||
#include "spark/domain/SecurityCriteria.h"
|
||||
#include "spark/logging/logging.h"
|
||||
@@ -13,6 +11,8 @@
|
||||
#include "sparkd/md/ccapi/CCApiMessageHandler.h"
|
||||
#include "sparkd/md/ccapi/CCApiSession.h"
|
||||
#include "sparkd/md/ccapi/ICCApiMessageHandler.h"
|
||||
#include "system/collections/contains.h"
|
||||
#include "system/collections/remove.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <ccapi_cpp/ccapi_event_dispatcher.h>
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
#include "BinanceUsSubscription.h"
|
||||
#include "spark/api/domain/Venue.pb.h"
|
||||
#include "spark/api/md/BinanceUsMarketDataConfig.pb.h"
|
||||
#include "spark/collections/UnorderedSetFactory.h"
|
||||
#include "spark/core/FMT.h"
|
||||
#include "spark/domain/Security.h"
|
||||
#include "spark/domain/SecurityCriteria.h"
|
||||
#include "spark/io/ProtoPrinter.h"
|
||||
#include "spark/io/QueryParams.h"
|
||||
#include "spark/logging/logging.h"
|
||||
@@ -20,6 +17,7 @@
|
||||
#include "sparkd/md/ccapi/CCApiMessageLogger.h"
|
||||
#include "sparkd/md/ccapi/CCApiSession.h"
|
||||
#include "sparkd/md/ccapi/CCApiTradeAdaptor.h"
|
||||
#include "system/collections/unordered_set_factory.h"
|
||||
|
||||
#include <ccapi_cpp/ccapi_event_dispatcher.h>
|
||||
#include <ccapi_cpp/ccapi_event_handler.h>
|
||||
|
||||
+3
-3
@@ -1,8 +1,5 @@
|
||||
#include "BinanceUsdsFuturesSecurityRequestor.h"
|
||||
#include "spark/api/md/BinanceUsdsFuturesMarketDataConfig.pb.h"
|
||||
#include "spark/collections/Contains.h"
|
||||
#include "spark/collections/Remove.h"
|
||||
#include "spark/collections/UnorderedSetFactory.h"
|
||||
#include "spark/core/FMT.h"
|
||||
#include "spark/domain/Security.h"
|
||||
#include "spark/domain/SecurityCriteria.h"
|
||||
@@ -14,6 +11,9 @@
|
||||
#include "sparkd/md/ccapi/CCApiCorrelationID.h"
|
||||
#include "sparkd/md/ccapi/CCApiMessageHandler.h"
|
||||
#include "sparkd/md/ccapi/CCApiSession.h"
|
||||
#include "system/collections/contains.h"
|
||||
#include "system/collections/remove.h"
|
||||
#include "system/collections/unordered_set_factory.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <ccapi_cpp/ccapi_macro.h>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "CCApiCompositeMessageHandler.h"
|
||||
#include "spark/collections/Remove.h"
|
||||
#include "system/collections/remove.h"
|
||||
|
||||
#include <ccapi_cpp/ccapi_event.h>
|
||||
#include <ccapi_cpp/ccapi_session.h>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "CCApiEventDemuxer.h"
|
||||
#include "spark/collections/DiscreteValuesFilter.h"
|
||||
#include "spark/collections/Find.h"
|
||||
#include "sparkd/md/ccapi/CCApiCorrelationID.h"
|
||||
#include "sparkd/md/ccapi/ICCApiMessageHandler.h"
|
||||
#include "system/collections/discrete_values_filter.h"
|
||||
#include "system/collections/find.h"
|
||||
|
||||
#include "spark/utils/helper_macros.h"
|
||||
#include <ccapi_cpp/ccapi_event_handler.h>
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#include "CoinbaseSecurityRequestor.h"
|
||||
#include "spark/api/domain/SecurityType.pb.h"
|
||||
#include "spark/api/domain/Venue.pb.h"
|
||||
#include "spark/collections/Contains.h"
|
||||
#include "spark/collections/Remove.h"
|
||||
#include "spark/domain/Security.h"
|
||||
#include "spark/domain/SecurityCriteria.h"
|
||||
#include "spark/logging/logging.h"
|
||||
@@ -12,6 +10,8 @@
|
||||
#include "sparkd/md/ccapi/CCApiSession.h"
|
||||
#include "sparkd/md/ccapi/ICCApiMessageHandler.h"
|
||||
#include "sparkd/md/coinbase/CoinbaseSpot.h"
|
||||
#include "system/collections/contains.h"
|
||||
#include "system/collections/remove.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <ccapi_cpp/ccapi_event_dispatcher.h>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "CoinbaseSubscription.h"
|
||||
#include "spark/api/md/CoinbaseMarketDataConfig.pb.h"
|
||||
#include "spark/collections/UnorderedSetFactory.h"
|
||||
#include "spark/domain/Security.h"
|
||||
#include "spark/domain/SecurityCriteria.h"
|
||||
#include "spark/io/ProtoPrinter.h"
|
||||
@@ -15,6 +14,7 @@
|
||||
#include "sparkd/md/coinbase/CoinbaseMessageType.h"
|
||||
#include "sparkd/md/coinbase/CoinbasePriceStatisticsAdaptor.h"
|
||||
#include "sparkd/md/coinbase/CoinbaseSecurityRequestor.h"
|
||||
#include "system/collections/unordered_set_factory.h"
|
||||
|
||||
#include <ccapi_cpp/ccapi_event_handler.h>
|
||||
#include <ccapi_cpp/ccapi_message.h>
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
#include "spark/algorithm/StringCaseConverter.h"
|
||||
#include "spark/api/domain/SecurityType.pb.h"
|
||||
#include "spark/collections/HASH_IMPL.h"
|
||||
#include "spark/core/EnumMacros.h"
|
||||
#include "spark/core/FMT_IMPL.h"
|
||||
#include "spark/domain_model/Security.pb.h"
|
||||
#include "system/collections/HASH_IMPL.h"
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "spark/collections/Contains.h"
|
||||
#include "spark/core/FMT.h"
|
||||
#include "spark/core/FMT_IMPL.h"
|
||||
#include "spark/domain/SecurityCriteria.h"
|
||||
#include "spark/domain/SecurityCriteriaClause.h"
|
||||
#include "sparkd/md/deribit/DeribitInstrumentKind.h"
|
||||
#include "system/collections/contains.h"
|
||||
|
||||
#include <range/v3/view.hpp>
|
||||
#include <string>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include "DeribitInstrumentStore.h"
|
||||
#include "spark/api/domain/SecurityType.h"
|
||||
#include "spark/collections/Contains.h"
|
||||
#include "spark/collections/Remove.h"
|
||||
#include "spark/domain/Security.h"
|
||||
#include "spark/io/JsonReader.h"
|
||||
#include "spark/logging/logging.h"
|
||||
@@ -9,6 +7,8 @@
|
||||
#include "spark/utils/bts_fatal.h"
|
||||
#include "sparkd/md/deribit/DeribitCombo.h"
|
||||
#include "sparkd/md/deribit/DeribitInstrument.h"
|
||||
#include "system/collections/contains.h"
|
||||
#include "system/collections/remove.h"
|
||||
|
||||
#include <ccapi_cpp/ccapi_message.h>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
#include "DeribitSubscription.h"
|
||||
#include "spark/api/domain/Venue.pb.h"
|
||||
#include "spark/api/md/DeribitMarketDataConfig.pb.h"
|
||||
#include "spark/collections/Chunk.h"
|
||||
#include "spark/collections/Contains.h"
|
||||
#include "spark/collections/Remove.h"
|
||||
#include "spark/collections/Transform.h"
|
||||
#include "spark/core/FMT.h"
|
||||
#include "spark/core/TimeStamp.h"
|
||||
#include "spark/domain/Security.h"
|
||||
@@ -27,6 +23,10 @@
|
||||
#include "sparkd/md/deribit/DeribitSecurityRequestor.h"
|
||||
#include "sparkd/md/deribit/DeribitTickerAdaptor.h"
|
||||
#include "sparkd/md/deribit/DeribitTradeAdaptor.h"
|
||||
#include "system/collections/chunk.h"
|
||||
#include "system/collections/contains.h"
|
||||
#include "system/collections/remove.h"
|
||||
#include "system/collections/transform.h"
|
||||
|
||||
#include <ccapi_cpp/ccapi_event_dispatcher.h>
|
||||
#include <ccapi_cpp/ccapi_macro.h>
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#include "FTXSecurityRequestor.h"
|
||||
#include "spark/api/domain/SecurityType.pb.h"
|
||||
#include "spark/api/domain/Venue.pb.h"
|
||||
#include "spark/collections/Contains.h"
|
||||
#include "spark/collections/Remove.h"
|
||||
#include "spark/domain/Security.h"
|
||||
#include "spark/domain/SecurityCriteria.h"
|
||||
#include "spark/logging/logging.h"
|
||||
@@ -14,6 +12,8 @@
|
||||
#include "sparkd/md/ftx/FTXFuture.h"
|
||||
#include "sparkd/md/ftx/FTXMarket.h"
|
||||
#include "sparkd/md/ftx/FTXMessageType.h"
|
||||
#include "system/collections/contains.h"
|
||||
#include "system/collections/remove.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <ccapi_cpp/ccapi_event_dispatcher.h>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "spark/collections/HASH_IMPL.h"
|
||||
#include "spark/core/FMT_IMPL.h"
|
||||
#include "spark/io/JsonOptional.h"
|
||||
#include "sparkd/md/okx/OkxInstrumentType.h"
|
||||
#include "system/collections/HASH_IMPL.h"
|
||||
|
||||
#include <boost/container_hash/hash.hpp>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
#include "OkxSecuritySubscription.h"
|
||||
#include "spark/collections/Contains.h"
|
||||
#include "spark/collections/Remove.h"
|
||||
#include "spark/domain/SecurityCriteria.h"
|
||||
#include "spark/io/JsonReader.h"
|
||||
#include "sparkd/md/ccapi/CCApiCorrelationID.h"
|
||||
@@ -16,6 +14,8 @@
|
||||
#include "sparkd/md/okx/OkxInstrumentType.h"
|
||||
#include "sparkd/md/okx/OkxMessageType.h"
|
||||
#include "sparkd/md/okx/OkxRequest.h"
|
||||
#include "system/collections/contains.h"
|
||||
#include "system/collections/remove.h"
|
||||
|
||||
#include <ccapi_cpp/ccapi_macro.h>
|
||||
#include <ccapi_cpp/ccapi_request.h>
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
#include "OkxSubscription.h"
|
||||
#include "spark/api/domain/Venue.pb.h"
|
||||
#include "spark/api/md/OkxMarketDataConfig.pb.h"
|
||||
#include "spark/collections/Chunk.h"
|
||||
#include "spark/collections/Contains.h"
|
||||
#include "spark/collections/Transform.h"
|
||||
#include "spark/core/FMT.h"
|
||||
#include "spark/domain/Security.h"
|
||||
#include "spark/domain/SecurityCriteria.h"
|
||||
@@ -20,6 +17,9 @@
|
||||
#include "sparkd/md/okx/OkxSecuritySubscription.h"
|
||||
#include "sparkd/md/okx/OkxTickerAdaptor.h"
|
||||
#include "sparkd/md/okx/OkxTradeAdaptor.h"
|
||||
#include "system/collections/chunk.h"
|
||||
#include "system/collections/contains.h"
|
||||
#include "system/collections/transform.h"
|
||||
|
||||
#include <ccapi_cpp/ccapi_event_dispatcher.h>
|
||||
#include <ccapi_cpp/ccapi_macro.h>
|
||||
|
||||
@@ -1,48 +1,3 @@
|
||||
#pragma once
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
namespace bts::io {
|
||||
|
||||
class JsonDumper {
|
||||
public:
|
||||
template <class T>
|
||||
static std::string dump(const T &value, int indentation = 2);
|
||||
|
||||
template <class Iter>
|
||||
static std::string dump(
|
||||
Iter first,
|
||||
Iter last,
|
||||
int indentation = 2,
|
||||
const char *separator = ",\n");
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// Definition
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
template <class T>
|
||||
std::string JsonDumper::dump(const T &value, int indentation) {
|
||||
nlohmann::json j;
|
||||
to_json(j, value);
|
||||
return j.dump(indentation);
|
||||
}
|
||||
|
||||
template <class Iter>
|
||||
std::string JsonDumper::dump(
|
||||
Iter first, Iter last, int indentation, const char *separator) {
|
||||
if (first == last) {
|
||||
return "";
|
||||
}
|
||||
std::stringstream str;
|
||||
auto it = first;
|
||||
str << "[" << dump(*it, indentation);
|
||||
while (++it != last) {
|
||||
str << separator << dump(*it, indentation);
|
||||
}
|
||||
str << "]";
|
||||
return str.str();
|
||||
}
|
||||
|
||||
} // namespace bts::io
|
||||
#include "system/json/json_dumper.h"
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
#include "spark/collections/FlatUnorderedMap.h"
|
||||
|
||||
#include "system/collections/flat_unordered_map.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace bts::io {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "spark/collections/FlatUnorderedMap.h"
|
||||
|
||||
#include "system/collections/flat_unordered_map.h"
|
||||
|
||||
namespace bts::io::http {
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "spark/collections/HashCombiner.h"
|
||||
#include "system/collections/hash_combiner.h"
|
||||
|
||||
#define _HASH_ARG(x) , std::hash<decltype(t.x)>{}(t.x)
|
||||
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "spark/algorithm/PlusX.h"
|
||||
#include "spark/collections/GeneratedKeyMap.h"
|
||||
#include "system/algorithm/plus_x.h"
|
||||
#include "system/collections/GeneratedKeyMap.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
|
||||
namespace bts::collections {
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+2
-4
@@ -1,7 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include "spark/utils/bts_assert.h"
|
||||
|
||||
#include <functional>
|
||||
#include <unordered_map>
|
||||
|
||||
@@ -43,7 +41,7 @@ typename std::unordered_map<_Key, _Tp, _Hash>::iterator
|
||||
GeneratedKeyMap<_Key, _Tp, _GetNextKey, _Hash>::emplace_next(_Args... args) {
|
||||
auto [it, is_new] = std::unordered_map<_Key, _Tp, _Hash>::try_emplace(
|
||||
next_key_(), std::forward<_Args>(args)...);
|
||||
bts_assert(is_new);
|
||||
// bts_assert(is_new);
|
||||
return it;
|
||||
}
|
||||
|
||||
@@ -52,7 +50,7 @@ template <class... _Args>
|
||||
_Tp &GeneratedKeyMap<_Key, _Tp, _GetNextKey, _Hash>::emplace_next_value(
|
||||
_Args... args) {
|
||||
auto [it, is_new] = try_emplace(next_key_(), std::forward<_Args>(args)...);
|
||||
bts_assert(is_new);
|
||||
// bts_assert(is_new);
|
||||
return it->second;
|
||||
}
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+3
-1
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
#include "spark/core/AllSameType.h"
|
||||
|
||||
#include "system/all_same_type.h"
|
||||
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
#pragma once
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
namespace bts::io {
|
||||
|
||||
class JsonDumper {
|
||||
public:
|
||||
template <class T>
|
||||
static std::string dump(const T &value, int indentation = 2);
|
||||
|
||||
template <class Iter>
|
||||
static std::string dump(
|
||||
Iter first,
|
||||
Iter last,
|
||||
int indentation = 2,
|
||||
const char *separator = ",\n");
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// Definition
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
template <class T>
|
||||
std::string JsonDumper::dump(const T &value, int indentation) {
|
||||
nlohmann::json j;
|
||||
to_json(j, value);
|
||||
return j.dump(indentation);
|
||||
}
|
||||
|
||||
template <class Iter>
|
||||
std::string JsonDumper::dump(
|
||||
Iter first, Iter last, int indentation, const char *separator) {
|
||||
if (first == last) {
|
||||
return "";
|
||||
}
|
||||
std::stringstream str;
|
||||
auto it = first;
|
||||
str << "[" << dump(*it, indentation);
|
||||
while (++it != last) {
|
||||
str << separator << dump(*it, indentation);
|
||||
}
|
||||
str << "]";
|
||||
return str.str();
|
||||
}
|
||||
|
||||
} // namespace bts::io
|
||||
Reference in new issue
Block a user