Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chinnurtb/10076120 to your computer and use it in GitHub Desktop.
Save chinnurtb/10076120 to your computer and use it in GitHub Desktop.
#pragma once
#include "rtbkit/plugins/exchange/http_exchange_connector.h"
namespace RTBKIT {
struct SmaatoExchangeConnector : public HttpExchangeConnector {
SmaatoExchangeConnector(ServiceBase & owner, const std::string & name);
SmaatoExchangeConnector(const std::string & name,
std::shared_ptr<ServiceProxies> proxies);
static std::string exchangeNameString() {
return "smaato";
}
virtual std::string exchangeName() const {
return exchangeNameString();
}
/*virtual double
getTimeAvailableMs(HttpAuctionHandler & connection,
const HttpHeader & header,
const std::string & payload);
*/
double getTimeAvailableMs(HttpAuctionHandler & handler,
const HttpHeader & header,
const std::string & payload) {
return 35.0;
}
double getRoundTripTimeMs(HttpAuctionHandler & handler,
const HttpHeader & header) {
return 5.0;
}
virtual std::shared_ptr<BidRequest>
parseBidRequest(HttpAuctionHandler & connection,
const HttpHeader & header,
const std::string & payload);
virtual HttpResponse
getResponse(const HttpAuctionHandler & connection,
const HttpHeader & requestHeader,
const Auction & auction) const;
virtual ExchangeConnector::ExchangeCompatibility
getCampaignCompatibility(const AgentConfig & config,
bool includeReasons) const;
virtual ExchangeCompatibility
getCreativeCompatibility(const Creative & creative, bool includeReasons) const;
struct CampaignInfo {
Id seat; ///< ID of the exchange seat
};
struct CreativeInfo {
Id adid; ///< ID for ad to be service if bid wins
std::string adm; ///< Actual XHTML ad markup
std::string nurl; ///< Win notice URL
};
private:
virtual void setSeatBid(Auction const & auction,
int spotNum,
OpenRTB::BidResponse & response) const;
};
} // namespace RTBKit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment