Clio
develop
The XRP Ledger API server.
Theme:
Default
Round
Robot
Toggle main menu visibility
Loading...
Searching...
No Matches
BookChangesFeed.hpp
1
#pragma once
2
3
#include "data/Types.hpp"
4
#include "feed/impl/SingleFeedBase.hpp"
5
#include "
rpc/BookChangesHelper.hpp
"
6
#include "util/async/AnyExecutionContext.hpp"
7
8
#include <boost/asio/io_context.hpp>
9
#include <boost/json/serialize.hpp>
10
#include <xrpl/protocol/LedgerHeader.h>
11
12
#include <vector>
13
14
namespace
feed::impl {
15
22
struct
BookChangesFeed :
public
SingleFeedBase
{
23
BookChangesFeed(
util::async::AnyExecutionContext
& executionCtx)
24
:
SingleFeedBase
(executionCtx,
"book_changes"
)
25
{
26
}
27
33
void
34
pub
(xrpl::LedgerHeader
const
& lgrInfo,
35
std::vector<data::TransactionAndMetadata>
const
& transactions)
36
{
37
SingleFeedBase::pub
(boost::json::serialize(
rpc::computeBookChanges
(lgrInfo, transactions)));
38
}
39
};
40
}
// namespace feed::impl
BookChangesHelper.hpp
feed::impl::SingleFeedBase::pub
void pub(std::string msg)
Publishes the feed in strand.
Definition
SingleFeedBase.cpp:51
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
rpc::computeBookChanges
boost::json::object computeBookChanges(xrpl::LedgerHeader const &lgrInfo, std::vector< data::TransactionAndMetadata > const &transactions)
Computes all book changes for the given ledger header and transactions.
Definition
BookChanges.cpp:72
feed::impl::BookChangesFeed::pub
void pub(xrpl::LedgerHeader const &lgrInfo, std::vector< data::TransactionAndMetadata > const &transactions)
Publishes the book changes.
Definition
BookChangesFeed.hpp:34
src
feed
impl
BookChangesFeed.hpp
Generated by
1.17.0