Compare commits

..
Author SHA1 Message Date
John Colvin 12f0f59f70 refactor: Move OrderBuilder defs to cpp file
So impl deps don't leak into the sdk through headers
2024-03-30 03:35:51 +00:00
John Colvin 0302c44fc0 refactor: Split a few domain files off into their own project 2024-03-28 17:15:55 +00:00
John Colvin cf9e3a97fd cleanup: Get rid of BTS_NO_COPY macro
It's cleaner and more precise to specify copy ctrs/ops as deleted
2024-03-28 17:15:55 +00:00
John Colvin 90efe3dd3a gitignore: Add .mono dir
Vs code started generating this in my sparkd devcontainer (not sure why)
2024-03-28 17:15:55 +00:00
John Colvin 2a69b2173f refactor: Move a few more headers to lib_system 2024-03-28 17:15:55 +00:00
John Colvin d9b85964d8 cleanup: Get rid of old "lib/core" headers 2024-03-27 14:46:11 +00:00
John Colvin c631db70b4 refactor: Move "lib/core" into separate "lib_system" project 2024-03-27 14:03:21 +00:00
355 changed files with 1055 additions and 919 deletions

No files matched your search

+1
View File
@@ -57,3 +57,4 @@ trace_data/
**/.devcontainer
*.Generated.cs
*.lst
.mono/
+6
View File
@@ -39,6 +39,8 @@ if(WIN32)
add_compile_definitions(SHARED_MEMORY_PREFIX="spark")
add_compile_definitions(APP_DATA_DIR="\$\{APPDATA\}/bts/")
# subdirs
add_subdirectory(src/lib_system)
add_subdirectory(src/lib_domain)
add_subdirectory(src/lib)
else()
# make sparkd look for libspark.so in its directory
@@ -108,6 +110,10 @@ else()
# ** Okx **
add_compile_definitions(OKX_INSTRUMENTS_PATH="/api/v5/public/instruments")
add_compile_definitions(OKX_UNDERLYING_PATH="/api/v5/public/underlying")
# Always add lib_system (all builds depends on it)
add_subdirectory(src/lib_system)
add_subdirectory(src/lib_domain)
endif()
# subdirs
+29
View File
@@ -0,0 +1,29 @@
function(init_library source_dir)
file(
GLOB_RECURSE ${PROJECT_NAME}_Sources
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
${source_dir}/*.cpp)
# Note: cpp files inside 'tests' dir(s) are considered tests.
# Remove tests from main sources, and add them to test sources
set(${PROJECT_NAME}_Test_Sources)
foreach(item ${${PROJECT_NAME}_Sources})
if(${item} MATCHES "tests/*.cpp")
list(REMOVE_ITEM ${PROJECT_NAME}_Sources ${item})
list(APPEND ${PROJECT_NAME}_Test_Sources ${item})
endif()
endforeach()
# Add main library
add_library(${PROJECT_NAME} ${${PROJECT_NAME}_Sources})
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
# Add tests executable (if there are any)
if (${PROJECT_NAME}_Test_Sources)
add_executable(${PROJECT_NAME}-tests ${${PROJECT_NAME}_Test_Sources})
target_link_libraries(${PROJECT_NAME}-tests PRIVATE ${PROJECT_NAME})
# Catch2
find_package(Catch2 CONFIG REQUIRED COMPONENTS Catch2WithMain)
target_link_libraries(${PROJECT_NAME}-tests PRIVATE Catch2::Catch2WithMain)
endif()
endfunction(init_library)
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once
#include "lib/api/apicore.pb.h"
#include "lib/utils/bts_export.h"
#include "system/export.h"
#include <string>
#include <vector>
+2 -1
View File
@@ -1,8 +1,9 @@
#pragma once
#include "lib/api/domain/CallPut.pb.h"
#include "lib/core/EnumMacros.h"
#include "lib/io/JsonReader.h"
#include "lib/logging/logging.h"
#include "system/enum_macros.h"
#include <nlohmann/json.hpp>
namespace bts::api::domain {
+2 -1
View File
@@ -1,8 +1,9 @@
#pragma once
#include "lib/api/domain/Currency.pb.h"
#include "lib/core/EnumMacros.h"
#include "lib/io/JsonReader.h"
#include "lib/logging/logging.h"
#include "system/enum_macros.h"
#include <nlohmann/json.hpp>
namespace bts::api::domain {
+2 -2
View File
@@ -1,10 +1,10 @@
#pragma once
#include "lib/api/domain/SecurityType.pb.h"
#include "lib/core/EnumMacros.h"
#include "lib/core/FMT_IMPL.h"
#include "lib/io/JsonReader.h"
#include "lib/logging/logging.h"
#include "system/enum_macros.h"
#include "system/FMT_IMPL.h"
#include <nlohmann/json.hpp>
+2 -2
View File
@@ -1,10 +1,10 @@
#pragma once
#include "lib/api/domain/Venue.pb.h"
#include "lib/core/EnumMacros.h"
#include "lib/core/FMT_IMPL.h"
#include "lib/io/JsonReader.h"
#include "lib/logging/logging.h"
#include "system/enum_macros.h"
#include "system/FMT_IMPL.h"
#include <nlohmann/json.hpp>
+2 -1
View File
@@ -1,6 +1,7 @@
#pragma once
#include "lib/utils/bts_export.h"
#include "system/export.h"
#include <exception>
#include <string>
+1 -1
View File
@@ -5,7 +5,7 @@
#include "ServerChannel.h"
#include "StatefulPublisher.h"
#include "lib/api/apicore.pb.h"
#include "lib/utils/bts_export.h"
#include "system/export.h"
#include <cstdint>
#include <functional>
+4 -5
View File
@@ -1,7 +1,6 @@
#pragma once
#include "ClientChannel.h"
#include "lib/utils/bts_no_copy.h"
namespace bts {
namespace api {
@@ -16,13 +15,13 @@ class QuickbusClientChannel : public ClientChannel {
const ServiceContext &,
const char *type_name,
const char *service_qualifier);
QuickbusClientChannel(const QuickbusClientChannel &) = delete;
QuickbusClientChannel &operator=(const QuickbusClientChannel &) = delete;
~QuickbusClientChannel();
private:
BTS_NO_COPY(QuickbusClientChannel);
virtual void
send_core(const std::string &request_envalope, OnReply on_response) override;
virtual void send_core(
const std::string &request_envalope, OnReply on_response) override;
virtual Unsubscribe subscribe_core(
const char *method, const char *qualifier, OnSubscriptionCB cb) override;
virtual bool is_sync_call_ok() override;
+1 -1
View File
@@ -1,6 +1,6 @@
#pragma once
#include "lib/utils/bts_export.h"
#include "system/export.h"
// client
#include "../core/ApiClientInterop.h"
-2
View File
@@ -1,2 +0,0 @@
#pragma once
#include "public/ServiceContext.h"
@@ -4,7 +4,7 @@
#include "lib/api/public/ClientChannel.h"
#include "lib/api/public/Result.h"
#include "lib/api/public/Update.h"
#include "lib/utils/bts_export.h"
#include "system/export.h"
#include <google/protobuf/arena.h>
#include <functional>
@@ -1,7 +1,8 @@
#pragma once
#include "{{filename name}}.pb.h"
#include "lib/api/public/ApiServer.h"
#include "lib/utils/bts_export.h"
#include "system/export.h"
#include <string>
#include <functional>
#include <vector>
+2 -2
View File
@@ -1,10 +1,10 @@
#pragma once
#include "lib/api/services/OrderService.pb.h"
#include "lib/core/EnumMacros.h"
#include "lib/core/FMT_IMPL.h"
#include "lib/io/JsonReader.h"
#include "lib/logging/logging.h"
#include "system/enum_macros.h"
#include "system/FMT_IMPL.h"
#include <nlohmann/json.hpp>
+1 -1
View File
@@ -1,7 +1,7 @@
#include "../public/ApiUtils.h"
#include "../public/ServiceContext.h"
#include "HelloServiceServer.h"
#include "lib/utils/bts_export.h"
#include "system/export.h"
#include "lib/api/services/ApiUnitTestService.server.pb.h"
+3 -4
View File
@@ -1,10 +1,8 @@
#pragma once
#include "lib/utils/bts_export.h"
#include "lib/utils/bts_no_copy.h"
#include "lib/api/services/HelloService.client.pb.h"
#include "lib/api/services/HelloService.server.pb.h"
#include "system/export.h"
namespace bts {
namespace api {
@@ -13,9 +11,10 @@ namespace test {
struct BTS_EXPORT HelloServiceServer : public HelloServiceBase {
public:
HelloServiceServer(bts::api::ServiceContext &context);
HelloServiceServer(const HelloServiceServer &) = delete;
HelloServiceServer &operator=(const HelloServiceServer &) = delete;
private:
BTS_NO_COPY(HelloServiceServer);
int _id;
ShoutService _shouter;
GreetingsPublisher _gpub;
@@ -1,5 +1,6 @@
function(get_link_libraries dest)
set(${dest}
bts-system
curl
tbb
boost_system
@@ -1,5 +1,7 @@
function(get_link_libraries dest)
set(${dest}
bts-system
bts-domain
protobuf
double-conversion
boost_system
@@ -1,6 +1,7 @@
function(get_link_libraries dest)
find_package(fmt CONFIG REQUIRED)
set(${dest}
bts-system
crypt32
fmt::fmt-header-only
libcrypto
+3 -1
View File
@@ -1,5 +1,7 @@
#pragma once
#include "lib/core/AllSameType.h"
#include "system/all_same_type.h"
#include <unordered_map>
#include <unordered_set>
+2 -4
View File
@@ -1,13 +1,11 @@
#include "lib/utils/windows_wrapper.h"
#include "ConfigDownloader.h"
#include "lib/utils/bts_assert.h"
#include "system/windows_wrapper.h"
#include <boost/algorithm/string.hpp>
#include <sstream>
#include <stdio.h>
#include "lib/utils/bts_assert.h"
using namespace std;
namespace bts {
+2 -2
View File
@@ -1,6 +1,5 @@
#pragma once
#include "lib/utils/bts_no_copy.h"
#include <curl/curl.h>
#include <string>
@@ -11,6 +10,8 @@ namespace internal {
class ConfigDownloader {
public:
ConfigDownloader();
ConfigDownloader(const ConfigDownloader &) = delete;
ConfigDownloader &operator=(const ConfigDownloader &) = delete;
~ConfigDownloader();
enum Result { FAILURE, SUCCESS, PERMANENT_FAILURE };
@@ -18,7 +19,6 @@ class ConfigDownloader {
Result get(const std::string &url, std::stringstream &out_stream);
private:
BTS_NO_COPY(ConfigDownloader);
CURL *_curl;
};
+2 -2
View File
@@ -17,6 +17,8 @@ class ConfigErrorCollector : public proto::io::ErrorCollector,
public proto::DescriptorPool::ErrorCollector {
public:
ConfigErrorCollector(ConfigLog &log, const char *file);
ConfigErrorCollector(const ConfigErrorCollector &) = delete;
ConfigErrorCollector &operator=(const ConfigErrorCollector &) = delete;
void AddError(int line, int column, const std::string &message) override;
void AddWarning(int line, int column, const std::string &message) override;
@@ -40,8 +42,6 @@ class ConfigErrorCollector : public proto::io::ErrorCollector,
std::string ToString();
private:
BTS_NO_COPY(ConfigErrorCollector);
ConfigLog &_log;
std::string _file;
std::vector<std::string> _errors;
-1
View File
@@ -1,7 +1,6 @@
#pragma once
#include "lib/logging/logging.h"
#include "lib/utils/bts_no_copy.h"
#include <memory>
#include <sstream>
+1 -2
View File
@@ -1,9 +1,8 @@
#include "ConfigPropertyEvaluator.h"
#include "ConfigurationState.h"
#include "lib/expression/ExpressionEvaluator.h"
#include "lib/utils/bts_assert.h"
#include "lib/utils/windows_wrapper.h"
#include "system/windows_wrapper.h"
#include <boost/tokenizer.hpp>
#include <google/protobuf/descriptor.h>
+2 -3
View File
@@ -3,7 +3,6 @@
#include "lib/expression/IPropertyEvaluator.h"
#include "lib/expression/Value.h"
#include "lib/utils/bts_no_copy.h"
namespace bts {
namespace expression {
@@ -17,14 +16,14 @@ class ConfigurationState;
class ConfigPropertyEvaluator : public expression::IPropertyEvaluator {
public:
ConfigPropertyEvaluator(ConfigurationState &config);
ConfigPropertyEvaluator(const ConfigPropertyEvaluator &) = delete;
ConfigPropertyEvaluator &operator=(const ConfigPropertyEvaluator &) = delete;
~ConfigPropertyEvaluator();
bool get_value(
const std::string &property, expression::Value *out_value) override;
private:
BTS_NO_COPY(ConfigPropertyEvaluator);
ConfigurationState &_config;
std::shared_ptr<expression::ExpressionEvaluator> _rule_engine;
};
+2 -2
View File
@@ -3,9 +3,9 @@
#include "lib/collections/Contains.h"
#include "lib/config/ConfigQueryErrors.h"
#include "lib/config/text_format/text_format.h"
#include "lib/core/EnumMacros.h"
#include "lib/utils/TimeStamp.h"
#include "lib/utils/bts_export.h"
#include "system/enum_macros.h"
#include "system/export.h"
#include <cmath>
#include <google/protobuf/descriptor.h>
+2 -1
View File
@@ -1,5 +1,6 @@
#pragma once
#include "lib/utils/bts_export.h"
#include "system/export.h"
#include <string>
#include <vector>
+2 -1
View File
@@ -1,5 +1,6 @@
#pragma once
#include "lib/core/EnumMacros.h"
#include "system/enum_macros.h"
namespace bts::config {
+2 -2
View File
@@ -2,7 +2,6 @@
#include "lib/expression/IPropertyEvaluator.h"
#include "lib/expression/Value.h"
#include "lib/utils/bts_no_copy.h"
#include "text_format/text_format.h"
#include <string>
@@ -36,6 +35,8 @@ struct DeferredValue {
class ConfigValueQueue : public google::protobuf::IDeferValueLookup {
public:
ConfigValueQueue(expression::IPropertyEvaluator &evaluator);
ConfigValueQueue(const ConfigValueQueue &) = delete;
ConfigValueQueue &operator=(const ConfigValueQueue &) = delete;
~ConfigValueQueue();
// Process the queue of deferred values
@@ -60,7 +61,6 @@ class ConfigValueQueue : public google::protobuf::IDeferValueLookup {
expression::IPropertyEvaluator &_eval;
std::vector<DeferredValue> _vals;
std::string _current_file;
BTS_NO_COPY(ConfigValueQueue);
private: // methods
void process_fields();
+2 -1
View File
@@ -1,7 +1,8 @@
#ifndef BADCONFIGURATIONEXCEPTION_H_
#define BADCONFIGURATIONEXCEPTION_H_
#include "lib/utils/bts_export.h"
#include "system/export.h"
#include <sstream>
#include <stdexcept>
#include <string>
+7 -12
View File
@@ -1,21 +1,21 @@
#include "ConfigurationState.h"
#include "ConfigErrorCollector.h"
#include "ConfigPropertyEvaluator.h"
#include "ConfigValueQueue.h"
#include "ConfigurationException.h"
#include "PreprocessInputStream.h"
#include "config.h"
#include "lib/collections/Contains.h"
#include "lib/core/FMT.h"
#include "lib/config/PreprocessInputStream.h"
#include "lib/config/config.h"
#include "lib/config/protos/system_config.pb.h"
#include "lib/config_defaults.h"
#include "lib/config_proto_files.h"
#include "lib/io/ProtoPrinter.h"
#include "lib/os/os.h"
#include "lib/utils/bts_array_size.h"
#include "lib/utils/bts_assert.h"
#include "lib/utils/defer.h"
#include "lib/utils/is_unittest_environment.h"
#include "lib/config/protos/system_config.pb.h"
#include "system/FMT.h"
#include "system/array_size.h"
#include <algorithm>
#include <boost/algorithm/string.hpp> // iequals
@@ -33,9 +33,6 @@
#define URDL_DISALE_SSL 1
#include <urdl/url.hpp>
#include "lib/config_defaults.h"
#include "lib/config_proto_files.h"
#ifdef _WIN32
#include <Winsock2.h>
#include <d2d1.h>
@@ -46,8 +43,6 @@
#include <sys/socket.h>
#endif
#include "lib/os/os.h"
using namespace std;
namespace bts {
+4 -7
View File
@@ -4,18 +4,15 @@
#include "ConfigDownloader.h"
#include "ConfigLog.h"
#include "ConfigurationException.h"
#include "lib/expression/ExpressionEvaluator.h"
#include "lib/expression/Value.h"
#include "text_format/text_format.h"
#include <boost/scoped_ptr.hpp>
#include <boost/utility.hpp>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/descriptor.pb.h>
#include <google/protobuf/dynamic_message.h>
#include <google/protobuf/io/zero_copy_stream_impl.h>
#include <boost/scoped_ptr.hpp>
#include <boost/utility.hpp>
#include <mutex>
#include <vector>
@@ -48,6 +45,8 @@ class ConfigValueQueue;
class ConfigurationState {
public:
ConfigurationState(void);
ConfigurationState(const ConfigurationState &) = delete;
ConfigurationState &operator=(const ConfigurationState &) = delete;
~ConfigurationState(void);
void initialize_defaults(ConfigLog &log);
@@ -92,8 +91,6 @@ class ConfigurationState {
get_descriptor_by_name(const std::string &name);
private:
BTS_NO_COPY(ConfigurationState);
void initialize_builtins(ConfigLog *log = nullptr);
void initialize_introspection();
void initialize_macros();
+3 -2
View File
@@ -1,6 +1,5 @@
#pragma once
#include "lib/utils/bts_no_copy.h"
#include <boost/scoped_ptr.hpp>
#include <google/protobuf/io/zero_copy_stream_impl.h>
@@ -19,6 +18,9 @@ class PreprocessInputStream : public proto::io::ZeroCopyInputStream {
std::istream &input, std::map<std::string, std::string> replacements);
~PreprocessInputStream();
PreprocessInputStream(const PreprocessInputStream &) = delete;
PreprocessInputStream &operator=(const PreprocessInputStream &) = delete;
bool Next(const void **data, int *size) override;
void BackUp(int count) override;
bool Skip(int count) override;
@@ -27,7 +29,6 @@ class PreprocessInputStream : public proto::io::ZeroCopyInputStream {
private:
std::string _buffer;
boost::scoped_ptr<proto::io::ArrayInputStream> _stream;
BTS_NO_COPY(PreprocessInputStream);
};
} // namespace config
+1 -1
View File
@@ -1,8 +1,8 @@
#ifndef BTS_CONFIG_H_
#define BTS_CONFIG_H_
#include "lib/utils/bts_export.h"
#include "lib/utils/checked_cast.h"
#include "system/export.h"
#include <string>
#include <vector>
-58
View File
@@ -1,58 +0,0 @@
#include "TimeStamp.h"
#include "lib/utils/datetime.h"
#include <boost/date_time/posix_time/time_formatters.hpp>
namespace bts::core {
using std::uint32_t;
static bool is_valid_ymd(uint32_t year, uint32_t month, uint32_t day) {
return year >= 1970 && month >= 1 && month <= 12 && day >= 1 && day <= 31;
}
TimeStamp::TimeStamp(uint32_t year, uint32_t month, uint32_t day) {
bts_assert_msgf(
is_valid_ymd(year, month, day), "Invalid timestamp {}/{}/{} (y/m/d)",
year, month, day);
std::tm date = {};
date.tm_year = year - 1900;
date.tm_mon = month - 1;
date.tm_mday = day;
auto time = std::chrono::system_clock::from_time_t(mktime(&date));
auto duration = time.time_since_epoch();
value_ =
std::chrono::duration_cast<std::chrono::nanoseconds>(duration).count();
}
bool TimeStamp::from_ymd(
std::uint32_t year, std::uint32_t month, std::uint32_t day, TimeStamp *result) {
if (!is_valid_ymd(year, month, day)) {
return false;
}
*result = TimeStamp{year, month, day};
return true;
}
TimeStamp TimeStamp::from_iso_string(const std::string &iso_string) {
auto ptime = datetime::parse_iso_date_time_string(iso_string);
return from_ptime(ptime);
}
std::string TimeStamp::to_iso_string() const {
return boost::posix_time::to_iso_string(to_ptime());
}
std::ostream &operator<<(std::ostream &out, const TimeStamp &ts) noexcept {
out << ts.to_iso_string();
return out;
}
TimeStamp TimeStamp::from_ptime(boost::posix_time::ptime t) {
// time_t is Unix time: number of seconds since epoch Jan 1, 1970
auto epoch_pt =
t - boost::posix_time::ptime(boost::gregorian::date(1970, 1, 1));
auto epoch_nanos = epoch_pt.total_nanoseconds();
return TimeStamp{static_cast<std::uint64_t>(epoch_nanos)};
}
} // namespace bts::core
@@ -4,8 +4,9 @@
#include "lib/api/services/AdminService.server.pb.h"
#include "lib/config/config.h"
#include "lib/datastreams/Tables/StreamData.h"
#include "lib/utils/bts_chrono.h"
#include "lib/utils/helper_macros.h"
#include "system/bts_chrono.h"
#include <memory>
using namespace bts::streams;
+4 -2
View File
@@ -1,6 +1,8 @@
#pragma once
#include "lib/core/EnumMacros.h"
#include "lib/core/FMT_IMPL.h"
#include "system/enum_macros.h"
#include "system/FMT_IMPL.h"
#include <fmt/format.h>
#include <nlohmann/json.hpp>
#include <ostream>
+3 -1
View File
@@ -1,6 +1,8 @@
#pragma once
#include "lib/core/TimeStamp.h"
#include "lib/io/JsonReader.h"
#include "system/time_stamp.h"
#include <nlohmann/json.hpp>
namespace bts::domain {
+2 -1
View File
@@ -1,8 +1,9 @@
#pragma once
#include "lib/api/domain/CallPut.h"
#include "lib/core/TimeStamp.h"
#include "lib/domain/Price.h"
#include "lib/io/JsonReader.h"
#include "system/time_stamp.h"
#include <nlohmann/json.hpp>
namespace bts::domain {
+1 -1
View File
@@ -1,9 +1,9 @@
#pragma once
#include "Side.h"
#include "lib/core/FMT_IMPL.h"
#include "lib/io/JsonReader.h"
#include "lib/utils/bts_assert.h"
#include "system/FMT_IMPL.h"
#include <cmath>
#include <cstdint>
+1 -1
View File
@@ -1,9 +1,9 @@
#pragma once
#include "lib/core/FMT_IMPL.h"
#include "lib/io/JsonReader.h"
#include "lib/logging/logging.h"
#include "lib/utils/ValueWrapper.h"
#include "system/FMT_IMPL.h"
#include <cstdint>
#include <nlohmann/json.hpp>
-1
View File
@@ -1,6 +1,5 @@
#include "Security.h"
#include "DomainSecurityUtils.h"
#include "lib/core/TableFormatter.h"
#include "lib/domain/FutureSecurity.h"
#include "lib/domain/OptionSecurity.h"
#include "lib/domain/SpotSecurity.h"
+1 -1
View File
@@ -4,9 +4,9 @@
#include "SecurityCommon.h"
#include "SpotSecurity.h"
#include "SpreadSecurity.h"
#include "lib/core/FMT_IMPL.h"
#include "lib/domain/SecurityID.h"
#include "lib/utils/overloaded.h"
#include "system/FMT_IMPL.h"
#include <fmt/format.h>
#include <variant>
+2 -1
View File
@@ -6,7 +6,6 @@
#include "lib/api/domain/SecurityType.pb.h"
#include "lib/api/domain/Venue.h"
#include "lib/api/domain/Venue.pb.h"
#include "lib/core/TimeStamp.h"
#include "lib/domain/FutureSecurity.h"
#include "lib/domain/LegDefinition.h"
#include "lib/domain/OptionSecurity.h"
@@ -17,6 +16,8 @@
#include "lib/io/JsonReader.h"
#include "lib/logging/logging.h"
#include "lib/utils/bts_assert.h"
#include "system/time_stamp.h"
#include <limits>
#include <nlohmann/json.hpp>
#include <string>
+2 -1
View File
@@ -1,7 +1,8 @@
#include "SecurityCriteria.h"
#include "lib/api/domain/SecurityCriteria.pb.h"
#include "lib/core/FMT.h"
#include "lib/domain/DomainSecurityUtils.h"
#include "system/FMT.h"
#include <algorithm>
namespace bts::domain {
+1 -1
View File
@@ -2,9 +2,9 @@
#include "SecurityID.h"
#include "lib/api/domain/Venue.pb.h"
#include "lib/domain/Security.h"
#include "lib/core/FMT_IMPL.h"
#include "lib/domain/SecurityCriteriaClause.h"
#include "lib/domain_model/Security.pb.h"
#include "system/FMT_IMPL.h"
#include <boost/container/small_vector.hpp>
#include <optional>
+1 -1
View File
@@ -4,9 +4,9 @@
#include "lib/api/domain/SecurityType.h"
#include "lib/api/domain/Venue.h"
#include "lib/collections/Contains.h"
#include "lib/core/FMT.h"
#include "lib/domain/Security.h"
#include "lib/domain_model/Security.pb.h"
#include "system/FMT.h"
#include <range/v3/view.hpp>
#include <regex>
+1 -1
View File
@@ -1,8 +1,8 @@
#pragma once
#include "lib/api/domain/SecurityType.pb.h"
#include "lib/api/domain/Venue.pb.h"
#include "lib/core/FMT_IMPL.h"
#include "lib/domain/SecurityID.h"
#include "system/FMT_IMPL.h"
#include <boost/container/small_vector.hpp>
#include <fmt/format.h>
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once
#include "lib/core/FMT_IMPL.h"
#include "lib/utils/ValueWrapper.h"
#include "system/FMT_IMPL.h"
#include <cstdint>
#include <nlohmann/json.hpp>
@@ -2,10 +2,11 @@
#include "Price.h"
#include "Quantity.h"
#include "Security.h"
#include "lib/core/FMT_IMPL.h"
#include "lib/io/JsonReader.h"
#include "lib/md/IntPrice.h"
#include "lib/md/protos/co2.pb.h"
#include "system/FMT_IMPL.h"
#include <fmt/format.h>
#include <nlohmann/json.hpp>
#include <ostream>
+2 -1
View File
@@ -3,10 +3,11 @@
#include "Price.h"
#include "Quantity.h"
#include "SecurityID.h"
#include "lib/core/TimeStamp.h"
#include "lib/logging/logging.h"
#include "lib/md/IntPrice.h"
#include "lib/md/protos/co2.pb.h"
#include "system/time_stamp.h"
#include <nlohmann/json.hpp>
namespace bts::domain {
+2 -2
View File
@@ -1,12 +1,12 @@
#pragma once
#include "lib/core/FMT_IMPL.h"
#include "lib/domain_model/Security.pb.h"
#include "lib/domain_model/Side.h"
#include "lib/domain_model/Venue.h"
#include "lib/domain_model/common.h"
#include "domain/domain.h"
#include "lib/utils/bts_assert.h"
#include "lib/utils/datetime.h"
#include "system/FMT_IMPL.h"
#include <cmath>
#include <memory>
+2 -2
View File
@@ -1,10 +1,10 @@
#pragma once
#include "lib/core/EnumMacros.h"
#include "lib/core/FMT_IMPL.h"
#include "lib/domain_model/Security.pb.h"
#include "lib/io/JsonReader.h"
#include "lib/logging/logging.h"
#include "system/enum_macros.h"
#include "system/FMT_IMPL.h"
#include <nlohmann/json.hpp>
+2 -2
View File
@@ -1,10 +1,10 @@
#pragma once
#include "lib/core/EnumMacros.h"
#include "lib/core/FMT_IMPL.h"
#include "lib/domain_model/Security.pb.h"
#include "lib/io/JsonReader.h"
#include "lib/logging/logging.h"
#include "system/enum_macros.h"
#include "system/FMT_IMPL.h"
#include <nlohmann/json.hpp>
-21
View File
@@ -1,21 +0,0 @@
#include "sod.h"
#include "lib/config/config.h"
#include "lib/config/protos/orders_fills_cleanup.pb.h"
namespace bts {
namespace sod {
datetime::PTime get_sod_for(datetime::PTime const &this_time) {
const auto &sod = config::get<config::SODTime>();
auto sod_time = datetime::make_ptime(
this_time.date().year(), this_time.date().month().as_number(),
this_time.date().day().as_number(), sod.sod_hh(), sod.sod_mm(), 0, 0);
if (sod_time > this_time)
sod_time -= boost::gregorian::date_duration(1);
return sod_time;
}
datetime::PTime get_current_sod() { return get_sod_for(datetime::local_now()); }
} // namespace sod
} // namespace bts
-13
View File
@@ -1,13 +0,0 @@
#pragma once
#include "lib/utils/datetime.h"
#include <boost/date_time/posix_time/posix_time.hpp>
namespace bts {
namespace sod {
datetime::PTime get_sod_for(datetime::PTime const &this_time);
datetime::PTime get_current_sod();
} // namespace sod
} // namespace bts
+1 -1
View File
@@ -1,7 +1,7 @@
#include "../Security.h"
#include "catch/catch.hpp"
#include "lib/core/TimeStamp.h"
#include "system/time_stamp.h"
#include "lib/domain_model/Security.h"
#include "lib/quickbus/rpc/RPCServiceName.h"
#include "lib/utils/PBUtils.h"
+2 -4
View File
@@ -1,14 +1,11 @@
#ifndef BOOLEANGRAMMAR_H_
#define BOOLEANGRAMMAR_H_
#include "lib/utils/bts_no_copy.h"
#include <boost/config/warning_disable.hpp>
#include <boost/spirit/include/phoenix_function.hpp>
#include <boost/spirit/include/phoenix_operator.hpp>
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/support_utree.hpp>
#include <string>
/*
@@ -253,9 +250,10 @@ class BooleanGrammar
("=" >> _primitive[eq_expr(_val, _1)]) |
("!=" >> _primitive[neq_expr(_val, _1)]));
}
BooleanGrammar(const BooleanGrammar &) = delete;
BooleanGrammar &operator=(const BooleanGrammar &) = delete;
private:
BTS_NO_COPY(BooleanGrammar);
qi::rule<Iterator, std::string()> _internal_string;
qi::rule<Iterator, sp::utree(), space_type> _expression, _primitive, _term,
_list, _property, _quoted_string;
+2 -1
View File
@@ -19,6 +19,8 @@ namespace expression {
class ExpressionEvaluatorImpl {
public:
ExpressionEvaluatorImpl(std::shared_ptr<IPropertyEvaluator> property_eval);
ExpressionEvaluatorImpl(const ExpressionEvaluatorImpl &) = delete;
ExpressionEvaluatorImpl &operator=(const ExpressionEvaluatorImpl &) = delete;
~ExpressionEvaluatorImpl();
bool eval(const std::string &expression) const;
@@ -32,7 +34,6 @@ class ExpressionEvaluatorImpl {
Value eval_to_value(const std::string &expression) const;
private:
BTS_NO_COPY(ExpressionEvaluatorImpl);
bool parse(
std::string::const_iterator &begin,
+2 -1
View File
@@ -18,6 +18,8 @@ class ExpressionEvaluatorImpl;
class ExpressionEvaluator {
public:
ExpressionEvaluator(std::shared_ptr<IPropertyEvaluator> property_eval);
ExpressionEvaluator(const ExpressionEvaluator &) = delete;
ExpressionEvaluator &operator=(const ExpressionEvaluator &) = delete;
~ExpressionEvaluator();
bool eval(const std::string &expression) const;
@@ -34,7 +36,6 @@ class ExpressionEvaluator {
bool eval_ast(const boost::spirit::utree &ast) const;
private:
BTS_NO_COPY(ExpressionEvaluator);
std::unique_ptr<ExpressionEvaluatorImpl> _impl;
};
+4 -3
View File
@@ -1,7 +1,6 @@
#ifndef RECURSIONGUARD_H_
#define RECURSIONGUARD_H_
#include "lib/utils/bts_no_copy.h"
#include <boost/thread.hpp>
#include <vector>
@@ -15,6 +14,8 @@ template <typename T> struct GuardFrame {
GuardFrame() : _owner(0) {}
GuardFrame(RecursionGuard<T> &owner) : _owner(&owner) {}
GuardFrame(const GuardFrame &) = delete;
GuardFrame &operator=(const GuardFrame &) = delete;
~GuardFrame() {
if (_owner) {
@@ -26,13 +27,14 @@ template <typename T> struct GuardFrame {
void set_owner(RecursionGuard<T> *owner) { _owner = owner; }
private:
BTS_NO_COPY(GuardFrame);
RecursionGuard<T> *_owner;
};
template <typename T> class RecursionGuard {
public:
RecursionGuard() : _recursion_guard() {}
RecursionGuard(const RecursionGuard &) = delete;
RecursionGuard &operator=(const RecursionGuard &) = delete;
~RecursionGuard() {}
std::vector<T> &get() {
@@ -61,7 +63,6 @@ template <typename T> class RecursionGuard {
template <typename U> friend struct GuardFrame;
private:
BTS_NO_COPY(RecursionGuard);
boost::thread_specific_ptr<std::vector<T>> _recursion_guard;
};
+2 -1
View File
@@ -1,9 +1,10 @@
#include "JsonReader.h"
#include "lib/algorithm/TryCatch.h"
#include "lib/core/TimeStamp.h"
#include "lib/logging/logging.h"
#include "lib/utils/TimeStamp.h"
#include "lib/utils/datetime.h"
#include "system/time_stamp.h"
#include <boost/date_time/posix_time/ptime.hpp>
#include <exception>
#include <limits>
+4 -1
View File
@@ -1,5 +1,8 @@
#pragma once
#include "lib/core/TimeStamp.h"
#include "lib/utils/bts_assert.h"
#include "system/time_stamp.h"
#include <cstdint>
#include <nlohmann/json.hpp>
#include <optional>
+2 -1
View File
@@ -1,6 +1,7 @@
#pragma once
#ifdef SPARK_ENABLE_CCAPI
#include "lib/core/EnumMacros.h"
#include "system/enum_macros.h"
#include <nlohmann/detail/value_t.hpp>
#include <nlohmann/json.hpp>
#include <ostream>
+2 -1
View File
@@ -1,6 +1,7 @@
#pragma once
#include "QueryParams.h"
#include "lib/core/HashPhaser.h"
#include "system/hash_phaser.h"
#include <functional>
#include <ostream>
#include <string>
+2 -2
View File
@@ -1,8 +1,8 @@
#pragma once
#ifdef SPARK_ENABLE_CCAPI
#include "lib/core/EnumMacros.h"
#include "lib/core/FMT_IMPL.h"
#include "system/enum_macros.h"
#include "system/FMT_IMPL.h"
#include <fmt/format.h>
#include <nlohmann/json.hpp>
+2 -2
View File
@@ -3,9 +3,9 @@
#include "lib/algorithm/StringCaseConverter.h"
#include "lib/api/domain/SecurityType.pb.h"
#include "lib/core/EnumMacros.h"
#include "lib/core/FMT_IMPL.h"
#include "lib/domain_model/Security.pb.h"
#include "system/enum_macros.h"
#include "system/FMT_IMPL.h"
#include <fmt/format.h>
#include <nlohmann/json.hpp>
+1 -1
View File
@@ -1,6 +1,6 @@
#pragma once
#include "lib/core/FMT_IMPL.h"
#include "system/FMT_IMPL.h"
#include <cstdint>
#include <fmt/format.h>
+3 -3
View File
@@ -1,8 +1,8 @@
#pragma once
#include "lib/core/FMT.h"
#include "lib/core/FMT_IMPL.h"
#include "lib/core/TimeStamp.h"
#include "system/FMT.h"
#include "system/FMT_IMPL.h"
#include "system/time_stamp.h"
#include <cstdint>
#include <fmt/format.h>
+1 -1
View File
@@ -1,8 +1,8 @@
#pragma once
#include "lib/core/FMT_IMPL.h"
#include "lib/io/websocket/JsonRpcId.h"
#include "lib/utils/bts_assert.h"
#include "system/FMT_IMPL.h"
#include <fmt/format.h>
#include <nlohmann/json.hpp>
+1 -1
View File
@@ -1,9 +1,9 @@
#pragma once
#include "lib/core/FMT_IMPL.h"
#include "lib/io/websocket/JsonRpcError.h"
#include "lib/io/websocket/JsonRpcId.h"
#include "lib/utils/overloaded.h"
#include "system/FMT_IMPL.h"
#include <nlohmann/json.hpp>
#include <optional>
+2 -3
View File
@@ -1,5 +1,4 @@
#include "CoreGateway.h"
#include "lib/jetfix/common/OutFIX.h"
#include "lib/jetfix/connection/AsyncReader.h"
#include "lib/jetfix/connection/IConnection.h"
@@ -10,13 +9,13 @@
#include "lib/orderman/orderman_utils/orderman_common.h"
#include "lib/tracing/bts_trace.h"
#include "lib/utils/TimeStamp.h"
#include "lib/utils/bts_chrono.h"
#include "lib/utils/datetime.h"
#include "lib/utils/thread_manager.h"
#include <boost/lockfree/queue.hpp>
#include "system/bts_chrono.h"
#include <atomic>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/lockfree/queue.hpp>
#include <fmt/format.h>
#include <fstream>
#include <tbb/concurrent_queue.h>
+1 -1
View File
@@ -7,10 +7,10 @@
#include "lib/jetfix/common/OutFIX.h"
#include "lib/jetfix/store/session_name.h"
#include "lib/os/os.h"
#include "lib/utils/bts_chrono.h"
#include "lib/utils/datetime.h"
#include "lib/utils/file_utils.h"
#include "lib/utils/thread_manager.h"
#include "system/bts_chrono.h"
#include <boost/date_time.hpp>
#include <boost/date_time/gregorian/gregorian.hpp>
+1 -1
View File
@@ -1,6 +1,6 @@
#pragma once
#include "lib/utils/windows_wrapper.h"
#include "system/windows_wrapper.h"
#include <array>
#include <limits>
+1 -1
View File
@@ -3,8 +3,8 @@
#include "Logger.h"
#include "lib/os/os.h"
#include "lib/utils/bts_assert.h"
#include "lib/utils/bts_chrono.h"
#include "lib/utils/thread_manager.h"
#include "system/bts_chrono.h"
#include <algorithm>
#include <atomic>
+2 -2
View File
@@ -5,13 +5,13 @@
#include "lib/config/protos/deployment_type.pb.h"
#include "lib/config/protos/logging.pb.h"
#include "lib/config/protos/system_config.pb.h"
#include "lib/core/LockGuard.h"
#include "lib/os/os.h"
#include "lib/utils/Dispatcher.h"
#include "lib/utils/bts_assert.h"
#include "lib/utils/bts_chrono.h"
#include "lib/utils/file_utils.h"
#include "lib/utils/thread_manager.h"
#include "system/bts_chrono.h"
#include "system/lock_guard.h"
#include <boost/circular_buffer.hpp>
#include <boost/container/flat_set.hpp>
+1 -1
View File
@@ -4,7 +4,7 @@
#include "Logger.h"
#include "LoggerHub.h"
#include "lib/utils/Dispatcher.h"
#include "lib/utils/bts_chrono.h"
#include "system/bts_chrono.h"
#include <atomic>
#include <boost/filesystem/path.hpp>
+1 -1
View File
@@ -2,7 +2,7 @@
#include "lib/config/config.h"
#include "lib/config/protos/logging.pb.h"
#include "lib/logging/logging.h"
#include "lib/utils/bts_chrono.h"
#include "system/bts_chrono.h"
#include <fmt/format.h>
#include <fmt/chrono.h>
+4 -3
View File
@@ -1,9 +1,10 @@
#pragma once
#ifdef SPARK_ENABLE_CCAPI
#include "lib/core/FMT_IMPL.h"
#include "lib/core/StringFinder.h"
#include "lib/core/StringJoiner.h"
#include "lib/utils/bts_assert.h"
#include "system/FMT_IMPL.h"
#include "system/string_finder.h"
#include "system/string_joiner.h"
#include <boost/algorithm/string/split.hpp>
#include <cstddef>
#include <string>
+3 -2
View File
@@ -1,7 +1,8 @@
#ifdef SPARK_ENABLE_CCAPI
#include "CCApiMessageLogger.h"
#include "lib/core/StringJoiner.h"
#include "lib/core/TimeStamp.h"
#include "system/string_joiner.h"
#include "system/time_stamp.h"
#include <fmt/format.h>
#include <range/v3/view.hpp>
#include <range/v3/view/transform.hpp>
+1 -1
View File
@@ -1,12 +1,12 @@
#ifdef SPARK_ENABLE_CCAPI
#include "CCApiTradeAdaptor.h"
#include "lib/core/TimeStamp.h"
#include "lib/domain/SecurityID.h"
#include "lib/domain/TradeRecord.h"
#include "lib/md/CCApiCorrelationID.h"
#include "lib/md/CCApiTradeRecord.h"
#include "lib/md/ICCApiMessageHandler.h"
#include "lib/utils/bts_fatal.h"
#include "system/time_stamp.h"
#include <ccapi_cpp/ccapi_event.h>
#include <ccapi_cpp/ccapi_message.h>
+2 -1
View File
@@ -7,8 +7,9 @@
#include "lib/io/JsonDumper.h"
#include "lib/io/JsonReader.h"
#include "lib/md/CCApiReader.h"
#include "lib/utils/bts_chrono.h"
#include "lib/utils/datetime.h"
#include "system/bts_chrono.h"
#include <ccapi_cpp/ccapi_element.h>
#include <ccapi_cpp/ccapi_macro.h>
#include <ccapi_cpp/ccapi_message.h>
+3 -2
View File
@@ -1,7 +1,8 @@
#pragma once
#ifdef SPARK_ENABLE_CCAPI
#include "lib/core/NaN.h"
#include "lib/core/TimeStamp.h"
#include "system/nan.h"
#include "system/time_stamp.h"
#include <cstdint>
#include <nlohmann/json.hpp>
#include <vector>
+5 -3
View File
@@ -1,7 +1,8 @@
#pragma once
#include "lib/md/Shm/FixedSecurity.h"
#include "lib/utils/bts_export.h"
#include "lib/utils/bts_no_copy.h"
#include "system/export.h"
#include <string>
namespace bts {
@@ -12,6 +13,8 @@ class FixedSecurity;
class BTS_EXPORT ShmDumper {
public:
ShmDumper(const std::string &name);
ShmDumper(const ShmDumper &) = delete;
ShmDumper &operator=(const ShmDumper &) = delete;
~ShmDumper();
void dump_hot();
@@ -19,7 +22,6 @@ class BTS_EXPORT ShmDumper {
static std::string dump_security(const FixedSecurity &security);
private:
BTS_NO_COPY(ShmDumper);
std::string _name;
};
+2 -2
View File
@@ -3,7 +3,6 @@
#include "lib/api/domain/Currency.pb.h"
#include "lib/api/domain/SecurityType.pb.h"
#include "lib/api/domain/Venue.pb.h"
#include "lib/core/TimeStamp.h"
#include "lib/domain/AggressorSide.h"
#include "lib/domain/Book.h"
#include "lib/domain/DomainSecurityUtils.h"
@@ -40,9 +39,10 @@
#include "lib/utils/TimeStamp.h"
#include "lib/utils/bts_assert.h"
#include "lib/utils/bts_fatal.h"
#include "system/time_stamp.h"
#include <cstdio>
#include <memory>
#include <bits/stdint-uintn.h>
#include <cstdio>
#include <google/protobuf/timestamp.pb.h>
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once
#include "domain/security_key.h"
#include "lib/api/services/SyntheticSecurityService.pb.h"
#include "lib/domain_model/SecurityKey.h"
#include "lib/utils/Event.h"
#include <unordered_map>
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once
#include "lib/domain_model/Security.pb.h"
#include "lib/utils/bts_array_size.h"
#include "lib/utils/bts_assert.h"
#include "system/array_size.h"
namespace bts {
namespace md {
+2 -2
View File
@@ -2,10 +2,10 @@
#include "ExchangeOrderKey.h"
#include "IntPrice.h"
#include "MDProducerHandle.h"
#include "lib/core/FMT_IMPL.h"
#include "domain/security_key.h"
#include "lib/domain_model/Security.h"
#include "lib/domain_model/SecurityKey.h"
#include "lib/utils/TimeStamp.h"
#include "system/FMT_IMPL.h"
#include <btree/map.h>
+1 -1
View File
@@ -11,8 +11,8 @@
#include "lib/md/SymbolLoader.h"
#include "lib/utils/SharedList.h"
#include "lib/utils/WaitFreeQueue.h"
#include "lib/utils/bts_chrono.h"
#include "lib/utils/sane_algorithm.h"
#include "system/bts_chrono.h"
#include <algorithm>
#include <btree/map.h>
+1 -3
View File
@@ -1,13 +1,11 @@
#pragma once
#include "lib/utils/bts_export.h"
#include "lib/utils/bts_no_copy.h"
#include "ISyntheticSecurityService.h"
#include "MDConsumerHandle.h"
#include "SecurityPtr.h"
#include "UserSymbol.h"
#include "common.h"
#include "system/export.h"
#include <functional>
#include <google/protobuf/repeated_field.h>
+2 -2
View File
@@ -3,9 +3,9 @@
#include "UserSymbol.h"
#include "lib/md/Shm/MDStructure.h"
#include "lib/sparkproto/SparkProtos.pb.h"
#include "lib/utils/bts_export.h"
#include "lib/utils/bts_no_copy.h"
#include "lib/utils/sane_algorithm.h"
#include "system/export.h"
#include <atomic>
#include <vector>
+4 -5
View File
@@ -1,13 +1,12 @@
#pragma once
#include "lib/utils/bts_export.h"
#include "lib/utils/bts_no_copy.h"
#include "MDProducerChannel.h"
#include "MDProducerHandle.h"
#include "SecurityMapper.h"
#include "Shm/FixedSecurity.h"
#include "common.h"
#include "system/export.h"
#include <memory>
#include <mutex>
#include <vector>
@@ -47,6 +46,8 @@ class BTS_EXPORT MDProducer {
SecurityIDRecorder recorder,
MDProducerFlags flags = DefaultMDProducerFlags);
MDProducer(MDProducer &&other);
MDProducer(const MDProducer &) = delete;
MDProducer &operator=(const MDProducer &) = delete;
~MDProducer();
// A single MDProducer owns a given symbol+type.
@@ -62,8 +63,6 @@ class BTS_EXPORT MDProducer {
void heartbeat();
private:
BTS_NO_COPY(MDProducer);
MDProducerImpl &get_producer(
const char *symbol, SecurityType type, Venue exchange);
+1 -1
View File
@@ -1,7 +1,7 @@
#pragma once
#include "common.h"
#include "lib/utils/bts_export.h"
#include "system/export.h"
namespace bts {
namespace md {
+1 -3
View File
@@ -2,9 +2,8 @@
#include "MDProducerChannel.h"
#include "Shm/MDStructure.h"
#include "lib/utils/bts_export.h"
#include "lib/utils/bts_no_copy.h"
#include "lib/utils/datetime.h"
#include "system/export.h"
#include <tbb/concurrent_queue.h>
#include <vector>
@@ -182,7 +181,6 @@ class BTS_EXPORT MDProducerHandle {
return *_cheader;
}
// COPY OK -- BTS_NO_COPY(MDConsumerHandle);
void *_hdata;
HotHeader *_hheader;
ColdEntry *_cdata;
+1 -1
View File
@@ -1,6 +1,6 @@
#pragma once
#include "lib/core/FMT_IMPL.h"
#include "system/FMT_IMPL.h"
#include <ostream>
#include <sstream>
+1 -1
View File
@@ -6,7 +6,6 @@
#include "lib/api/md/MarketDataReplayConfig.pb.h"
#include "lib/collections/Contains.h"
#include "lib/config/protos/system_config.pb.h"
#include "lib/core/FMT.h"
#include "lib/domain/FutureSecurity.h"
#include "lib/domain/OptionSecurity.h"
#include "lib/domain/Security.h"
@@ -40,6 +39,7 @@
#include "lib/utils/thread_manager.h"
#include "server/sparkd/md/platforms/emumba/EmumbaMain.h"
#include "server/sparkd/md/platforms/mdp3_onixs/MDP3Main.h"
#include "system/FMT.h"
#include <bits/stdint-uintn.h>
#include <boost/filesystem.hpp>
+2 -2
View File
@@ -1,8 +1,8 @@
#pragma once
#ifndef _WIN32
#include "lib/core/FMT_IMPL.h"
#include "lib/core/ValueWrapper.h"
#include "system/FMT_IMPL.h"
#include "system/value_wrapper.h"
namespace bts::md {
Loaded 100 of 355 files, more files were not shown because too many files have changed in this diff. Show more