Files
spark/src/lib/md/common.cpp
T
John Colvin 884a79e13a refactor: Clean up protobuf files
* Rename files to snake_case (per Google style guide)
  https://developers.google.com/protocol-buffers/docs/style
* Prohibit single line functions in clang-format for proto files
* Run clang-format
2022-02-14 14:01:52 -05:00

45 lines
1.0 KiB
C++

#ifndef NO_CPP0X
#include "common.h"
#include "UserSymbol.h"
#include "lib/config/config.h"
#include "PriceSize.h"
#include "lib/config/protos/market_data.pb.h"
#include <limits>
#include <sstream>
#include <string>
namespace bts {
namespace md {
const double NO_PRICE = std::numeric_limits<double>().quiet_NaN();
const char *SYNTHETIC_SYMBOL = "SYNTHETIC";
std::ostream &operator<<(std::ostream &os, const UserSymbol &sym) {
os << sym.symbol() << "-" << api::SecurityType_Name(sym.type());
return os;
}
} // namespace md
namespace co2 {
using namespace std;
using namespace md;
string topic(
const char *data_type,
const string &symbol,
SecurityType type,
Venue exchange,
Platform platform) {
std::ostringstream topic;
topic << "/md/" << config::get<md::PublisherOptions>().channel_prefix()
<< Platform_Name(platform) << "/" << Venue_Name(exchange) << "/"
<< symbol << "/" << api::SecurityType_Name(type) << "/" << data_type;
return topic.str();
}
} // namespace co2
} // namespace bts
#endif