20 #ifndef RIPPLE_PROTOCOL_RATE_H_INCLUDED
21 #define RIPPLE_PROTOCOL_RATE_H_INCLUDED
23 #include <ripple/protocol/STAmount.h>
24 #include <boost/operators.hpp>
37 struct Rate :
private boost::totally_ordered<Rate>
51 return lhs.value == rhs.value;
57 return lhs.value < rhs.value;
68 multiply(STAmount
const& amount, Rate
const& rate);
71 multiplyRound(STAmount
const& amount, Rate
const& rate,
bool roundUp);
75 STAmount
const& amount,
81 divide(STAmount
const& amount, Rate
const& rate);
84 divideRound(STAmount
const& amount, Rate
const& rate,
bool roundUp);
88 STAmount
const& amount,
Represents a transfer rate.
Rate transferFeeAsRate(std::uint16_t fee)
Given a transfer fee (in basis points) convert it to a transfer rate.
STAmount multiplyRound(STAmount const &amount, Rate const &rate, bool roundUp)
STAmount divideRound(STAmount const &amount, Rate const &rate, bool roundUp)
std::ostream & operator<<(std::ostream &os, TOffer< TIn, TOut > const &offer)
const Rate parityRate(QUALITY_ONE)
A transfer rate signifying a 1:1 exchange.
bool operator==(Manifest const &lhs, Manifest const &rhs)
STAmount divide(STAmount const &amount, Rate const &rate)
bool operator<(CanonicalTXSet::Key const &lhs, CanonicalTXSet::Key const &rhs)
STAmount multiply(STAmount const &amount, Rate const &rate)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.