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, ClockType &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 (ClockType::time_point const now, beast::PropertyStream::Set &items, EntryIntrusiveList &list)

Private Types

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

Private Attributes

Stats stats_
Stopwatch & clock_
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

◆ ClockType

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

◆ Imports

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

◆ Table

◆ EntryIntrusiveList

Constructor & Destructor Documentation

◆ Logic()

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

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

◆ ~Logic()

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

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

Member Function Documentation

◆ newInboundEndpoint()

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

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

◆ newOutboundEndpoint()

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

Definition at line 126 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 159 of file resource/detail/Logic.h.

◆ getJson() [1/2]

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

Definition at line 187 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 196 of file resource/detail/Logic.h.

◆ exportConsumers()

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

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

◆ importConsumers()

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

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

◆ periodicActivity()

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

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

◆ disposition()

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

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

◆ erase()

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

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

◆ acquire()

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

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

◆ release()

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

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

◆ charge()

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

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

◆ warn()

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

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

◆ disconnect()

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

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

◆ balance()

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

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

◆ writeList()

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

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

◆ onWrite()

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

Definition at line 536 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.