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::Amount Struct Reference
Inheritance diagram for RTBKIT::Amount:
RTBKIT::MicroUSD RTBKIT::MicroUSD_CPM RTBKIT::USD RTBKIT::USD_CPM

List of all members.

Public Member Functions

 Amount (CurrencyCode currencyCode=CurrencyCode::CC_NONE, int64_t value=0)
 Amount (const std::string &currencyStr, int64_t value=0)
bool isZero () const
bool isNonNegative () const
bool isNegative () const
Amount limit (const Amount &other) const
 JML_IMPLEMENT_OPERATOR_BOOL (!isZero())
Amountoperator+= (const Amount &other)
Amount operator+ (const Amount &other) const
Amountoperator-= (const Amount &other)
Amount operator- (const Amount &other) const
bool currencyIsCompatible (const Amount &other) const
void assertCurrencyIsCompatible (const Amount &other) const
bool operator== (const Amount &other) const
bool operator!= (const Amount &other) const
bool operator< (const Amount &other) const
bool operator<= (const Amount &other) const
bool operator> (const Amount &other) const
bool operator>= (const Amount &other) const
Amount operator- () const
std::string getCurrencyStr () const
std::string toString () const
Json::Value toJson () const
void serialize (ML::DB::Store_Writer &store) const
void reconstitute (ML::DB::Store_Reader &store)

Static Public Member Functions

static std::string getCurrencyStr (CurrencyCode currencyCode)
static CurrencyCode parseCurrency (const std::string &currency)
static Amount fromJson (const Json::Value &json)
static Amount parse (const std::string &value)

Public Attributes

int64_t value
CurrencyCode currencyCode

Detailed Description

Definition at line 37 of file currency.h.


Member Function Documentation

Amount RTBKIT::Amount::limit ( const Amount other) const [inline]

Returns the minimum of the two amounts.

Definition at line 57 of file currency.h.

bool RTBKIT::Amount::operator== ( const Amount other) const [inline]

They compare equal if:

  • Both currency code and amount are equal, OR
  • Both is zero (no currency, no amount), OR
  • One is zero with a currency code and one is zero with no code

Definition at line 124 of file currency.h.


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