rippled
Public Types | Public Member Functions | Private Attributes | List of all members
ripple::Resource::Charge Class Reference

A consumption charge. More...

Collaboration diagram for ripple::Resource::Charge:
Collaboration graph
[legend]

Public Types

using value_type = int
 The type used to hold a consumption charge. More...
 

Public Member Functions

 Charge ()=delete
 
 Charge (value_type cost, std::string const &label=std::string())
 Create a charge with the specified cost and name. More...
 
std::string const & label () const
 Return the human readable label associated with the charge. More...
 
value_type cost () const
 Return the cost of the charge in Resource::Manager units. More...
 
std::string to_string () const
 Converts this charge into a human readable string. More...
 
bool operator== (Charge const &) const
 
bool operator!= (Charge const &) const
 

Private Attributes

value_type m_cost
 
std::string m_label
 

Detailed Description

A consumption charge.

Definition at line 30 of file Charge.h.

Member Typedef Documentation

◆ value_type

The type used to hold a consumption charge.

Definition at line 34 of file Charge.h.

Constructor & Destructor Documentation

◆ Charge() [1/2]

ripple::Resource::Charge::Charge ( )
delete

◆ Charge() [2/2]

ripple::Resource::Charge::Charge ( value_type  cost,
std::string const &  label = std::string() 
)

Create a charge with the specified cost and name.

Definition at line 26 of file Charge.cpp.

Member Function Documentation

◆ label()

std::string const & ripple::Resource::Charge::label ( ) const

Return the human readable label associated with the charge.

Definition at line 32 of file Charge.cpp.

◆ cost()

Charge::value_type ripple::Resource::Charge::cost ( ) const

Return the cost of the charge in Resource::Manager units.

Definition at line 38 of file Charge.cpp.

◆ to_string()

std::string ripple::Resource::Charge::to_string ( ) const

Converts this charge into a human readable string.

Definition at line 44 of file Charge.cpp.

◆ operator==()

bool ripple::Resource::Charge::operator== ( Charge const &  c) const

Definition at line 59 of file Charge.cpp.

◆ operator!=()

bool ripple::Resource::Charge::operator!= ( Charge const &  c) const

Definition at line 65 of file Charge.cpp.

Member Data Documentation

◆ m_cost

value_type ripple::Resource::Charge::m_cost
private

Definition at line 60 of file Charge.h.

◆ m_label

std::string ripple::Resource::Charge::m_label
private

Definition at line 61 of file Charge.h.