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

#include <account.h>

Inheritance diagram for RTBKIT::Account:

List of all members.

Public Member Functions

bool isSameOrPastVersion (const Account &otherAccount) const
Json::Value toJson () const
CurrencyPool getRecycledAvail () const
CurrencyPool getBudget () const
CurrencyPool getNetBudget () const
void checkInvariants (const char *whereFrom="") const
CurrencyPool recuperate ()
void recycle (const CurrencyPool &recuperated)
void setBudget (const CurrencyPool &newBudget)
CurrencyPool setBalance (Account &parentAccount, const CurrencyPool &newBalance)
CurrencyPool importSpend (const CurrencyPool &spend)
void recuperateTo (Account &parentAccount)

Static Public Member Functions

static const Account fromJson (const Json::Value &json)

Public Attributes

AccountType type
CurrencyPool budgetIncreases
 Transferred in from parent.
CurrencyPool budgetDecreases
 Transferred out (in parent only)
CurrencyPool recycledIn
 Unspent transferred back in.
CurrencyPool allocatedIn
CurrencyPool commitmentsRetired
 Money not spent.
CurrencyPool adjustmentsIn
 Money transferred in by adjustments.
CurrencyPool recycledOut
CurrencyPool allocatedOut
CurrencyPool commitmentsMade
CurrencyPool adjustmentsOut
 Money transferred out by adjustments.
CurrencyPool spent
 Actually spent.
CurrencyPool balance
 Balance to be spent.
LineItems lineItems
 Spent line items.
LineItems adjustmentLineItems
 Adjustment line items.

Detailed Description

This is the basic unit in which spend is tracked.

Definition at line 69 of file account.h.

Member Function Documentation

Returns the budget what was not transferred from or to other accounts.

Definition at line 112 of file account.cc.

Return the amount which is balance to be recycled.

Definition at line 199 of file account.h.

(migration helper) Register an expense on a AT_SPEND account.

Definition at line 79 of file account.cc.

Recuperate everything that can safely be removed from the account, and return the amount freed.

Definition at line 260 of file account.h.

void RTBKIT::Account::recycle ( const CurrencyPool recuperated) [inline]

Take some budget that had been recuperated from somewhere else and add it in.

Definition at line 274 of file account.h.

CurrencyPool RTBKIT::Account::setBalance ( Account parentAccount,
const CurrencyPool newBalance 
) [inline]

Set the balance budget to the given level. This can either transfer money out of or into the account.

Definition at line 293 of file account.h.

void RTBKIT::Account::setBudget ( const CurrencyPool newBudget)

Set the budget to the given amount. It will adjust the balance amount to match the new level.

Definition at line 52 of file account.cc.

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