Clio
develop
The XRP Ledger API server.
Theme:
Default
Round
Robot
Toggle main menu visibility
Loading...
Searching...
No Matches
LedgerFeed.hpp
1
#pragma once
2
3
#include "data/BackendInterface.hpp"
4
#include "feed/Types.hpp"
5
#include "feed/impl/SingleFeedBase.hpp"
6
#include "util/async/AnyExecutionContext.hpp"
7
8
#include <boost/asio/io_context.hpp>
9
#include <boost/asio/spawn.hpp>
10
#include <boost/json/object.hpp>
11
#include <boost/json/serialize.hpp>
12
#include <xrpl/protocol/Fees.h>
13
#include <xrpl/protocol/LedgerHeader.h>
14
15
#include <cstdint>
16
#include <memory>
17
#include <string>
18
19
namespace
feed::impl {
20
28
class
LedgerFeed
:
public
SingleFeedBase
{
29
public
:
34
LedgerFeed
(
util::async::AnyExecutionContext
& executionCtx)
35
:
SingleFeedBase
(executionCtx,
"ledger"
)
36
{
37
}
38
47
boost::json::object
48
sub
(boost::asio::yield_context yield,
49
std::shared_ptr<data::BackendInterface const>
const
& backend,
50
SubscriberSharedPtr
const
& subscriber,
51
uint32_t networkID);
52
61
void
62
pub
(xrpl::LedgerHeader
const
& lgrInfo,
63
xrpl::Fees
const
& fees,
64
std::string
const
& ledgerRange,
65
uint32_t txnCount,
66
uint32_t networkID);
67
68
private
:
69
static
boost::json::object
70
makeLedgerPubMessage(
71
xrpl::LedgerHeader
const
& lgrInfo,
72
xrpl::Fees
const
& fees,
73
std::string
const
& ledgerRange,
74
uint32_t txnCount,
75
uint32_t networkID
76
);
77
};
78
}
// namespace feed::impl
feed::impl::LedgerFeed::LedgerFeed
LedgerFeed(util::async::AnyExecutionContext &executionCtx)
Construct a new Ledger Feed object.
Definition
LedgerFeed.hpp:34
feed::impl::LedgerFeed::pub
void pub(xrpl::LedgerHeader const &lgrInfo, xrpl::Fees const &fees, std::string const &ledgerRange, uint32_t txnCount, uint32_t networkID)
Publishes the ledger feed.
Definition
LedgerFeed.cpp:82
feed::impl::LedgerFeed::sub
boost::json::object sub(boost::asio::yield_context yield, std::shared_ptr< data::BackendInterface const > const &backend, SubscriberSharedPtr const &subscriber, uint32_t networkID)
Subscribe the ledger feed.
Definition
LedgerFeed.cpp:47
feed::impl::SingleFeedBase::SingleFeedBase
SingleFeedBase(util::async::AnyExecutionContext &executionCtx, std::string const &name)
Construct a new Single Feed Base object.
Definition
SingleFeedBase.cpp:16
util::async::AnyExecutionContext
A type-erased execution context.
Definition
AnyExecutionContext.hpp:23
feed::SubscriberSharedPtr
std::shared_ptr< Subscriber > SubscriberSharedPtr
Shared ownership pointer to a subscriber.
Definition
Types.hpp:22
src
feed
impl
LedgerFeed.hpp
Generated by
1.17.0