rippled
Public Member Functions | Static Public Member Functions | Private Types | Private Attributes | List of all members
ripple::Resource::ResourceManager_test::TestLogic Class Reference
Inheritance diagram for ripple::Resource::ResourceManager_test::TestLogic:
Inheritance graph
[legend]
Collaboration diagram for ripple::Resource::ResourceManager_test::TestLogic:
Collaboration graph
[legend]

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. More...
 
Json::Value getJson ()
 
Json::Value getJson (int threshold)
 Returns a Json::objectValue. More...
 
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)
 
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 = boost::base_from_member< TestStopwatch >
 
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 37 of file Logic_test.cpp.

Member Typedef Documentation

◆ clock_type

Definition at line 42 of file Logic_test.cpp.

◆ Imports

Definition at line 44 of file resource/impl/Logic.h.

◆ Table

Definition at line 45 of file resource/impl/Logic.h.

◆ EntryIntrusiveList

Definition at line 46 of file resource/impl/Logic.h.

Constructor & Destructor Documentation

◆ TestLogic()

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

Definition at line 45 of file Logic_test.cpp.

Member Function Documentation

◆ advance()

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

Definition at line 51 of file Logic_test.cpp.

◆ clock()

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

Definition at line 57 of file Logic_test.cpp.

◆ newInboundEndpoint()

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

Definition at line 110 of file resource/impl/Logic.h.

◆ newOutboundEndpoint()

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

Definition at line 140 of file resource/impl/Logic.h.

◆ newUnlimitedEndpoint()

Consumer ripple::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 173 of file resource/impl/Logic.h.

◆ getJson() [1/2]

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

Definition at line 201 of file resource/impl/Logic.h.

◆ getJson() [2/2]

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

Returns a Json::objectValue.

Definition at line 208 of file resource/impl/Logic.h.

◆ exportConsumers()

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

Definition at line 256 of file resource/impl/Logic.h.

◆ importConsumers()

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

Definition at line 282 of file resource/impl/Logic.h.

◆ periodicActivity()

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

Definition at line 342 of file resource/impl/Logic.h.

◆ disposition()

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

Definition at line 388 of file resource/impl/Logic.h.

◆ erase()

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

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

◆ acquire()

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

Definition at line 410 of file resource/impl/Logic.h.

◆ release()

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

Definition at line 417 of file resource/impl/Logic.h.

◆ charge()

Disposition ripple::Resource::Logic::charge ( Entry entry,
Charge const &  fee 
)
inherited

Definition at line 445 of file resource/impl/Logic.h.

◆ warn()

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

Definition at line 455 of file resource/impl/Logic.h.

◆ disconnect()

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

Definition at line 479 of file resource/impl/Logic.h.

◆ balance()

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

Definition at line 505 of file resource/impl/Logic.h.

◆ writeList()

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

Definition at line 514 of file resource/impl/Logic.h.

◆ onWrite()

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

Definition at line 532 of file resource/impl/Logic.h.

Member Data Documentation

◆ m_stats

Stats ripple::Resource::Logic::m_stats
privateinherited

Definition at line 60 of file resource/impl/Logic.h.

◆ m_clock

Stopwatch& ripple::Resource::Logic::m_clock
privateinherited

Definition at line 61 of file resource/impl/Logic.h.

◆ m_journal

beast::Journal ripple::Resource::Logic::m_journal
privateinherited

Definition at line 62 of file resource/impl/Logic.h.

◆ lock_

std::recursive_mutex ripple::Resource::Logic::lock_
privateinherited

Definition at line 64 of file resource/impl/Logic.h.

◆ table_

Table ripple::Resource::Logic::table_
privateinherited

Definition at line 67 of file resource/impl/Logic.h.

◆ inbound_

EntryIntrusiveList ripple::Resource::Logic::inbound_
privateinherited

Definition at line 74 of file resource/impl/Logic.h.

◆ outbound_

EntryIntrusiveList ripple::Resource::Logic::outbound_
privateinherited

Definition at line 77 of file resource/impl/Logic.h.

◆ admin_

EntryIntrusiveList ripple::Resource::Logic::admin_
privateinherited

Definition at line 80 of file resource/impl/Logic.h.

◆ inactive_

EntryIntrusiveList ripple::Resource::Logic::inactive_
privateinherited

Definition at line 83 of file resource/impl/Logic.h.

◆ importTable_

Imports ripple::Resource::Logic::importTable_
privateinherited

Definition at line 86 of file resource/impl/Logic.h.