Kagome
Polkadot Runtime Engine in C++17
|
#include <offchain_persistent_storage.hpp>
Public Member Functions | |
OffchainPersistentStorageImpl (std::shared_ptr< storage::BufferStorage > storage) | |
outcome::result< void > | set (const common::BufferView &key, common::Buffer value) override |
Sets a value in the storage. More... | |
outcome::result< void > | clear (const common::BufferView &key) override |
Remove a value from the local storage. More... | |
outcome::result< bool > | compare_and_set (const common::BufferView &key, const std::optional< common::BufferView > &expected, common::Buffer value) override |
Sets a new value in the local storage if the condition matches the current value. More... | |
outcome::result< common::Buffer > | get (const common::BufferView &key) override |
Gets a value from the local storage. More... | |
Public Member Functions inherited from kagome::offchain::OffchainStorage | |
virtual | ~OffchainStorage ()=default |
Private Attributes | |
std::shared_ptr< storage::BufferStorage > | storage_ |
std::mutex | mutex_ |
log::Logger | log_ |
Definition at line 16 of file offchain_persistent_storage.hpp.
|
explicit |
Definition at line 23 of file offchain_persistent_storage.cpp.
|
overridevirtual |
Remove a value from the local storage.
key | a pointer-size indicating the key |
Implements kagome::offchain::OffchainStorage.
Definition at line 37 of file offchain_persistent_storage.cpp.
|
overridevirtual |
Sets a new value in the local storage if the condition matches the current value.
key | a pointer-size indicating the key |
expected | a pointer-size indicating the old value |
value | a pointer-size indicating the new value |
Implements kagome::offchain::OffchainStorage.
Definition at line 44 of file offchain_persistent_storage.cpp.
|
overridevirtual |
Gets a value from the local storage.
key | a pointer-size indicating the key |
Implements kagome::offchain::OffchainStorage.
Definition at line 66 of file offchain_persistent_storage.cpp.
|
overridevirtual |
Sets a value in the storage.
key | a pointer-size indicating the key |
value | a pointer-size indicating the value |
Implements kagome::offchain::OffchainStorage.
Definition at line 30 of file offchain_persistent_storage.cpp.
|
private |
Definition at line 37 of file offchain_persistent_storage.hpp.
|
private |
Definition at line 36 of file offchain_persistent_storage.hpp.
|
private |
Definition at line 34 of file offchain_persistent_storage.hpp.