rippled
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 <ripple/basics/Log.h>
24 #include <ripple/beast/utility/Journal.h>
25 #include <ripple/nodestore/Database.h>
26 #include <ripple/shamap/FullBelowCache.h>
27 #include <ripple/shamap/TreeNodeCache.h>
28 #include <cstdint>
29 
30 namespace ripple {
31 
32 class Family
33 {
34 public:
35  Family(Family const&) = delete;
36  Family(Family&&) = delete;
37 
38  Family&
39  operator=(Family const&) = delete;
40 
41  Family&
42  operator=(Family&&) = delete;
43 
44  explicit Family() = default;
45  virtual ~Family() = default;
46 
47  virtual NodeStore::Database&
48  db() = 0;
49 
50  virtual NodeStore::Database const&
51  db() const = 0;
52 
53  virtual beast::Journal const&
54  journal() = 0;
55 
62  getFullBelowCache(std::uint32_t ledgerSeq) = 0;
63 
70  getTreeNodeCache(std::uint32_t ledgerSeq) = 0;
71 
72  virtual void
73  sweep() = 0;
74 
75  virtual bool
76  isShardBacked() const = 0;
77 
85  virtual void
86  missingNodeAcquireBySeq(std::uint32_t refNum, uint256 const& nodeHash) = 0;
87 
93  virtual void
94  missingNodeAcquireByHash(uint256 const& refHash, std::uint32_t refNum) = 0;
95 
96  virtual void
97  reset() = 0;
98 };
99 
100 } // namespace ripple
101 
102 #endif
ripple::Family::getTreeNodeCache
virtual std::shared_ptr< TreeNodeCache > getTreeNodeCache(std::uint32_t ledgerSeq)=0
Return a pointer to the Family Tree Node Cache.
ripple::Family::operator=
Family & operator=(Family const &)=delete
ripple::NodeStore::Database
Persistency layer for NodeObject.
Definition: Database.h:51
std::shared_ptr
STL class.
ripple::Family::reset
virtual void reset()=0
ripple::Family::sweep
virtual void sweep()=0
ripple::Family::isShardBacked
virtual bool isShardBacked() const =0
ripple::Family::getFullBelowCache
virtual std::shared_ptr< FullBelowCache > getFullBelowCache(std::uint32_t ledgerSeq)=0
Return a pointer to the Family Full Below Cache.
ripple::Family::db
virtual NodeStore::Database & db()=0
ripple::Family::missingNodeAcquireBySeq
virtual void missingNodeAcquireBySeq(std::uint32_t refNum, uint256 const &nodeHash)=0
Acquire ledger that has a missing node by ledger sequence.
ripple::base_uint< 256 >
ripple::Family::Family
Family()=default
ripple::Family::~Family
virtual ~Family()=default
cstdint
ripple::Family
Definition: Family.h:32
beast::Journal
A generic endpoint for log messages.
Definition: Journal.h:58
std::uint32_t
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::Family::journal
virtual beast::Journal const & journal()=0
ripple::Family::missingNodeAcquireByHash
virtual void missingNodeAcquireByHash(uint256 const &refHash, std::uint32_t refNum)=0
Acquire ledger that has a missing node by ledger hash.