CatapultServer  v0.5.0.1 (Elephant)
KeySerializers.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "catapult/types.h"
23 
24 namespace catapult { namespace cache {
25 
27  template<
28  typename TValue,
29  typename X = std::enable_if_t<utils::traits::is_scalar_v<TValue>>
30  >
31  RawBuffer SerializeKey(const TValue& value) {
32  return { reinterpret_cast<const uint8_t*>(&value), sizeof(value) };
33  }
34 
36  template<size_t N, typename TTag>
38  return container;
39  }
40 }}
types.h
catapult::cache::SerializeKey
RawBuffer SerializeKey(const TValue &value)
Serializes value-based key (value).
Definition: KeySerializers.h:31
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::utils::ByteArray
Base class for wrappers of byte array types, to provide some type-safety.
Definition: ByteArray.h:29
catapult::utils::RawBuffer
BasicRawBuffer< const uint8_t > RawBuffer
A const binary buffer.
Definition: RawBuffer.h:62