Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio::chain::detail Namespace Reference

Classes

struct  abstract_snapshot_row_reader
 
struct  abstract_snapshot_row_writer
 
struct  block_extension_types
 
struct  block_header_extension_types
 
struct  block_header_state_common
 
class  block_log_impl
 
struct  decompose
 
struct  decompose< T, Rest... >
 
struct  decompose<>
 
struct  extract_match
 
class  fileptr_datastream
 
class  index_writer
 
struct  is_any_of
 
struct  is_chainbase_object
 
struct  is_chainbase_object< chainbase::object< TypeNumber, Derived > >
 
struct  ostream_wrapper
 
class  reverse_iterator
 
struct  row_validation_helper
 
struct  schedule_info
 
struct  snapshot_row_reader
 
struct  snapshot_row_traits
 
struct  snapshot_row_traits< global_property_object >
 
struct  snapshot_row_traits< permission_object >
 
struct  snapshot_row_traits< protocol_state_object >
 
struct  snapshot_row_writer
 
struct  snapshot_section_traits
 
struct  transaction_extension_types
 

Typedefs

using unique_file = std::unique_ptr<FILE, decltype(&fclose)>
 
using meta_permission_key = std::tuple<uint32_t, int>
 
using meta_permission_value = std::function<uint32_t()>
 
using meta_permission_map = boost::container::flat_multimap<meta_permission_key, meta_permission_value, std::greater<>>
 

Functions

bool is_builtin_activated (const protocol_feature_activation_set_ptr &pfa, const protocol_feature_set &pfs, builtin_protocol_feature_t feature_codename)
 
constexpr uint64_t buffer_location_to_file_location (uint32_t buffer_location)
 
constexpr uint32_t file_location_to_buffer_location (uint32_t file_location)
 
constexpr uint64_t next_power_of_2 (uint64_t value)
 
constexpr int clz_power_2 (uint64_t value)
 
constexpr int calcluate_max_depth (uint64_t node_count)
 
template<typename ContainerA , typename ContainerB >
void move_nodes (ContainerA &to, const ContainerB &from)
 
template<typename Container >
void move_nodes (Container &to, Container &&from)
 
template<typename T >
snapshot_row_writer< Tmake_row_writer (const T &data)
 
template<typename T >
snapshot_row_reader< Tmake_row_reader (T &data)
 

Variables

constexpr uint32_t pruned_version_flag = 1<<31
 
template<typename T >
constexpr bool is_chainbase_object_v = is_chainbase_object<T>::value
 
template<typename T , typename ... Ts>
constexpr bool is_any_of_v = is_any_of<T, Ts...>::value
 

Typedef Documentation

◆ meta_permission_key

Definition at line 18 of file authority_checker.hpp.

◆ meta_permission_map

using sysio::chain::detail::meta_permission_map = boost::container::flat_multimap<meta_permission_key, meta_permission_value, std::greater<>>

Definition at line 20 of file authority_checker.hpp.

◆ meta_permission_value

Definition at line 19 of file authority_checker.hpp.

◆ unique_file

using sysio::chain::detail::unique_file = std::unique_ptr<FILE, decltype(&fclose)>

Definition at line 38 of file block_log.cpp.

Function Documentation

◆ buffer_location_to_file_location()

uint64_t sysio::chain::detail::buffer_location_to_file_location ( uint32_t buffer_location)
constexpr

Definition at line 174 of file block_log.cpp.

174{ return buffer_location << 3; }

◆ calcluate_max_depth()

int sysio::chain::detail::calcluate_max_depth ( uint64_t node_count)
constexpr

Given a number of nodes return the depth required to store them in a fully balanced binary tree.

Parameters
node_count- the number of nodes in the implied tree
Returns
the max depth of the minimal tree that stores them

Definition at line 59 of file incremental_merkle.hpp.

59 {
60 if (node_count == 0) {
61 return 0;
62 }
63 auto implied_count = next_power_of_2(node_count);
64 return clz_power_2(implied_count) + 1;
65}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ clz_power_2()

int sysio::chain::detail::clz_power_2 ( uint64_t value)
constexpr

