xrpld
Loading...
Searching...
No Matches
xrpl::test::Validator Class Reference

Simulate Validator. More...

Collaboration diagram for xrpl::test::Validator:

Public Member Functions

 Validator ()
 Validator (Validator const &)=default
 Validator (Validator &&)=default
Validatoroperator= (Validator const &)=default
Validatoroperator= (Validator &&)=default
 ~Validator ()
void clear ()
PublicKey const & key ()
 operator PublicKey () const
void addPeer (PeerSPtr peer)
void deletePeer (Peer::id_t id)
void forLinks (std::vector< Peer::id_t > peers, LinkIterCB f)
void forLinks (LinkIterCB f, bool simulateSlow=false)
void send (std::vector< Peer::id_t > peers, SquelchCB f)
 Send to specific peers.
void send (SquelchCB f)
 Send to all peers.
MessageSPtr message ()
std::uint16_t id () const
void linkUp (Peer::id_t id)
void linkDown (Peer::id_t id)

Static Public Member Functions

static void resetId ()

Private Types

using Links = std::unordered_map<Peer::id_t, LinkSPtr>

Private Attributes

Links links_
PublicKey pkey_
MessageSPtr message_ = nullptr
std::uint16_t id_ = 0

Static Private Attributes

static std::uint16_t sid = 0

Detailed Description

Simulate Validator.

Definition at line 321 of file reduce_relay_test.cpp.

Member Typedef Documentation

◆ Links

Constructor & Destructor Documentation

◆ Validator() [1/3]

xrpl::test::Validator::Validator ( )

Definition at line 326 of file reduce_relay_test.cpp.

◆ Validator() [2/3]

xrpl::test::Validator::Validator ( Validator const & )
default

◆ Validator() [3/3]

xrpl::test::Validator::Validator ( Validator && )
default

◆ ~Validator()

xrpl::test::Validator::~Validator ( )

Definition at line 339 of file reduce_relay_test.cpp.

Member Function Documentation

◆ operator=() [1/2]

Validator & xrpl::test::Validator::operator= ( Validator const & )
default

◆ operator=() [2/2]

Validator & xrpl::test::Validator::operator= ( Validator && )
default

◆ clear()

void xrpl::test::Validator::clear ( )

Definition at line 345 of file reduce_relay_test.cpp.

◆ resetId()

void xrpl::test::Validator::resetId ( )
static

Definition at line 351 of file reduce_relay_test.cpp.

◆ key()

PublicKey const & xrpl::test::Validator::key ( )

Definition at line 357 of file reduce_relay_test.cpp.

◆ operator PublicKey()

xrpl::test::Validator::operator PublicKey ( ) const

Definition at line 362 of file reduce_relay_test.cpp.

◆ addPeer()

void xrpl::test::Validator::addPeer ( PeerSPtr peer)

Definition at line 368 of file reduce_relay_test.cpp.

◆ deletePeer()

void xrpl::test::Validator::deletePeer ( Peer::id_t id)

Definition at line 374 of file reduce_relay_test.cpp.

◆ forLinks() [1/2]

void xrpl::test::Validator::forLinks ( std::vector< Peer::id_t > peers,
LinkIterCB f )

Definition at line 380 of file reduce_relay_test.cpp.

◆ forLinks() [2/2]

void xrpl::test::Validator::forLinks ( LinkIterCB f,
bool simulateSlow = false )

Definition at line 390 of file reduce_relay_test.cpp.

◆ send() [1/2]

void xrpl::test::Validator::send ( std::vector< Peer::id_t > peers,
SquelchCB f )

Send to specific peers.

Definition at line 406 of file reduce_relay_test.cpp.

◆ send() [2/2]

void xrpl::test::Validator::send ( SquelchCB f)

Send to all peers.

Definition at line 413 of file reduce_relay_test.cpp.

◆ message()

MessageSPtr xrpl::test::Validator::message ( )

Definition at line 419 of file reduce_relay_test.cpp.

◆ id()

std::uint16_t xrpl::test::Validator::id ( ) const
nodiscard

Definition at line 425 of file reduce_relay_test.cpp.

◆ linkUp()

void xrpl::test::Validator::linkUp ( Peer::id_t id)

Definition at line 431 of file reduce_relay_test.cpp.

◆ linkDown()

void xrpl::test::Validator::linkDown ( Peer::id_t id)

Definition at line 439 of file reduce_relay_test.cpp.

Member Data Documentation

◆ links_

Links xrpl::test::Validator::links_
private

Definition at line 447 of file reduce_relay_test.cpp.

◆ pkey_

PublicKey xrpl::test::Validator::pkey_
private

Definition at line 448 of file reduce_relay_test.cpp.

◆ message_

MessageSPtr xrpl::test::Validator::message_ = nullptr
private

Definition at line 449 of file reduce_relay_test.cpp.

◆ sid

std::uint16_t xrpl::test::Validator::sid = 0
staticprivate

Definition at line 450 of file reduce_relay_test.cpp.

◆ id_

std::uint16_t xrpl::test::Validator::id_ = 0
private

Definition at line 451 of file reduce_relay_test.cpp.