CatapultServer  v0.5.0.1 (Elephant)
PatriciaTreeSerializer.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "TreeNode.h"
23 
24 namespace catapult { namespace tree {
25 
28  public:
30  static std::string SerializeValue(const tree::TreeNode& value);
31 
33  static tree::TreeNode DeserializeValue(const RawBuffer& buffer);
34  };
35 }}
catapult::tree::PatriciaTreeSerializer
Serializer for patricia tree.
Definition: PatriciaTreeSerializer.h:27
catapult::Hash256
utils::ByteArray< Hash256_Size, Hash256_tag > Hash256
Definition: src/catapult/types.h:47
catapult::io::Write16
void Write16(TIo &output, uint16_t value)
Writes value into output.
Definition: PodIoUtils.h:48
catapult::io::Write8
void Write8(TIo &output, uint8_t value)
Writes value into output.
Definition: PodIoUtils.h:54
catapult::tree::PatriciaTreeSerializer::DeserializeValue
static tree::TreeNode DeserializeValue(const RawBuffer &buffer)
Deserializes tree node from buffer.
Definition: PatriciaTreeSerializer.cpp:128
TreeNode.h
IntegerMath.h
catapult::tree::TreeNode::isLeaf
bool isLeaf() const
Returns true if this node represents a leaf node.
Definition: TreeNode.cpp:189
catapult::io::Read8
auto Read8(TIo &input)
Reads value from input.
Definition: PodIoUtils.h:90
catapult::tree::TreeNode::asBranchNode
const BranchTreeNode & asBranchNode() const
Gets a branch node interface to this node.
Definition: TreeNode.cpp:227
CATAPULT_THROW_INVALID_ARGUMENT_1
#define CATAPULT_THROW_INVALID_ARGUMENT_1(MESSAGE, PARAM1)
Macro used to throw a catapult invalid argument with a single parameter.
Definition: exceptions.h:183
catapult::io::Read16
auto Read16(TIo &input)
Reads value from input.
Definition: PodIoUtils.h:82
catapult::io::BufferInputStreamAdapter
Adapt a typed buffer to be used as an input stream.
Definition: BufferInputStreamAdapter.h:30
StringOutputStream.h
CATAPULT_THROW_RUNTIME_ERROR
#define CATAPULT_THROW_RUNTIME_ERROR(MESSAGE)
Macro used to throw a catapult runtime error.
Definition: exceptions.h:167
CATAPULT_THROW_INVALID_ARGUMENT
#define CATAPULT_THROW_INVALID_ARGUMENT(MESSAGE)
Macro used to throw a catapult invalid argument.
Definition: exceptions.h:179
catapult::tree::TreeNode::asLeafNode
const LeafTreeNode & asLeafNode() const
Gets a leaf node interface to this node.
Definition: TreeNode.cpp:220
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::Hash256_Size
constexpr size_t Hash256_Size
Definition: src/catapult/types.h:34
PodIoUtils.h
catapult::tree::TreeNode
Represents a tree node.
Definition: TreeNode.h:124
catapult::tree::PatriciaTreeSerializer::SerializeValue
static std::string SerializeValue(const tree::TreeNode &value)
Serializes value to string.
Definition: PatriciaTreeSerializer.cpp:119
catapult::tree::TreeNode::isBranch
bool isBranch() const
Returns true if this node represents a branch node.
Definition: TreeNode.cpp:185
BufferInputStreamAdapter.h
PatriciaTreeSerializer.h
catapult::utils::RawBuffer
BasicRawBuffer< const uint8_t > RawBuffer
A const binary buffer.
Definition: RawBuffer.h:62