Given a power-of-2 (assumed correct) return the number of leading zeros

This is a classic count-leading-zeros in parallel without the necessary math to make it safe for anything that is not already a power-of-2

Parameters
value- and integral power-of-2
Returns
the number of leading zeros

Definition at line 38 of file incremental_merkle.hpp.

38 {
39 int lz = 64;
40
41 if (value) lz--;
42 if (value & 0x00000000FFFFFFFFULL) lz -= 32;
43 if (value & 0x0000FFFF0000FFFFULL) lz -= 16;
44 if (value & 0x00FF00FF00FF00FFULL) lz -= 8;
45 if (value & 0x0F0F0F0F0F0F0F0FULL) lz -= 4;
46 if (value & 0x3333333333333333ULL) lz -= 2;
47 if (value & 0x5555555555555555ULL) lz -= 1;
48
49 return lz;
50}
#define value
Definition pkcs11.h:157
Here is the caller graph for this function:

◆ file_location_to_buffer_location()

uint32_t sysio::chain::detail::file_location_to_buffer_location ( uint32_t file_location)
constexpr

Definition at line 175 of file block_log.cpp.

175{ return file_location >> 3; }

◆ is_builtin_activated()

bool sysio::chain::detail::is_builtin_activated ( const protocol_feature_activation_set_ptr & pfa,
const protocol_feature_set & pfs,
builtin_protocol_feature_t feature_codename )

Definition at line 8 of file block_header_state.cpp.

11 {
12 auto digest = pfs.get_builtin_digest(feature_codename);
13 const auto& protocol_features = pfa->protocol_features;
14 return digest && protocol_features.find(*digest) != protocol_features.end();
15 }
std::optional< digest_type > get_builtin_digest(builtin_protocol_feature_t feature_codename) const
fc::sha256 digest(const T &value)
Definition digest.hpp:9
Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_row_reader()

template<typename T >
snapshot_row_reader< T > sysio::chain::detail::make_row_reader ( T & data)

Definition at line 219 of file snapshot.hpp.

Here is the caller graph for this function:

◆ make_row_writer()

template<typename T >
snapshot_row_writer< T > sysio::chain::detail::make_row_writer ( const T & data)

Definition at line 110 of file snapshot.hpp.

Here is the caller graph for this function:

◆ move_nodes() [1/2]

template<typename Container >
void sysio::chain::detail::move_nodes ( Container & to,
Container && from )
inline

Definition at line 74 of file incremental_merkle.hpp.

74 {
75 to = std::forward<Container>(from);
76}

◆ move_nodes() [2/2]

template<typename ContainerA , typename ContainerB >
void sysio::chain::detail::move_nodes ( ContainerA & to,
const ContainerB & from )
inline

Definition at line 68 of file incremental_merkle.hpp.

68 {
69 to.clear();
70 to.insert(to.begin(), from.begin(), from.end());
71}
Here is the caller graph for this function:

◆ next_power_of_2()

uint64_t sysio::chain::detail::next_power_of_2 ( uint64_t value)
constexpr

given an unsigned integral number return the smallest power-of-2 which is greater than or equal to the given number

Parameters
value- an unsigned integral
Returns
- the minimum power-of-2 which is >= value

Definition at line 17 of file incremental_merkle.hpp.

17 {
18 value -= 1;
19 value |= value >> 1;
20 value |= value >> 2;
21 value |= value >> 4;
22 value |= value >> 8;
23 value |= value >> 16;
24 value |= value >> 32;
25 value += 1;
26 return value;
27}
Here is the caller graph for this function:

Variable Documentation

◆ is_any_of_v

template<typename T , typename ... Ts>
bool sysio::chain::detail::is_any_of_v = is_any_of<T, Ts...>::value
constexpr

Definition at line 363 of file types.hpp.

◆ is_chainbase_object_v

template<typename T >
bool sysio::chain::detail::is_chainbase_object_v = is_chainbase_object<T>::value
constexpr

Definition at line 175 of file snapshot.hpp.

◆ pruned_version_flag

uint32_t sysio::chain::detail::pruned_version_flag = 1<<31
constexpr

Definition at line 122 of file block_log.cpp.