Skip to content

Instantly share code, notes, and snippets.

@Gocrazy
Created July 17, 2014 02:07
Show Gist options
  • Select an option

  • Save Gocrazy/026d517d52eb4019aa30 to your computer and use it in GitHub Desktop.

Select an option

Save Gocrazy/026d517d52eb4019aa30 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 std::shared_ptr<BidRequest> parseBidRequest(HttpAuctionHandler & handler,
Datacratic::HttpHeader const & header,
std::string const & payload);
virtual double getTimeAvailableMs(HttpAuctionHandler & handler,
const HttpHeader & header,
const std::string & payload);
virtual double getRoundTripTimeMs(HttpAuctionHandler & handler,
const HttpHeader & header);
virtual HttpResponse
getResponse(const HttpAuctionHandler & connection,
const HttpHeader & requestHeader,
const Auction & auction) const;
virtual HttpResponse
getErrorResponse(const HttpAuctionHandler & connection,
const std::string & errorMessage) const;
virtual HttpResponse
getDroppedAuctionResponse(const HttpAuctionHandler & connection,
const std::string & reason) 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