Bitcoin Core 29.99.0
P2P Digital Currency
Public Member Functions | Static Public Member Functions | List of all members
FeePerUnit< Tag > Struct Template Reference

Tagged wrapper around FeeFrac to avoid unit confusion. More...

#include <feefrac.h>

Inheritance diagram for FeePerUnit< Tag >:
[legend]
Collaboration diagram for FeePerUnit< Tag >:
[legend]

Public Member Functions

constexpr FeeFrac () noexcept
 Construct an IsEmpty() FeeFrac. More...
 
constexpr FeeFrac (int64_t f, int32_t s) noexcept
 Construct a FeeFrac with specified fee and size. More...
 
constexpr FeeFrac (const FeeFrac &) noexcept=default
 
- Public Member Functions inherited from FeeFrac
constexpr FeeFrac () noexcept
 Construct an IsEmpty() FeeFrac. More...
 
constexpr FeeFrac (int64_t f, int32_t s) noexcept
 Construct a FeeFrac with specified fee and size. More...
 
constexpr FeeFrac (const FeeFrac &) noexcept=default
 
constexpr FeeFracoperator= (const FeeFrac &) noexcept=default
 
bool IsEmpty () const noexcept
 Check if this is empty (size and fee are 0). More...
 
void operator+= (const FeeFrac &other) noexcept
 Add fee and size of another FeeFrac to this one. More...
 
void operator-= (const FeeFrac &other) noexcept
 Subtract fee and size of another FeeFrac from this one. More...
 

Static Public Member Functions

static FeePerUnit FromFeeFrac (const FeeFrac &feefrac) noexcept
 Convert a FeeFrac to a FeePerUnit. More...
 
- Static Public Member Functions inherited from FeeFrac
static std::pair< int64_t, uint32_t > MulFallback (int64_t a, int32_t b) noexcept
 Fallback version for Mul (see below). More...
 

Additional Inherited Members

- Public Attributes inherited from FeeFrac
int64_t fee
 
int32_t size
 
- Static Public Attributes inherited from FeeFrac
static constexpr auto Mul = MulFallback
 

Detailed Description

template<typename Tag>
struct FeePerUnit< Tag >

Tagged wrapper around FeeFrac to avoid unit confusion.

Definition at line 161 of file feefrac.h.

Member Function Documentation

◆ FeeFrac() [1/3]

template<typename Tag >
constexpr FeeFrac::FeeFrac ( )
inlineconstexprnoexcept

Construct an IsEmpty() FeeFrac.

Definition at line 67 of file feefrac.h.

◆ FeeFrac() [2/3]

template<typename Tag >
constexpr FeeFrac::FeeFrac ( const FeeFrac )
inlineconstexprdefaultnoexcept

◆ FeeFrac() [3/3]

template<typename Tag >
constexpr FeeFrac::FeeFrac ( int64_t  f,
int32_t  s 
)
inlineconstexprnoexcept

Construct a FeeFrac with specified fee and size.

Definition at line 70 of file feefrac.h.

◆ FromFeeFrac()

template<typename Tag >
static FeePerUnit FeePerUnit< Tag >::FromFeeFrac ( const FeeFrac feefrac)
inlinestaticnoexcept

Convert a FeeFrac to a FeePerUnit.

Definition at line 167 of file feefrac.h.


The documentation for this struct was generated from the following file: