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

An endpoint that consumes resources. More...

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

Public Member Functions

 Consumer ()
 
 ~Consumer ()
 
 Consumer (Consumer const &other)
 
Consumeroperator= (Consumer const &other)
 
std::string to_string () const
 Return a human readable string uniquely identifying this consumer. More...
 
bool isUnlimited () const
 Returns true if this is a privileged endpoint. More...
 
void elevate (std::string const &name)
 Raise the Consumer's privilege level to a Named endpoint. More...
 
Disposition disposition () const
 Returns the current disposition of this consumer. More...
 
Disposition charge (Charge const &fee)
 Apply a load charge to the consumer. More...
 
bool warn ()
 Returns true if the consumer should be warned. More...
 
bool disconnect (beast::Journal const &j)
 Returns true if the consumer should be disconnected. More...
 
int balance ()
 Returns the credit balance representing consumption. More...
 
Entryentry ()
 

Private Member Functions

 Consumer (Logic &logic, Entry &entry)
 

Private Attributes

Logicm_logic
 
Entrym_entry
 

Friends

class Logic
 

Detailed Description

An endpoint that consumes resources.

Definition at line 34 of file Consumer.h.

Constructor & Destructor Documentation

◆ Consumer() [1/3]

ripple::Resource::Consumer::Consumer ( Logic logic,
Entry entry 
)
private

Definition at line 28 of file Consumer.cpp.

◆ Consumer() [2/3]

ripple::Resource::Consumer::Consumer ( )

Definition at line 33 of file Consumer.cpp.

◆ ~Consumer()

ripple::Resource::Consumer::~Consumer ( )

Definition at line 47 of file Consumer.cpp.

◆ Consumer() [3/3]

ripple::Resource::Consumer::Consumer ( Consumer const &  other)

Definition at line 37 of file Consumer.cpp.

Member Function Documentation

◆ operator=()

Consumer & ripple::Resource::Consumer::operator= ( Consumer const &  other)

Definition at line 54 of file Consumer.cpp.

◆ to_string()

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

Return a human readable string uniquely identifying this consumer.

Definition at line 71 of file Consumer.cpp.

◆ isUnlimited()

bool ripple::Resource::Consumer::isUnlimited ( ) const

Returns true if this is a privileged endpoint.

Definition at line 80 of file Consumer.cpp.

◆ elevate()

void ripple::Resource::Consumer::elevate ( std::string const &  name)

Raise the Consumer's privilege level to a Named endpoint.

The reference to the original endpoint descriptor is released.

◆ disposition()

Disposition ripple::Resource::Consumer::disposition ( ) const

Returns the current disposition of this consumer.

This should be checked upon creation to determine if the consumer should be disconnected immediately.

Definition at line 89 of file Consumer.cpp.

◆ charge()

Disposition ripple::Resource::Consumer::charge ( Charge const &  fee)

Apply a load charge to the consumer.

Definition at line 99 of file Consumer.cpp.

◆ warn()

bool ripple::Resource::Consumer::warn ( )

Returns true if the consumer should be warned.

This consumes the warning.

Definition at line 110 of file Consumer.cpp.

◆ disconnect()

bool ripple::Resource::Consumer::disconnect ( beast::Journal const &  j)

Returns true if the consumer should be disconnected.

Definition at line 117 of file Consumer.cpp.

◆ balance()

int ripple::Resource::Consumer::balance ( )

Returns the credit balance representing consumption.

Definition at line 129 of file Consumer.cpp.

◆ entry()

Entry & ripple::Resource::Consumer::entry ( )

Definition at line 136 of file Consumer.cpp.

Friends And Related Function Documentation

◆ Logic

friend class Logic
friend

Definition at line 37 of file Consumer.h.

Member Data Documentation

◆ m_logic

Logic* ripple::Resource::Consumer::m_logic
private

Definition at line 91 of file Consumer.h.

◆ m_entry

Entry* ripple::Resource::Consumer::m_entry
private

Definition at line 92 of file Consumer.h.