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/Serializer.h>
25 #include <ripple/protocol/STLedgerEntry.h>
26 #include <boost/optional.hpp>
27 #include <cstdint>
28 #include <memory>
29 #include <utility>
30 
31 namespace ripple {
32 
37 class RawView
38 {
39 public:
40  virtual ~RawView() = default;
41  RawView() = default;
42  RawView(RawView const&) = default;
43  RawView& operator=(RawView const&) = delete;
44 
50  virtual
51  void
52  rawErase (std::shared_ptr<SLE> const& sle) = 0;
53 
65  virtual
66  void
67  rawInsert (std::shared_ptr<SLE> const& sle) = 0;
68 
81  virtual
82  void
83  rawReplace (std::shared_ptr<SLE> const& sle) = 0;
84 
89  virtual
90  void
91  rawDestroyXRP (XRPAmount const& fee) = 0;
92 };
93 
94 //------------------------------------------------------------------------------
95 
101 class TxsRawView : public RawView
102 {
103 public:
109  virtual
110  void
111  rawTxInsert (ReadView::key_type const& key,
113  const& txn, std::shared_ptr<
114  Serializer const> const& metaData) = 0;
115 };
116 
117 } // ripple
118 
119 #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:37
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::Serializer
Definition: Serializer.h:43
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:101
ripple::RawView::operator=
RawView & operator=(RawView const &)=delete
ripple::XRPAmount
Definition: XRPAmount.h:46