Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
Core.hpp
1//------------------------------------------------------------------------------
2/*
3 This file is part of clio: https://github.com/XRPLF/clio
4 Copyright (c) 2025, the clio developers.
5
6 Permission to use, copy, modify, and distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18//==============================================================================
19
20#pragma once
21
22#include "data/BackendInterface.hpp"
23#include "etlng/Models.hpp"
24#include "util/log/Logger.hpp"
25
26#include <xrpl/basics/base_uint.h>
27
28#include <cstdint>
29#include <memory>
30
31namespace etlng::impl {
32
33class CoreExt {
34 std::shared_ptr<BackendInterface> backend_;
35
36 util::Logger log_{"ETL"};
37
38public:
39 CoreExt(std::shared_ptr<BackendInterface> backend);
40
41 void
42 onLedgerData(model::LedgerData const& data) const;
43
44 void
45 onInitialData(model::LedgerData const& data) const;
46
47 void
48 onInitialObject(uint32_t seq, model::Object const& obj) const;
49
50 void
51 onObject(uint32_t seq, model::Object const& obj) const;
52
53private:
54 void
55 insertTransactions(model::LedgerData const& data) const;
56};
57
58} // namespace etlng::impl
Definition Core.hpp:33
A simple thread-safe logger for the channel specified in the constructor.
Definition Logger.hpp:111
This namespace implements the data access layer and related components.
Definition AmendmentCenter.cpp:70
Represents an entire ledger diff worth of transactions and objects.
Definition Models.hpp:143
Represents a single object on the ledger.
Definition Models.hpp:105