CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
24 namespace catapult {
namespace tree {
27 template<
typename TBackingDataSource>
32 const TBackingDataSource& backingDataSource,
46 std::unique_ptr<const TreeNode>
get(
const Hash256& hash)
const {
void set(const LeafTreeNode &node)
Saves a leaf tree node.
Definition: ReadThroughMemoryDataSource.h:58
MemoryDataSource m_memoryDataSource
Definition: ReadThroughMemoryDataSource.h:74
A patricia tree memory data source that reads through but does not write through.
Definition: ReadThroughMemoryDataSource.h:28
void clear()
Clears all nodes.
Definition: MemoryDataSource.cpp:64
void set(const LeafTreeNode &node)
Saves a leaf tree node.
Definition: MemoryDataSource.cpp:44
void forEach(const consumer< const TreeNode & > &consumer) const
Gets all nodes in memory and passes them to consumer.
Definition: ReadThroughMemoryDataSource.h:52
void set(const BranchTreeNode &node)
Saves a branch tree node.
Definition: ReadThroughMemoryDataSource.h:63
std::unique_ptr< const TreeNode > get(const Hash256 &hash) const
Gets the tree node associated with hash.
Definition: MemoryDataSource.cpp:34
size_t size() const
Gets the number of saved nodes in the in memory cache.
Definition: ReadThroughMemoryDataSource.h:40
std::unique_ptr< const TreeNode > get(const Hash256 &hash) const
Gets the tree node associated with hash.
Definition: ReadThroughMemoryDataSource.h:46
void forEach(const consumer< const TreeNode & > &consumer) const
Gets all nodes and passes them to consumer.
Definition: MemoryDataSource.cpp:39
const TBackingDataSource & m_backingDataSource
Definition: ReadThroughMemoryDataSource.h:73
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
void clear()
Clears all cached memory nodes.
Definition: ReadThroughMemoryDataSource.h:68
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
ReadThroughMemoryDataSource(const TBackingDataSource &backingDataSource, DataSourceVerbosity verbosity=DataSourceVerbosity::Off)
Creates a data source around backingDataSource with specified verbosity.
Definition: ReadThroughMemoryDataSource.h:31