rippled
Loading...
Searching...
No Matches
Family.h
1//------------------------------------------------------------------------------
2/*
3 This file is part of rippled: https://github.com/ripple/rippled
4 Copyright (c) 2015 Ripple Labs Inc.
5
6 Permission to use, copy, modify, and/or distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18//==============================================================================
19
20#ifndef RIPPLE_SHAMAP_FAMILY_H_INCLUDED
21#define RIPPLE_SHAMAP_FAMILY_H_INCLUDED
22
23#include <xrpld/nodestore/Database.h>
24#include <xrpld/shamap/FullBelowCache.h>
25#include <xrpld/shamap/TreeNodeCache.h>
26
27#include <xrpl/beast/utility/Journal.h>
28
29#include <cstdint>
30
31namespace ripple {
32
33class Family
34{
35public:
36 Family(Family const&) = delete;
37 Family(Family&&) = delete;
38
39 Family&
40 operator=(Family const&) = delete;
41
42 Family&
43 operator=(Family&&) = delete;
44
45 explicit Family() = default;
46 virtual ~Family() = default;
47
48 virtual NodeStore::Database&
49 db() = 0;
50
51 virtual NodeStore::Database const&
52 db() const = 0;
53
54 virtual beast::Journal const&
55 journal() = 0;
56
60
64
65 virtual void
66 sweep() = 0;
67
73 virtual void
74 missingNodeAcquireBySeq(std::uint32_t refNum, uint256 const& nodeHash) = 0;
75
81 virtual void
82 missingNodeAcquireByHash(uint256 const& refHash, std::uint32_t refNum) = 0;
83
84 virtual void
85 reset() = 0;
86};
87
88} // namespace ripple
89
90#endif
A generic endpoint for log messages.
Definition: Journal.h:60
virtual void reset()=0
virtual void sweep()=0
virtual std::shared_ptr< FullBelowCache > getFullBelowCache()=0
Return a pointer to the Family Full Below Cache.
virtual beast::Journal const & journal()=0
Family & operator=(Family &&)=delete
virtual NodeStore::Database const & db() const =0
virtual std::shared_ptr< TreeNodeCache > getTreeNodeCache()=0
Return a pointer to the Family Tree Node Cache.
virtual void missingNodeAcquireByHash(uint256 const &refHash, std::uint32_t refNum)=0
Acquire ledger that has a missing node by ledger hash.
virtual void missingNodeAcquireBySeq(std::uint32_t refNum, uint256 const &nodeHash)=0
Acquire ledger that has a missing node by ledger sequence.
virtual ~Family()=default
virtual NodeStore::Database & db()=0
Family & operator=(Family const &)=delete
Family(Family const &)=delete
Family()=default
Family(Family &&)=delete
Persistency layer for NodeObject.
Definition: Database.h:51
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:26