Derecho  0.9
Distributed systems toolkit for RDMA
derecho_internal.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <cstdint>
9 #include <functional>
10 #include <map>
11 #include <memory>
12 #include <optional>
13 #include <string>
14 #include <sys/types.h>
15 #include <utility>
16 
17 #include "../derecho_type_definitions.hpp"
20 
21 namespace persistent {
22 class PersistentRegistry;
23 }
24 
25 namespace derecho {
28 using subgroup_id_t = uint32_t;
31 using message_id_t = int32_t;
37 using subgroup_type_id_t = uint32_t;
38 
40 // using message_callback_t = std::function<void(subgroup_id_t, node_id_t, message_id_t, char*, long long int, persistent::version_t)>;
41 using message_callback_t = std::function<void(subgroup_id_t, node_id_t, message_id_t, std::optional<std::pair<char*, long long int>>, persistent::version_t)>;
42 using persistence_callback_t = std::function<void(subgroup_id_t, persistent::version_t)>;
43 using rpc_handler_t = std::function<void(subgroup_id_t, node_id_t, char*, uint32_t)>;
44 
47 template <typename T>
48 using Factory = std::function<std::unique_ptr<T>(persistent::PersistentRegistry*)>;
49 
50 // for persistence manager
51 using persistence_manager_make_version_func_t = std::function<void(
52  const subgroup_id_t&,
53  const persistent::version_t&,
54  const HLC&)>;
55 using persistence_manager_post_persist_func_t = std::function<void(
56  const subgroup_id_t&,
60 
61 // to post the next version in a subgroup
62 using subgroup_post_next_version_func_t = std::function<void(
63  const subgroup_id_t&,
64  const persistent::version_t&,
65  const uint64_t&)>;
66 
67 } // namespace derecho
uint32_t subgroup_id_t
Type alias for the internal Subgroup IDs generated by ViewManager.
std::function< void(subgroup_id_t, node_id_t, message_id_t, std::optional< std::pair< char *, long long int > >, persistent::version_t)> message_callback_t
Alias for the type of std::function that is used for message delivery event callbacks.
This file include all common types internal to derecho and not necessarily being known by a client pr...
uint32_t subgroup_type_id_t
Type of the numeric ID used to refer to subgroup types within a Group; this is currently computed as ...
This file defines some type aliases used by the Persistence library.
std::function< void(const subgroup_id_t &, const persistent::version_t &, const HLC &)> persistence_manager_make_version_func_t
std::function< void(subgroup_id_t, node_id_t, char *, uint32_t)> rpc_handler_t
std::function< void(subgroup_id_t, persistent::version_t)> persistence_callback_t
int32_t message_id_t
Type alias for a message&#39;s unique "sequence number" or index.
std::function< std::unique_ptr< T >(persistent::PersistentRegistry *)> Factory
The type of factory function the user must provide to the Group constructor, to construct each Replic...
Definition: HLC.hpp:7
std::tuple< persistence_manager_make_version_func_t, persistence_manager_post_persist_func_t > persistence_manager_callbacks_t
std::function< void(const subgroup_id_t &, const persistent::version_t &, const uint64_t &)> subgroup_post_next_version_func_t
std::function< void(const subgroup_id_t &, const persistent::version_t &)> persistence_manager_post_persist_func_t
PersistentRegistry is a book for all the Persistent<T> or Volatile<T> variables.
Definition: Persistent.hpp:81