xrpld
Loading...
Searching...
No Matches
xrpl::resource::Logic Class Reference

#include <Logic.h>

Inheritance diagram for xrpl::resource::Logic:
Collaboration diagram for xrpl::resource::Logic:

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::ValueType::Object.
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 onWrite (beast::PropertyStream::Map &map)

Static Public Member Functions

static Disposition disposition (int balance)
static void writeList (clock_type::time_point const now, beast::PropertyStream::Set &items, EntryIntrusiveList &list)

Private Types

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

Private Attributes

Stats stats_
Stopwatchclock_
beast::Journal journal_
std::recursive_mutex lock_
Table table_
EntryIntrusiveList inbound_
EntryIntrusiveList outbound_
EntryIntrusiveList admin_
EntryIntrusiveList inactive_
Imports importTable_

Detailed Description

Definition at line 29 of file resource/detail/Logic.h.

Member Typedef Documentation

◆ clock_type

Definition at line 32 of file resource/detail/Logic.h.

◆ Imports

◆ Table

◆ EntryIntrusiveList

Constructor & Destructor Documentation

◆ Logic()

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

Definition at line 79 of file resource/detail/Logic.h.

◆ ~Logic()

xrpl::resource::Logic::~Logic ( )

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

Member Function Documentation

◆ newInboundEndpoint()

Consumer xrpl::resource::Logic::newInboundEndpoint ( beast::ip::Endpoint const & address)

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

◆ newOutboundEndpoint()

Consumer xrpl::resource::Logic::newOutboundEndpoint ( beast::ip::Endpoint const & address)

Definition at line 129 of file resource/detail/Logic.h.

◆ newUnlimitedEndpoint()

Consumer xrpl::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 162 of file resource/detail/Logic.h.

◆ getJson() [1/2]

json::Value xrpl::resource::Logic::getJson ( )

Definition at line 190 of file resource/detail/Logic.h.

◆ getJson() [2/2]

json::Value xrpl::resource::Logic::getJson ( int threshold)

Returns a json::ValueType::Object.

Definition at line 199 of file resource/detail/Logic.h.

◆ exportConsumers()

Gossip xrpl::resource::Logic::exportConsumers ( )

Definition at line 244 of file resource/detail/Logic.h.

◆ importConsumers()

void xrpl::resource::Logic::importConsumers ( std::string const & origin,
Gossip const & gossip )

Definition at line 270 of file resource/detail/Logic.h.

◆ periodicActivity()

void xrpl::resource::Logic::periodicActivity ( )

Definition at line 329 of file resource/detail/Logic.h.

◆ disposition()

Disposition xrpl::resource::Logic::disposition ( int balance)
static

Definition at line 374 of file resource/detail/Logic.h.

◆ erase()

void xrpl::resource::Logic::erase ( Table::iterator iter)

Definition at line 386 of file resource/detail/Logic.h.

◆ acquire()

void xrpl::resource::Logic::acquire ( Entry & entry)

Definition at line 396 of file resource/detail/Logic.h.

◆ release()

void xrpl::resource::Logic::release ( Entry & entry)

Definition at line 403 of file resource/detail/Logic.h.

◆ charge()

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

Definition at line 435 of file resource/detail/Logic.h.

◆ warn()

bool xrpl::resource::Logic::warn ( Entry & entry)

Definition at line 464 of file resource/detail/Logic.h.

◆ disconnect()

bool xrpl::resource::Logic::disconnect ( Entry & entry)

Definition at line 487 of file resource/detail/Logic.h.

◆ balance()

int xrpl::resource::Logic::balance ( Entry & entry)

Definition at line 512 of file resource/detail/Logic.h.

◆ writeList()

void xrpl::resource::Logic::writeList ( clock_type::time_point const now,
beast::PropertyStream::Set & items,
EntryIntrusiveList & list )
static

Definition at line 521 of file resource/detail/Logic.h.

◆ onWrite()

void xrpl::resource::Logic::onWrite ( beast::PropertyStream::Map & map)

Definition at line 539 of file resource/detail/Logic.h.

Member Data Documentation

◆ stats_

Stats xrpl::resource::Logic::stats_
private

Definition at line 49 of file resource/detail/Logic.h.

◆ clock_

Stopwatch& xrpl::resource::Logic::clock_
private

Definition at line 50 of file resource/detail/Logic.h.

◆ journal_

beast::Journal xrpl::resource::Logic::journal_
private

Definition at line 51 of file resource/detail/Logic.h.

◆ lock_

std::recursive_mutex xrpl::resource::Logic::lock_
private

Definition at line 53 of file resource/detail/Logic.h.

◆ table_

Table xrpl::resource::Logic::table_
private

Definition at line 56 of file resource/detail/Logic.h.

◆ inbound_

EntryIntrusiveList xrpl::resource::Logic::inbound_
private

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

◆ outbound_

EntryIntrusiveList xrpl::resource::Logic::outbound_
private

Definition at line 66 of file resource/detail/Logic.h.

◆ admin_

EntryIntrusiveList xrpl::resource::Logic::admin_
private

Definition at line 69 of file resource/detail/Logic.h.

◆ inactive_

EntryIntrusiveList xrpl::resource::Logic::inactive_
private

Definition at line 72 of file resource/detail/Logic.h.

◆ importTable_

Imports xrpl::resource::Logic::importTable_
private

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