RTBKit  0.9
Open-source framework to create real-time ad bidding systems.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes
RTBKIT::Auction Struct Reference

#include <auction.h>

List of all members.

Classes

struct  Data
struct  Price
struct  Response

Public Types

enum  WinLoss {
  PENDING, WIN, LOSS, TOOLATE,
  INVALID
}
typedef boost::function< void(std::shared_ptr
< Auction > auction)> 
HandleAuction

Public Member Functions

 Auction (ExchangeConnector *exchangeConnector, HandleAuction handleAuction, std::shared_ptr< BidRequest > request, const std::string &requestStr, const std::string &requestStrFormat, Date start, Date expiry)
double timeAvailable (Date now=Date::now()) const
double timeUsed (Date now=Date::now()) const
bool tooLate ()
WinLoss setResponse (int spotNum, Response newResponse)
void addDataSources (const std::set< std::string > &sources)
const std::set< std::string > & getDataSources () const
std::string status () const
bool setError (const std::string &error, const std::string &details="")
bool finish ()
size_t numSpots () const
Json::Value getResponseJson (int spotNum) const
Json::Value getResponsesJson () const
const std::vector< std::vector
< Response > > & 
getResponses () const
const DatagetCurrentData () const

Public Attributes

bool isZombie
 Auction was externally cancelled.
Date start
Date expiry
Date lossAssumed
Date doneParsing
Date inPrepro
Date outOfPrepro
Date doneAugmenting
Date inStartBidding
Id id
std::shared_ptr< BidRequestrequest
std::string requestStr
 Stringified version of request.
std::string requestStrFormat
 Format of stringified request.
std::string requestSerialized
 Serialized bid request (canonical)
AugmentationList augmentations
 Aggregate aug info for all agents.
AgentAugmentations agentAugmentations
 per agent augmentations.
ExchangeConnectorexchangeConnector
 Exchange connector for auction.
HandleAuction handleAuction
 Callback for when auction is finished.

Static Public Attributes

static const Price NONE
static long long created = 0
 Memory leak tracking.
static long long destroyed = 0

Detailed Description

This is the object that represents an in-flight auction to the router. Agents modify this object in order to set their bids.

Definition at line 39 of file auction.h.


Member Typedef Documentation

typedef boost::function<void (std::shared_ptr<Auction> auction)> RTBKIT::Auction::HandleAuction

Callback that's called once the auction is finished.

Definition at line 43 of file auction.h.


Member Enumeration Documentation

What happened to the bid at the local and global level?

Enumerator:
PENDING 

Bid is pending; unknown if we won or lost.

WIN 

Bid was won.

LOSS 

Bid was lost.

TOOLATE 

Bid was too late and so not accepted.

INVALID 

Bid was invalid and so not accepted.

Definition at line 107 of file auction.h.


Member Function Documentation

void RTBKIT::Auction::addDataSources ( const std::set< std::string > &  sources)

Merges the given data sources used to make the bidding decision with the ones already already present in the auction.

Thread safe.

Definition at line 298 of file auction.cc.

Finish the auction. This will call the auction handler. The return value is true if finish() was actually called, or false if it was previously finished by something else.

Definition at line 333 of file auction.cc.

Return a JSON representation of the response.

Definition at line 428 of file auction.cc.

const std::vector< std::vector< Auction::Response > > & RTBKIT::Auction::getResponses ( ) const

Get the wins, winning first and than any losing bids afterwards. The auction should be over before this is called.

Definition at line 290 of file auction.cc.

Return all responses as JSON.

size_t RTBKIT::Auction::numSpots ( ) const [inline]

How many imp in this auction?

Definition at line 215 of file auction.h.

bool RTBKIT::Auction::setError ( const std::string &  error,
const std::string &  details = "" 
)

Set an error flag on the auction, which will cause the response to reflect this error. Also finishes the auction.

Definition at line 366 of file auction.cc.

Auction::WinLoss RTBKIT::Auction::setResponse ( int  spotNum,
Response  newResponse 
)

Modify the given response. The boolean return code says whether or not this response was accepted (due to it being the maximum-priority response).

Returns the (local) status of the response.

Thread safe.

Definition at line 238 of file auction.cc.

std::string RTBKIT::Auction::status ( ) const

Return a status that can be used for debugging.

Definition at line 406 of file auction.cc.

double RTBKIT::Auction::timeAvailable ( Date  now = Date::now()) const

How much time is still available for the auction (in seconds).

Definition at line 224 of file auction.cc.

double RTBKIT::Auction::timeUsed ( Date  now = Date::now()) const

How much time has been used by the auction (in seconds).

Definition at line 231 of file auction.cc.

If this value is set, then the bid has already been sent of and it's too late to modify the object any more.

Definition at line 399 of file auction.cc.


Member Data Documentation

Price to bid if you don't want to bid

Definition at line 104 of file auction.h.


The documentation for this struct was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator