Skip to content

Commit

Permalink
Commented xblock_t variant event value type.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Jun 27, 2024
1 parent 77112a4 commit cdb7fa4
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions include/bitcoin/node/define.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ typedef std::shared_ptr<database::associations> map_ptr;
typedef std::function<void(const code&, const map_ptr&,
const job::ptr&)> map_handler;

/// Node events.
/// Event desubscriber key type.
using object_key = uint64_t;

/// Use for event_value variants (all unsigned integral integers).
/// Event value types.
using count_t = size_t;
using height_t = size_t;
using channel_t = uint64_t;
Expand All @@ -82,16 +82,24 @@ typedef system::chain::block::cptr block_t;
//// system::chain::block::cptr block;
////} xblock_t;

// std::variant types must be distinct, and xcode size_t is neither uint32_t
// nor uint64_t, so this ensures we have the distinct set of necessary types.
/// std::variant types must be distinct, and xcode size_t is neither uint32_t
/// nor uint64_t, so this ensures we have the distinct set of necessary types.
using event_value =
iif<is_same_type<std::size_t, uint64_t>,
std::variant<uint32_t, size_t, block_t>,
iif<is_same_type<std::size_t, uint32_t>,
std::variant<uint64_t, size_t, block_t>,
std::variant<uint64_t, uint32_t, size_t, block_t>>>;

////using xevent_value =
//// iif<is_same_type<std::size_t, uint64_t>,
//// std::variant<uint32_t, size_t, xblock_t>,
//// iif<is_same_type<std::size_t, uint32_t>,
//// std::variant<uint64_t, size_t, xblock_t>,
//// std::variant<uint64_t, uint32_t, size_t, xblock_t>>>;

/// Event desubscriber.
typedef network::desubscriber<object_key, chase, event_value> event_subscriber;
////typedef network::desubscriber<object_key, chase, xevent_value> xevent_subscriber;
typedef event_subscriber::handler event_notifier;
typedef event_subscriber::completer event_completer;

Expand All @@ -100,6 +108,7 @@ typedef event_subscriber::completer event_completer;
////static_assert(sizeof(block_t) == 16u);
////static_assert(sizeof(xblock_t) == 32u);
////static_assert(sizeof(event_value) == 24u);
////static_assert(sizeof(xevent_value) == 40u);

} // namespace node
} // namespace libbitcoin
Expand Down

0 comments on commit cdb7fa4

Please sign in to comment.