chore: Remove unused fns
Also stop exporting PlatformLoader type since it isn't used outside of cpp
This commit is contained in:
1 parent
d8fc99bca4
commit
48ff593c2e
2 files changed
+1
-49
No files matched your search
@@ -35,48 +35,6 @@ PlatformLoader::PlatformLoader(const md::PlatformConfig &config)
|
||||
|
||||
PlatformLoader::~PlatformLoader() {}
|
||||
|
||||
void cleanup_shared_memory(
|
||||
const std::set<UserSymbol> &symbols, Platform platform) {
|
||||
for (const auto &sym : symbols) {
|
||||
string name =
|
||||
ShmSegmentName::hot_name(sym.symbol(), sym.type(), sym.exchange(), platform);
|
||||
utils::SharedList<int, int>::delete_segments(name);
|
||||
LOG(md, Info, "Cleaned up /run/shm/{}", name);
|
||||
name =
|
||||
ShmSegmentName::cold_name(sym.symbol(), sym.type(), sym.exchange(), platform);
|
||||
utils::SharedList<int, int>::delete_segments(name);
|
||||
LOG(md, Info, "Cleaned up /run/shm/{}", name);
|
||||
}
|
||||
}
|
||||
|
||||
// Does not return
|
||||
void PlatformLoader::run() {
|
||||
// Gather symbols to use
|
||||
set<UserSymbol> symbols;
|
||||
size_t count = get_system_md_symbols(_config, symbols);
|
||||
if (count == 0) {
|
||||
LOG(md, Error, "No Symbols configured for this publisher.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Quickly try to clean the shared memory segments before anyone gets a stale
|
||||
// one
|
||||
cleanup_shared_memory(symbols, _platform);
|
||||
|
||||
switch (_platform) {
|
||||
case PLATFORM_MDP3ONIXS:
|
||||
break;
|
||||
case PLATFORM_MDP3EMUMBA:
|
||||
break;
|
||||
case PLATFORM_ICEONIXS:
|
||||
break;
|
||||
default:
|
||||
bts_assert(false);
|
||||
break;
|
||||
}
|
||||
bts_assert_msg(false, "Market data run should not return");
|
||||
}
|
||||
|
||||
///////////////////////////////
|
||||
size_t get_system_md_symbols(set<UserSymbol> &result) {
|
||||
auto &config = config::get<md::PlatformConfig>();
|
||||
|
||||
@@ -14,14 +14,11 @@
|
||||
namespace bts {
|
||||
namespace md {
|
||||
|
||||
class BTS_EXPORT PlatformLoader {
|
||||
class PlatformLoader {
|
||||
public:
|
||||
PlatformLoader(const md::PlatformConfig &);
|
||||
~PlatformLoader();
|
||||
|
||||
// Does not return
|
||||
void run();
|
||||
|
||||
private:
|
||||
// Some linux assemblies don't have a proper SONAME so we preload them by
|
||||
// path to satisfy imports void preload(Platform);
|
||||
@@ -31,8 +28,5 @@ class BTS_EXPORT PlatformLoader {
|
||||
Platform _platform;
|
||||
};
|
||||
|
||||
BTS_EXPORT void cleanup_shared_memory(
|
||||
const std::set<UserSymbol> &symbols, Platform platform);
|
||||
|
||||
} // namespace md
|
||||
} // namespace bts
|
||||
Reference in new issue
Block a user