Decentralised Art Server
High-performance C++ backend that exposes HTML interface and a secure REST API for managing Performative Transactions entities
 
Loading...
Searching...
No Matches
events_ingest.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <optional>
5#include <vector>
6
7#include "decoded_event.hpp"
8
9namespace dcn::events
10{
12 {
13 std::int64_t head = 0;
14 std::int64_t safe = 0;
15 std::int64_t finalized = 0;
16 };
17
19 {
20 public:
21 virtual ~IEventSink() = default;
22 virtual void enqueueBatch(std::vector<DecodedEvent> events, std::int64_t next_from_block) = 0;
23 };
24
26 {
27 public:
28 virtual ~IEventDecoder() = default;
29 virtual std::optional<DecodedEvent> decode(const RawChainLog & log) const = 0;
30 };
31
32 class PTEventDecoder final : public IEventDecoder
33 {
34 public:
36
37 std::optional<DecodedEvent> decode(const RawChainLog & log) const override;
38
39 private:
40 std::string _connector_topic;
41 std::string _transformation_topic;
42 std::string _condition_topic;
43 };
44
46 {
47 public:
48 virtual ~IChainEventSource() = default;
49
50 virtual void start() = 0;
51 virtual void stop() = 0;
52 virtual bool running() const = 0;
53 };
54}
Definition events_ingest.hpp:46
virtual bool running() const =0
virtual ~IChainEventSource()=default
Definition events_ingest.hpp:26
virtual std::optional< DecodedEvent > decode(const RawChainLog &log) const =0
virtual ~IEventDecoder()=default
Definition events_ingest.hpp:19
virtual ~IEventSink()=default
virtual void enqueueBatch(std::vector< DecodedEvent > events, std::int64_t next_from_block)=0
Definition events_ingest.hpp:33
std::optional< DecodedEvent > decode(const RawChainLog &log) const override
Definition events_ingest.cpp:18
PTEventDecoder()
Definition events_ingest.cpp:7
Definition decoded_event.hpp:11
Definition events_ingest.hpp:12
std::int64_t finalized
Definition events_ingest.hpp:15
std::int64_t head
Definition events_ingest.hpp:13
std::int64_t safe
Definition events_ingest.hpp:14
Definition decoded_event.hpp:37