rippled
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Attributes | List of all members
ripple::Resource::Logic Class Reference

#include <Logic.h>

Inheritance diagram for ripple::Resource::Logic:
Inheritance graph
[legend]
Collaboration diagram for ripple::Resource::Logic:
Collaboration graph
[legend]

Classes

struct  Stats
 

Public Member Functions

 Logic (beast::insight::Collector::ptr const &collector, clock_type &clock, beast::Journal journal)
 
 ~Logic ()
 
Consumer newInboundEndpoint (beast::IP::Endpoint const &address)
 
Consumer newOutboundEndpoint (beast::IP::Endpoint const &address)
 
Consumer newUnlimitedEndpoint (beast::IP::Endpoint const &address)
 Create endpoint that should not have resource limits applied.
 
Json::Value getJson ()
 
Json::Value getJson (int threshold)
 Returns a Json::objectValue.
 
Gossip exportConsumers ()
 
void importConsumers (std::string const &origin, Gossip const &gossip)
 
void periodicActivity ()
 
void erase (Table::iterator iter)
 
void acquire (Entry &entry)
 
void release (Entry &entry)
 
Disposition charge (Entry &entry, Charge const &fee, std::string context={})
 
bool warn (Entry &entry)
 
bool disconnect (Entry &entry)
 
int balance (Entry &entry)
 
void writeList (clock_type::time_point const now, beast::PropertyStream::Set &items, EntryIntrusiveList &list)
 
void onWrite (beast::PropertyStream::Map &map)
 

Static Public Member Functions

static Disposition disposition (int balance)
 

Private Types

using clock_type = Stopwatch
 
using Imports = hash_map< std::string, Import >
 
using Table = hash_map< Key, Entry, Key::hasher, Key::key_equal >
 
using EntryIntrusiveList = beast::List< Entry >
 

Private Attributes

Stats m_stats
 
Stopwatchm_clock
 
beast::Journal m_journal
 
std::recursive_mutex lock_
 
Table table_
 
EntryIntrusiveList inbound_
 
EntryIntrusiveList outbound_
 
EntryIntrusiveList admin_
 
EntryIntrusiveList inactive_
 
Imports importTable_
 

Detailed Description

Definition at line 41 of file include/xrpl/resource/detail/Logic.h.

Member Typedef Documentation

◆ clock_type

Definition at line 44 of file include/xrpl/resource/detail/Logic.h.

◆ Imports

Definition at line 45 of file include/xrpl/resource/detail/Logic.h.

◆ Table

Definition at line 46 of file include/xrpl/resource/detail/Logic.h.

◆ EntryIntrusiveList

Definition at line 47 of file include/xrpl/resource/detail/Logic.h.

Constructor & Destructor Documentation

◆ Logic()

ripple::Resource::Logic::Logic ( beast::insight::Collector::ptr const &  collector,
clock_type clock,
beast::Journal  journal 
)

Definition at line 91 of file include/xrpl/resource/detail/Logic.h.

◆ ~Logic()

ripple::Resource::Logic::~Logic ( )

Definition at line 99 of file include/xrpl/resource/detail/Logic.h.

Member Function Documentation

◆ newInboundEndpoint()

Consumer ripple::Resource::Logic::newInboundEndpoint ( beast::IP::Endpoint const &  address)

Definition at line 111 of file include/xrpl/resource/detail/Logic.h.

◆ newOutboundEndpoint()

Consumer ripple::Resource::Logic::newOutboundEndpoint ( beast::IP::Endpoint const &  address)

Definition at line 141 of file include/xrpl/resource/detail/Logic.h.

◆ newUnlimitedEndpoint()

Consumer ripple::Resource::Logic::newUnlimitedEndpoint ( beast::IP::Endpoint const &  address)

Create endpoint that should not have resource limits applied.

Other restrictions, such as permission to perform certain RPC calls, may be enabled.

Definition at line 174 of file include/xrpl/resource/detail/Logic.h.

◆ getJson() [1/2]

Json::Value ripple::Resource::Logic::getJson ( )

Definition at line 202 of file include/xrpl/resource/detail/Logic.h.

