RTBKit  0.9
Open-source framework to create real-time ad bidding systems.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Types | Public Member Functions | Public Attributes
RTBKIT::BudgetController Struct Reference
Inheritance diagram for RTBKIT::BudgetController:
RTBKIT::NullBudgetController RTBKIT::SlaveBudgetController

List of all members.

Public Types

typedef std::function< void(std::exception_ptr)> OnBudgetResult

Public Member Functions

virtual void addAccount (const AccountKey &account, const OnBudgetResult &onResult)
virtual void addAccountSync (const AccountKey &account)
virtual void topupTransfer (const AccountKey &account, CurrencyPool amount, const OnBudgetResult &onResult)
virtual void topupTransferSync (const AccountKey &account, CurrencyPool amount)
virtual void setBudget (const std::string &topLevelAccount, CurrencyPool amount, const OnBudgetResult &onResult)
virtual void setBudgetSync (const std::string &topLevelAccount, CurrencyPool amount)
virtual void addBudget (const std::string &topLevelAccount, CurrencyPool amount, const OnBudgetResult &onResult)
virtual void addBudgetSync (const std::string &topLevelAccount, CurrencyPool amount)

Public Attributes

CurrencyPool budgetLimits

Detailed Description

Definition at line 117 of file banker.h.


Member Function Documentation

void RTBKIT::BudgetController::addAccount ( const AccountKey account,
const OnBudgetResult &  onResult 
) [virtual]

Add an account to the system. If it already exists, nothing is done.

A newly added account starts with a zero budget.

Reimplemented in RTBKIT::SlaveBudgetController.

Definition at line 41 of file banker.cc.

void RTBKIT::BudgetController::addBudget ( const std::string &  topLevelAccount,
CurrencyPool  amount,
const OnBudgetResult &  onResult 
) [virtual]

Add to the budget for an existing campaign. If the campaign does not exist it is created with an initial amount set to the amount specified

Parameters:
campaignThe campaign whose budget we want to add to
amountThe amount(in micro$) that we want to add to the budget

If the campaign does not exist it will be created

Exceptions:
BankerExceptionwith error to set LOWER_THAN_TRANSFERRED if the amount specified is lower than the amount already spent in the campaign
BankerExceptionwith error to set MAX_EXCEEDED if the amount specified is more than the maximum currently allowed

Reimplemented in RTBKIT::SlaveBudgetController.

Definition at line 120 of file banker.cc.

void RTBKIT::BudgetController::setBudget ( const std::string &  topLevelAccount,
CurrencyPool  amount,
const OnBudgetResult &  onResult 
) [virtual]

Set the budget for a given campaign to the specified amount

Parameters:
campaignThe campaign whose budget we want to set
amountThe amount(in micro$) that we want to set the budget to

If the campaign does not exist it will be created

Exceptions:
BankerExceptionwith error to set LOWER_THAN_TRANSFERRED if the amount specified is lower than the amount already spent in the campaign
BankerExceptionwith error to set MAX_EXCEEDED if the amount specified is more than the maximum currently allowed

Reimplemented in RTBKIT::SlaveBudgetController.

Definition at line 93 of file banker.cc.

void RTBKIT::BudgetController::topupTransfer ( const AccountKey account,
CurrencyPool  amount,
const OnBudgetResult &  onResult 
) [virtual]

The amount here refers to an absolute amount that the strategy should have. This method transfers the appropriate amount so that the strategy ends up with the specified amount

Parameters:
campaignThe campaign to which we want to add our strategy
strategyThe name of the strategy
amountThe amount that the strategy should have after the transfer
Exceptions:
BankerExceptionwith error set to INSUFFICIENT_FUNDS if the amount to transfer exceeds the amount available

Reimplemented in RTBKIT::SlaveBudgetController.

Definition at line 66 of file banker.cc.


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