CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
26 #include <unordered_map>
28 namespace catapult {
namespace tree {
42 std::unique_ptr<const TreeNode>
get(
const Hash256& hash)
const;
58 template<
typename TNode>
59 void save(
const TNode& node) {
62 auto nodeHash = node.hash();
63 m_nodes.emplace(nodeHash, std::make_unique<TreeNode>(node));
const TreeNodePath & path() const
Gets the node path.
Definition: TreeNode.cpp:90
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
void clear()
Clears all nodes.
Definition: MemoryDataSource.cpp:64
MemoryDataSource(DataSourceVerbosity verbosity=DataSourceVerbosity::Off)
Creates a data source with specified verbosity.
Definition: MemoryDataSource.cpp:27
def debug(*args)
Definition: Parser.py:46
void set(const LeafTreeNode &node)
Saves a leaf tree node.
Definition: MemoryDataSource.cpp:44
std::unique_ptr< const TreeNode > get(const Hash256 &hash) const
Gets the tree node associated with hash.
Definition: MemoryDataSource.cpp:34
const Hash256 & value() const
Gets the node value.
Definition: TreeNode.cpp:72
const TreeNodePath & path() const
Gets the node path.
Definition: TreeNode.cpp:68
std::unordered_map< Hash256, std::unique_ptr< TreeNode >, utils::ArrayHasher< Hash256 > > m_nodes
Definition: MemoryDataSource.h:68
bool m_isVerbose
Definition: MemoryDataSource.h:67
void forEach(const consumer< const TreeNode & > &consumer) const
Gets all nodes and passes them to consumer.
Definition: MemoryDataSource.cpp:39
const Hash256 & hash() const
Gets the hash representation of this node.
Definition: TreeNode.cpp:116
Represents a leaf tree node.
Definition: TreeNode.h:34
size_t size() const
Gets the number of saved nodes.
Definition: MemoryDataSource.cpp:30
Definition: AddressExtractionExtension.cpp:28
DataSourceVerbosity
Data source verbosity.
Definition: DataSourceVerbosity.h:26
Base class for wrappers of byte array types, to provide some type-safety.
Definition: ByteArray.h:29
A patricia tree memory data source.
Definition: MemoryDataSource.h:31
std::function< void(TArgs...)> consumer
A consumer function.
Definition: functions.h:35
Represents a branch tree node.
Definition: TreeNode.h:60
const Hash256 & hash() const
Gets the hash representation of this node.
Definition: TreeNode.cpp:76
void save(const TNode &node)
Definition: MemoryDataSource.h:59
size_t numLinks() const
Gets the number of links set in this node.
Definition: TreeNode.cpp:94