xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
include
xrpl
resource
Charge.h
1
#pragma once
2
3
#include <
compare
>
4
#include <
ostream
>
5
#include <
string
>
6
7
namespace
xrpl::resource
{
8
12
class
Charge
13
{
14
public
:
18
using
value_type
= int;
19
20
// A default constructed Charge has no way to get a label. Delete
21
Charge
() =
delete
;
22
26
Charge
(
value_type
cost
,
std::string
label
=
std::string
());
27
31
[[nodiscard]]
std::string
const
&
32
label
()
const
;
33
37
[[nodiscard]]
value_type
38
cost
()
const
;
39
43
[[nodiscard]]
std::string
44
toString
()
const
;
45
46
bool
47
operator==
(
Charge
const
&)
const
;
48
49
std::strong_ordering
50
operator<=>
(
Charge
const
&)
const
;
51
52
Charge
53
operator*
(
value_type
m)
const
;
54
55
private
:
56
value_type
cost_
;
57
std::string
label_
;
58
};
59
60
std::ostream
&
61
operator<<
(
std::ostream
& os,
Charge
const
& v);
62
63
}
// namespace xrpl::resource
std::ostream
std::string
xrpl::resource::Charge
A consumption charge.
Definition
Charge.h:13
xrpl::resource::Charge::operator<=>
std::strong_ordering operator<=>(Charge const &) const
Definition
Charge.cpp:49
xrpl::resource::Charge::Charge
Charge()=delete
xrpl::resource::Charge::operator==
bool operator==(Charge const &) const
Definition
Charge.cpp:43
xrpl::resource::Charge::value_type
int value_type
The type used to hold a consumption charge.
Definition
Charge.h:18
xrpl::resource::Charge::label
std::string const & label() const
Return the human readable label associated with the charge.
Definition
Charge.cpp:16
xrpl::resource::Charge::label_
std::string label_
Definition
Charge.h:57
xrpl::resource::Charge::toString
std::string toString() const
Converts this charge into a human readable string.
Definition
Charge.cpp:28
xrpl::resource::Charge::operator*
Charge operator*(value_type m) const
Definition
Charge.cpp:55
xrpl::resource::Charge::cost
value_type cost() const
Return the cost of the charge in resource::Manager units.
Definition
Charge.cpp:22
xrpl::resource::Charge::cost_
value_type cost_
Definition
Charge.h:56
compare
xrpl::resource
Definition
ServiceRegistry.h:21
xrpl::resource::operator<<
std::ostream & operator<<(std::ostream &os, Charge const &v)
Definition
Charge.cpp:36
ostream
string
std::strong_ordering
Generated by
1.17.0