CCF
Loading...
Searching...
No Matches
unit_value_handle.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the Apache 2.0 License.
3#pragma once
4
5#include "ccf/kv/unit.h"
7
8namespace ccf::kv
9{
13 template <typename Unit>
15 {
16 protected:
18
19 public:
22
27 bool has()
28 {
29 return read_handle.has(Unit::get());
30 }
31
40 std::optional<Version> get_version_of_previous_write()
41 {
43 }
44 };
45
49 template <typename Unit>
51 {
52 protected:
54
55 public:
58
65 void touch()
66 {
67 write_handle.put(Unit::get(), Unit::get());
68 }
69
72 void clear()
73 {
75 }
76 };
77
84 template <typename Unit>
103}
Definition abstract_handle.h:8
Definition unit_value_handle.h:15
bool has()
Definition unit_value_handle.h:27
ccf::kv::untyped::MapHandle & read_handle
Definition unit_value_handle.h:17
ReadableUnitValueHandle(ccf::kv::untyped::MapHandle &uh)
Definition unit_value_handle.h:20
std::optional< Version > get_version_of_previous_write()
Definition unit_value_handle.h:40
Definition unit_value_handle.h:88
UnitValueHandle(ccf::kv::untyped::ChangeSet &changes, const std::string &map_name)
Definition unit_value_handle.h:96
ccf::kv::untyped::MapHandle untyped_handle
Definition unit_value_handle.h:90
Definition unit_value_handle.h:51
void clear()
Definition unit_value_handle.h:72
void touch()
Definition unit_value_handle.h:65
WriteableUnitValueHandle(ccf::kv::untyped::MapHandle &uh)
Definition unit_value_handle.h:56
ccf::kv::untyped::MapHandle & write_handle
Definition unit_value_handle.h:53
Definition untyped_map_handle.h:18
void clear()
Definition untyped_map_handle.cpp:176
bool has(const KeyType &key)
Definition untyped_map_handle.cpp:146
void put(const KeyType &key, const ValueType &value)
Definition untyped_map_handle.cpp:161
std::optional< Version > get_version_of_previous_write(const KeyType &key)
Definition untyped_map_handle.cpp:112
Definition app_interface.h:18
Definition untyped_change_set.h:34