CatapultServer  v0.5.0.1 (Elephant)
NamespaceCacheSerializers.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "NamespaceCacheTypes.h"
26 
27 namespace catapult { namespace cache {
28 
31  : public CacheSerializerAdapter<state::RootNamespaceHistorySerializer, NamespaceCacheDescriptor>
32  {};
33 
37  : public CacheSerializerAdapter<state::RootNamespaceHistoryNonHistoricalSerializer, NamespaceCacheDescriptor>
38  {};
39 
42  private:
45 
46  public:
48  static constexpr uint16_t State_Version = 1;
49 
50  public:
52  static std::string SerializeValue(const ValueType& value);
53 
55  static ValueType DeserializeValue(const RawBuffer& buffer);
56  };
57 
59  struct NamespaceHeightGroupingSerializer : public IdentifierGroupSerializer<NamespaceCacheTypes::HeightGroupingTypesDescriptor> {};
60 }}
catapult::cache::NamespaceFlatMapTypesSerializer::SerializeValue
static std::string SerializeValue(const ValueType &value)
Serializes element to string.
Definition: NamespaceCacheSerializers.cpp:26
catapult::state::Namespace
A catapult namespace.
Definition: Namespace.h:30
catapult::NamespaceId
utils::BaseValue< uint64_t, NamespaceId_tag > NamespaceId
Definition: plugins/txes/namespace/src/types.h:28
IdentifierGroupSerializer.h
catapult::utils::CheckedArray< NamespaceId, Namespace_Max_Depth >
catapult::cache::NamespaceFlatMapTypesSerializer::State_Version
static constexpr uint16_t State_Version
Serialized state version.
Definition: NamespaceCacheSerializers.h:48
catapult::state::Namespace::path
const Path & path() const
Gets the path.
Definition: Namespace.h:63
NamespaceCacheSerializers.h
catapult::utils::CheckedArray::size
size_t size() const
Gets the size of the array.
Definition: CheckedArray.h:40
catapult::cache::StateVersion::ReadAndCheck
static void ReadAndCheck(io::InputStream &input)
Reads state version from input and verifies it.
Definition: StateVersion.h:37
catapult::io::StringOutputStream::str
const std::string & str() const
Returns underlying string.
Definition: StringOutputStream.h:44
catapult::utils::BaseValue< uint64_t, NamespaceId_tag >
CacheSerializerAdapter.h
NamespaceCacheTypes.h
catapult::cache::StateVersion::Write
static void Write(io::OutputStream &output)
Writes state version to output.
Definition: StateVersion.h:32
catapult::cache::CacheSerializerAdapter
Cache serializer adapter.
Definition: CacheSerializerAdapter.h:31
catapult::io::Write
void Write(TIo &output, const utils::BasicBaseValue< TValue, TTag, TBaseValue > &value)
Writes base value into output.
Definition: PodIoUtils.h:30
size
uint64_t size
Definition: MemoryCounters.cpp:65
catapult::io::Write64
void Write64(TIo &output, uint64_t value)
Writes value into output.
Definition: PodIoUtils.h:36
catapult::cache::NamespaceHeightGroupingSerializer
Serializer for namespace cache height grouped elements.
Definition: NamespaceCacheSerializers.h:59
catapult::cache::IdentifierGroupSerializer
Serializer for identifier group elements.
Definition: IdentifierGroupSerializer.h:30
RootNamespaceHistorySerializer.h
catapult::cache::NamespaceFlatMapTypesSerializer
Serializer for namespace flat map sub cache.
Definition: NamespaceCacheSerializers.h:41
catapult::io::BufferInputStreamAdapter
Adapt a typed buffer to be used as an input stream.
Definition: BufferInputStreamAdapter.h:30
catapult::cache::RootNamespaceHistoryPrimarySerializer
Primary serializer for namespace cache.
Definition: NamespaceCacheSerializers.h:30
catapult::cache::NamespaceFlatMapTypesSerializer::DeserializeValue
static ValueType DeserializeValue(const RawBuffer &buffer)
Deserializes value from buffer.
Definition: NamespaceCacheSerializers.cpp:37
catapult::utils::CheckedArray::push_back
void push_back(T val)
Definition: CheckedArray.h:51
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::io::Read64
auto Read64(TIo &input)
Reads value from input.
Definition: PodIoUtils.h:66
PodIoUtils.h
catapult::cache::RootNamespaceHistoryPatriciaTreeSerializer
Definition: NamespaceCacheSerializers.h:36
catapult::io::StringOutputStream
String output stream.
Definition: StringOutputStream.h:27
catapult::cache::CacheId::Namespace
catapult::utils::RawBuffer
BasicRawBuffer< const uint8_t > RawBuffer
A const binary buffer.
Definition: RawBuffer.h:62