xrpld
Loading...
Searching...
No Matches
xrpl::Resource::ResourceManager_test::TestLogic Class Reference
Inheritance diagram for xrpl::Resource::ResourceManager_test::TestLogic:
Collaboration diagram for xrpl::Resource::ResourceManager_test::TestLogic:

Public Member Functions

 TestLogic (beast::Journal journal)
void advance ()
TestStopwatchclock ()
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 = boost::base_from_member<TestStopwatch>
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 Logic_test.cpp.

Member Typedef Documentation

◆ clock_type

Definition at line 33 of file Logic_test.cpp.

◆ Imports

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

◆ Table

◆ EntryIntrusiveList

Constructor & Destructor Documentation

◆ TestLogic()

xrpl::Resource::ResourceManager_test::TestLogic::TestLogic ( beast::Journal journal)
explicit

Definition at line 36 of file Logic_test.cpp.

Member Function Documentation

◆ advance()

void xrpl::Resource::ResourceManager_test::TestLogic::advance ( )

Definition at line 42 of file Logic_test.cpp.

◆ clock()

TestStopwatch & xrpl::Resource::ResourceManager_test::TestLogic::clock ( )

Definition at line 48 of file Logic_test.cpp.

◆ newInboundEndpoint()

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

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

◆ newOutboundEndpoint()

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

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

◆ newUnlimitedEndpoint()

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

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 153 of file include/xrpl/resource/detail/Logic.h.

◆ getJson() [1/2]

json::Value xrpl::Resource::Logic::getJson ( )
inherited

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

◆ getJson() [2/2]

json::Value xrpl::Resource::Logic::getJson ( int threshold)
inherited

Returns a json::ValueType::Object.

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

◆ exportConsumers()

Gossip xrpl::Resource::Logic::exportConsumers ( )
inherited

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

◆ importConsumers()

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

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

◆ periodicActivity()

void xrpl::Resource::Logic::periodicActivity ( )
inherited

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

◆ disposition()

Disposition xrpl::Resource::Logic::disposition ( int balance)
staticinherited

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

◆ erase()

void xrpl::Resource::Logic::erase ( Table::iterator iter)
inherited

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

◆ acquire()

void xrpl::Resource::Logic::acquire ( Entry & entry)
inherited

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

◆ release()

void xrpl::Resource::Logic::release ( Entry & entry)
inherited

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

◆ charge()

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

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

◆ warn()

bool xrpl::Resource::Logic::warn ( Entry & entry)
inherited

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

◆ disconnect()

bool xrpl::Resource::Logic::disconnect ( Entry & entry)
inherited

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

◆ balance()

int xrpl::Resource::Logic::balance ( Entry & entry)
inherited

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

◆ writeList()

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

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

◆ onWrite()

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

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

Member Data Documentation

◆ stats_

Stats xrpl::Resource::Logic::stats_
privateinherited

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

◆ clock_

Stopwatch& xrpl::Resource::Logic::clock_
privateinherited

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

◆ journal_

beast::Journal xrpl::Resource::Logic::journal_
privateinherited

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

◆ lock_

std::recursive_mutex xrpl::Resource::Logic::lock_
privateinherited

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

◆ table_

Table xrpl::Resource::Logic::table_
privateinherited

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

◆ inbound_

EntryIntrusiveList xrpl::Resource::Logic::inbound_
privateinherited

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

◆ outbound_

EntryIntrusiveList xrpl::Resource::Logic::outbound_
privateinherited

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

◆ admin_

EntryIntrusiveList xrpl::Resource::Logic::admin_
privateinherited

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

◆ inactive_

EntryIntrusiveList xrpl::Resource::Logic::inactive_
privateinherited

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

◆ importTable_

Imports xrpl::Resource::Logic::importTable_
privateinherited

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