RTBKit
0.9
Open-source framework to create real-time ad bidding systems.
|
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 |
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.
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
campaign | The campaign whose budget we want to add to |
amount | The amount(in micro$) that we want to add to the budget |
If the campaign does not exist it will be created
BankerException | with error to set LOWER_THAN_TRANSFERRED if the amount specified is lower than the amount already spent in the campaign |
BankerException | with error to set MAX_EXCEEDED if the amount specified is more than the maximum currently allowed |
Reimplemented in RTBKIT::SlaveBudgetController.
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
campaign | The campaign whose budget we want to set |
amount | The amount(in micro$) that we want to set the budget to |
If the campaign does not exist it will be created
BankerException | with error to set LOWER_THAN_TRANSFERRED if the amount specified is lower than the amount already spent in the campaign |
BankerException | with error to set MAX_EXCEEDED if the amount specified is more than the maximum currently allowed |
Reimplemented in RTBKIT::SlaveBudgetController.
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
campaign | The campaign to which we want to add our strategy |
strategy | The name of the strategy |
amount | The amount that the strategy should have after the transfer |
BankerException | with error set to INSUFFICIENT_FUNDS if the amount to transfer exceeds the amount available |
Reimplemented in RTBKIT::SlaveBudgetController.