Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
common.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <fc/utility.hpp>
4#include <tuple>
6
7namespace sysio::trace_api {
14
18 class yield_exception : public std::runtime_error {
19 public:
20 explicit yield_exception(const char* what_arg)
21 :std::runtime_error(what_arg)
22 {}
23
24 explicit yield_exception(const std::string& what_arg)
25 :std::runtime_error(what_arg)
26 {}
27 };
28
29 class bad_data_exception : public std::runtime_error {
30 public:
31 explicit bad_data_exception(const char* what_arg)
32 :std::runtime_error(what_arg)
33 {}
34
35 explicit bad_data_exception(const std::string& what_arg)
36 :std::runtime_error(what_arg)
37 {}
38 };
39
40 using exception_with_context = std::tuple<const std::exception_ptr&, char const *, uint64_t, char const *>;
42
43 using log_handler = fc::optional_delegate<void(const std::string&)>;
44
45 struct block_trace_v0;
46 struct block_trace_v1;
47 struct block_trace_v2;
48 // optional block trace and irreversibility paired data
49 using get_block_t = std::optional<std::tuple<data_log_entry, bool>>;
50
51 using get_block_n = std::optional<uint32_t>;
56#define MAKE_EXCEPTION_WITH_CONTEXT(eptr) \
57 (sysio::trace_api::exception_with_context((eptr), __FILE__, __LINE__, __func__))
58
59
60}
bad_data_exception(const char *what_arg)
Definition common.hpp:31
bad_data_exception(const std::string &what_arg)
Definition common.hpp:35
yield_exception(const std::string &what_arg)
Definition common.hpp:24
yield_exception(const char *what_arg)
Definition common.hpp:20
Definition name.hpp:106
std::tuple< const std::exception_ptr &, char const *, uint64_t, char const * > exception_with_context
Definition common.hpp:40
std::optional< std::tuple< data_log_entry, bool > > get_block_t
Definition common.hpp:49
std::optional< uint32_t > get_block_n
Definition common.hpp:51