◆ getJson() [2/2]

Json::Value ripple::Resource::Logic::getJson ( int  threshold)

Returns a Json::objectValue.

Definition at line 209 of file include/xrpl/resource/detail/Logic.h.

◆ exportConsumers()

Gossip ripple::Resource::Logic::exportConsumers ( )

Definition at line 257 of file include/xrpl/resource/detail/Logic.h.

◆ importConsumers()

void ripple::Resource::Logic::importConsumers ( std::string const &  origin,
Gossip const &  gossip 
)

Definition at line 283 of file include/xrpl/resource/detail/Logic.h.

◆ periodicActivity()

void ripple::Resource::Logic::periodicActivity ( )

Definition at line 343 of file include/xrpl/resource/detail/Logic.h.

◆ disposition()

static Disposition ripple::Resource::Logic::disposition ( int  balance)
static

Definition at line 389 of file include/xrpl/resource/detail/Logic.h.

◆ erase()

void ripple::Resource::Logic::erase ( Table::iterator  iter)

Definition at line 401 of file include/xrpl/resource/detail/Logic.h.

◆ acquire()

void ripple::Resource::Logic::acquire ( Entry entry)

Definition at line 413 of file include/xrpl/resource/detail/Logic.h.

◆ release()

void ripple::Resource::Logic::release ( Entry entry)

Definition at line 420 of file include/xrpl/resource/detail/Logic.h.

◆ charge()

Disposition ripple::Resource::Logic::charge ( Entry entry,
Charge const &  fee,
std::string  context = {} 
)

Definition at line 450 of file include/xrpl/resource/detail/Logic.h.

◆ warn()

bool ripple::Resource::Logic::warn ( Entry entry)

Definition at line 482 of file include/xrpl/resource/detail/Logic.h.

◆ disconnect()

bool ripple::Resource::Logic::disconnect ( Entry entry)

Definition at line 506 of file include/xrpl/resource/detail/Logic.h.

◆ balance()

int ripple::Resource::Logic::balance ( Entry entry)

Definition at line 532 of file include/xrpl/resource/detail/Logic.h.

◆ writeList()

void ripple::Resource::Logic::writeList ( clock_type::time_point const  now,
beast::PropertyStream::Set items,
EntryIntrusiveList list 
)

Definition at line 541 of file include/xrpl/resource/detail/Logic.h.

◆ onWrite()

void ripple::Resource::Logic::onWrite ( beast::PropertyStream::Map map)

Definition at line 559 of file include/xrpl/resource/detail/Logic.h.

Member Data Documentation

◆ m_stats

Stats ripple::Resource::Logic::m_stats
private

Definition at line 61 of file include/xrpl/resource/detail/Logic.h.

◆ m_clock

Stopwatch& ripple::Resource::Logic::m_clock
private

Definition at line 62 of file include/xrpl/resource/detail/Logic.h.

◆ m_journal

beast::Journal ripple::Resource::Logic::m_journal
private

Definition at line 63 of file include/xrpl/resource/detail/Logic.h.

◆ lock_

std::recursive_mutex ripple::Resource::Logic::lock_
private

Definition at line 65 of file include/xrpl/resource/detail/Logic.h.

◆ table_

Table ripple::Resource::Logic::table_
private

Definition at line 68 of file include/xrpl/resource/detail/Logic.h.

◆ inbound_

EntryIntrusiveList ripple::Resource::Logic::inbound_
private

Definition at line 75 of file include/xrpl/resource/detail/Logic.h.

◆ outbound_

EntryIntrusiveList ripple::Resource::Logic::outbound_
private

Definition at line 78 of file include/xrpl/resource/detail/Logic.h.

◆ admin_

EntryIntrusiveList ripple::Resource::Logic::admin_
private

Definition at line 81 of file include/xrpl/resource/detail/Logic.h.

◆ inactive_

EntryIntrusiveList ripple::Resource::Logic::inactive_
private

Definition at line 84 of file include/xrpl/resource/detail/Logic.h.

◆ importTable_

Imports ripple::Resource::Logic::importTable_
private

Definition at line 87 of file include/xrpl/resource/detail/Logic.h.