Skip to content

Commit 10020f4

Browse files
committed
Rename IKeyValue to KeyValueStorageBase.
1 parent 2eb9231 commit 10020f4

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ enum class Error : std::uint8_t
3030
/// validate data integrity per key (e.g., using CRC and such).
3131
/// This interface is fully blocking and should only be used during initialization and shutdown,
3232
/// never during normal operation. Non-blocking adapters can be built on top of it.
33-
class IKeyValue
33+
class KeyValueStorageBase
3434
{
3535
public:
36-
IKeyValue() = default;
37-
IKeyValue(const IKeyValue&) = delete;
38-
IKeyValue(IKeyValue&&) = delete;
39-
auto operator=(const IKeyValue&) -> IKeyValue& = delete;
40-
auto operator=(IKeyValue&&) -> IKeyValue& = delete;
41-
virtual ~IKeyValue() = default;
36+
KeyValueStorageBase() = default;
37+
KeyValueStorageBase(const KeyValueStorageBase&) = delete;
38+
KeyValueStorageBase(KeyValueStorageBase&&) = delete;
39+
auto operator=(const KeyValueStorageBase&) -> KeyValueStorageBase& = delete;
40+
auto operator=(KeyValueStorageBase&&) -> KeyValueStorageBase& = delete;
41+
virtual ~KeyValueStorageBase() = default;
4242

4343
/// The return value is the number of bytes read into the buffer or the error.
4444
[[nodiscard]] virtual auto get(const std::string_view key, const std::size_t size, void* const data) const

src/util/storage/register_storage.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#if __GNUC__ >= 11
1111

12-
#include "IKeyValue.hpp"
12+
#include "KeyValueStorageBase.hpp"
1313

1414
#include <functional>
1515

@@ -23,7 +23,7 @@ namespace cyphal::support
2323
/// Stored registers that are not present in the registry will not be loaded.
2424
/// The serialization format is simply the Cyphal DSDL.
2525
/// In case of error, only part of the registers may be loaded and the registry will be left in an inconsistent state.
26-
[[nodiscard]] inline std::optional<platform::storage::Error> load(const platform::storage::IKeyValue& kv,
26+
[[nodiscard]] inline std::optional<platform::storage::Error> load(const platform::storage::KeyValueStorageBase& kv,
2727
registry::IIntrospectableRegistry& rgy)
2828
{
2929
for (std::size_t index = 0; index < rgy.size(); index++)
@@ -82,7 +82,7 @@ namespace cyphal::support
8282
/// The removal predicate, if provided, allows the caller to specify which registers need to be removed from the
8383
/// storage instead of being saved. This is useful for implementing the "factory reset" feature.
8484
template <typename ResetPredicate>
85-
[[nodiscard]] std::optional<platform::storage::Error> save(platform::storage::IKeyValue& kv,
85+
[[nodiscard]] std::optional<platform::storage::Error> save(platform::storage::KeyValueStorageBase& kv,
8686
const registry::IIntrospectableRegistry& rgy,
8787
ResetPredicate const reset_predicate)
8888
{
@@ -127,7 +127,7 @@ template <typename ResetPredicate>
127127
}
128128
return std::nullopt;
129129
}
130-
[[nodiscard]] inline std::optional<platform::storage::Error> save(platform::storage::IKeyValue& kv,
130+
[[nodiscard]] inline std::optional<platform::storage::Error> save(platform::storage::KeyValueStorageBase& kv,
131131
const registry::IIntrospectableRegistry& rgy)
132132
{
133133
return save(kv, rgy, [](std::string_view) { return false; });

0 commit comments

Comments
 (0)