mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-25 21:45:52 +00:00
Add MetaView hold parameter
This commit is contained in:
@@ -30,6 +30,7 @@
|
|||||||
#include <ripple/protocol/STTx.h>
|
#include <ripple/protocol/STTx.h>
|
||||||
#include <beast/utility/noexcept.h>
|
#include <beast/utility/noexcept.h>
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
|
#include <functional>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
@@ -97,6 +98,7 @@ private:
|
|||||||
item_list items_;
|
item_list items_;
|
||||||
std::uint32_t destroyedCoins_ = 0;
|
std::uint32_t destroyedCoins_ = 0;
|
||||||
boost::optional<STAmount> deliverAmount_;
|
boost::optional<STAmount> deliverAmount_;
|
||||||
|
std::shared_ptr<void const> hold_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MetaView() = delete;
|
MetaView() = delete;
|
||||||
@@ -137,6 +139,10 @@ public:
|
|||||||
The parentCloseTime is set to the
|
The parentCloseTime is set to the
|
||||||
closeTime of parent.
|
closeTime of parent.
|
||||||
|
|
||||||
|
If `hold` is not nullptr, retains
|
||||||
|
ownership of a copy of `hold` until
|
||||||
|
the MetaView is destroyed.
|
||||||
|
|
||||||
It is only safe to use the BasicView modification
|
It is only safe to use the BasicView modification
|
||||||
functions. Using View modification functions will
|
functions. Using View modification functions will
|
||||||
break invariants.
|
break invariants.
|
||||||
@@ -145,7 +151,9 @@ public:
|
|||||||
ledger that this open ledger follows.
|
ledger that this open ledger follows.
|
||||||
*/
|
*/
|
||||||
MetaView (open_ledger_t,
|
MetaView (open_ledger_t,
|
||||||
BasicView const& parent);
|
BasicView const& parent,
|
||||||
|
std::shared_ptr<
|
||||||
|
void const> hold = nullptr);
|
||||||
|
|
||||||
/** Create a nested MetaView.
|
/** Create a nested MetaView.
|
||||||
|
|
||||||
@@ -154,7 +162,8 @@ public:
|
|||||||
The ViewInfo is copied from the base.
|
The ViewInfo is copied from the base.
|
||||||
*/
|
*/
|
||||||
MetaView (BasicView const& base,
|
MetaView (BasicView const& base,
|
||||||
ViewFlags flags);
|
ViewFlags flags, std::shared_ptr<
|
||||||
|
void const> hold = nullptr);
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -55,14 +55,18 @@ MetaView::MetaView (shallow_copy_t,
|
|||||||
, items_ (other.items_)
|
, items_ (other.items_)
|
||||||
, destroyedCoins_(
|
, destroyedCoins_(
|
||||||
other.destroyedCoins_)
|
other.destroyedCoins_)
|
||||||
|
, hold_(other.hold_)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
MetaView::MetaView (open_ledger_t,
|
MetaView::MetaView (open_ledger_t,
|
||||||
BasicView const& parent)
|
BasicView const& parent,
|
||||||
|
std::shared_ptr<
|
||||||
|
void const> hold)
|
||||||
: base_ (parent)
|
: base_ (parent)
|
||||||
, flags_ (tapNONE)
|
, flags_ (tapNONE)
|
||||||
, info_ (parent.info())
|
, info_ (parent.info())
|
||||||
|
, hold_(std::move(hold))
|
||||||
{
|
{
|
||||||
assert(! parent.open());
|
assert(! parent.open());
|
||||||
info_.open = true;
|
info_.open = true;
|
||||||
@@ -72,10 +76,12 @@ MetaView::MetaView (open_ledger_t,
|
|||||||
}
|
}
|
||||||
|
|
||||||
MetaView::MetaView (BasicView const& base,
|
MetaView::MetaView (BasicView const& base,
|
||||||
ViewFlags flags)
|
ViewFlags flags, std::shared_ptr<
|
||||||
|
void const> hold)
|
||||||
: base_ (base)
|
: base_ (base)
|
||||||
, flags_ (flags)
|
, flags_ (flags)
|
||||||
, info_ (base.info())
|
, info_ (base.info())
|
||||||
|
, hold_(std::move(hold))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user