41 lines
1.1 KiB
C++
41 lines
1.1 KiB
C++
#ifndef NO_CPP0X
|
|
#include "common.h"
|
|
#include "UserSymbol.h"
|
|
#include "lib/config/config.h"
|
|
|
|
#include "Structure/PriceSize.h"
|
|
#include "lib/config/protos/MarketData.pb.h"
|
|
|
|
#include <limits>
|
|
#include <string>
|
|
#include <sstream>
|
|
|
|
namespace bts {
|
|
namespace md2 {
|
|
|
|
const double NO_PRICE = std::numeric_limits<double>().quiet_NaN();
|
|
|
|
std::ostream& operator<<(std::ostream& os, const UserSymbol& sym) {
|
|
os << sym.symbol() << "-" << SecurityType::type_Name(sym.type());
|
|
return os;
|
|
}
|
|
}
|
|
|
|
namespace co2 {
|
|
using namespace std;
|
|
using namespace md;
|
|
string topic(const char* data_type, const string& symbol, SecurityType::type type, Exchange::type exchange, Platform::type platform) {
|
|
std::ostringstream topic;
|
|
topic << "/md/" << config::get<md::PublisherOptions>().channel_prefix()
|
|
<< Platform::type_Name(platform) << "/"
|
|
<< Exchange::type_Name(exchange) << "/"
|
|
<< symbol << "/"
|
|
<< SecurityType::type_Name(type) << "/"
|
|
<< data_type;
|
|
return topic.str();
|
|
}
|
|
}
|
|
|
|
}//namespace
|
|
#endif
|