rippled
RawView.h
1 //------------------------------------------------------------------------------
2 /*
3  This file is part of rippled: https://github.com/ripple/rippled
4  Copyright (c) 2012, 2013 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_LEDGER_RAWVIEW_H_INCLUDED
21 #define RIPPLE_LEDGER_RAWVIEW_H_INCLUDED
22 
23 #include <ripple/ledger/ReadView.h>
24 #include <ripple/protocol/STLedgerEntry.h>
25 #include <ripple/protocol/Serializer.h>
26 #include <cstdint>
27 #include <memory>
28 #include <utility>
29 
30 namespace ripple {
31 
36 class RawView
37 {
38 public:
39  virtual ~RawView() = default;
40  RawView() = default;
41  RawView(RawView const&) = default;
42  RawView&
43  operator=(RawView const&) = delete;
44 
50  virtual void
51  rawErase(std::shared_ptr<SLE> const& sle) = 0;
52 
64  virtual void
65  rawInsert(std::shared_ptr<SLE> const& sle) = 0;
66 
79  virtual void
80  rawReplace(std::shared_ptr<SLE> const& sle) = 0;
81 
86  virtual void
87  rawDestroyXRP(XRPAmount const& fee) = 0;
88 };
89 
90 //------------------------------------------------------------------------------
91 
97 class TxsRawView : public RawView
98 {
99 public:
105  virtual void
106  rawTxInsert(
107  ReadView::key_type const& key,
109  std::shared_ptr<Serializer const> const& metaData) = 0;
110 };
111 
112 } // namespace ripple
113 
114 #endif
ripple::RawView::RawView
RawView()=default
std::shared_ptr
STL class.
utility
ripple::RawView::rawDestroyXRP
virtual void rawDestroyXRP(XRPAmount const &fee)=0
Destroy XRP.
ripple::RawView::~RawView
virtual ~RawView()=default
ripple::RawView::rawReplace
virtual void rawReplace(std::shared_ptr< SLE > const &sle)=0
Unconditionally replace a state item.
ripple::RawView::rawErase
virtual void rawErase(std::shared_ptr< SLE > const &sle)=0
Delete an existing state item.
ripple::base_uint< 256 >
ripple::RawView
Interface for ledger entry changes.
Definition: RawView.h:36
ripple::TxsRawView::rawTxInsert
virtual void rawTxInsert(ReadView::key_type const &key, std::shared_ptr< Serializer const > const &txn, std::shared_ptr< Serializer const > const &metaData)=0
Add a transaction to the tx map.
ripple::RawView::rawInsert
virtual void rawInsert(std::shared_ptr< SLE > const &sle)=0
Unconditionally insert a state item.
cstdint
memory
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::TxsRawView
Interface for changing ledger entries with transactions.
Definition: RawView.h:97
ripple::RawView::operator=
RawView & operator=(RawView const &)=delete
ripple::XRPAmount
Definition: XRPAmount.h:46