CatapultServer  v0.5.0.1 (Elephant)
AccountStateCacheSerializers.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "AccountStateCacheTypes.h"
25 
26 namespace catapult { namespace cache {
27 
29  struct AccountStatePrimarySerializer : public CacheSerializerAdapter<state::AccountStateSerializer, AccountStateCacheDescriptor> {};
30 
34  : public CacheSerializerAdapter<state::AccountStateNonHistoricalSerializer, AccountStateCacheDescriptor>
35  {};
36 
39  private:
40  using KeyType = Key;
41  using ValueType = std::pair<Key, Address>;
42 
43  public:
45  static std::string SerializeValue(const ValueType& value);
46 
48  static ValueType DeserializeValue(const RawBuffer& buffer);
49  };
50 }}
catapult::cache::KeyAddressPairSerializer::ValueType
std::pair< Key, Address > ValueType
Definition: AccountStateCacheSerializers.h:41
catapult::cache::KeyAddressPairSerializer::SerializeValue
static std::string SerializeValue(const ValueType &value)
Serializes value to string.
Definition: AccountStateCacheSerializers.cpp:25
catapult::cache::AccountStatePrimarySerializer
Primary serializer for account state cache.
Definition: AccountStateCacheSerializers.h:29
catapult::io::StringOutputStream::str
const std::string & str() const
Returns underlying string.
Definition: StringOutputStream.h:44
catapult::cache::KeyAddressPairSerializer::DeserializeValue
static ValueType DeserializeValue(const RawBuffer &buffer)
Deserializes value from buffer.
Definition: AccountStateCacheSerializers.cpp:32
CacheSerializerAdapter.h
catapult::io::StringOutputStream::write
void write(const RawBuffer &buffer) override
Definition: StringOutputStream.h:35
catapult::cache::CacheSerializerAdapter
Cache serializer adapter.
Definition: CacheSerializerAdapter.h:31
catapult::cache::AccountStatePatriciaTreeSerializer
Definition: AccountStateCacheSerializers.h:33
catapult::cache::KeyAddressPairSerializer
Serializer for key address lookup sub cache.
Definition: AccountStateCacheSerializers.h:38
catapult::io::BufferInputStreamAdapter
Adapt a typed buffer to be used as an input stream.
Definition: BufferInputStreamAdapter.h:30
AccountStateCacheSerializers.h
catapult
Definition: AddressExtractionExtension.cpp:28
AccountStateCacheTypes.h
catapult::io::BufferInputStreamAdapter::read
void read(const MutableRawBuffer &buffer) override
Definition: BufferInputStreamAdapter.h:50
catapult::io::StringOutputStream
String output stream.
Definition: StringOutputStream.h:27
catapult::utils::ByteArray< Key_Size, Key_tag >
AccountStateSerializer.h
catapult::Key
utils::ByteArray< Key_Size, Key_tag > Key
Definition: src/catapult/types.h:41
catapult::utils::RawBuffer
BasicRawBuffer< const uint8_t > RawBuffer
A const binary buffer.
Definition: RawBuffer.h:62