Files
spark/src/lib/md/common.cpp
T

40 lines
902 B
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";
} // 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