Refactor treatment of Ledger:

All handling of Ledger in shared_ptr is modified to
use a const managed object when the context requires
immutable semantics.
This commit is contained in:
Nik Bougalis
2016-02-21 16:56:18 -05:00
parent 77a4218a9e
commit 34e85ccb62
50 changed files with 788 additions and 782 deletions

View File

@@ -94,7 +94,6 @@ OpenView::OpenView (open_ledger_t,
, base_ (base)
, hold_ (std::move(hold))
{
info_.open = true;
info_.validated = false;
info_.accepted = false;
info_.seq = base_->info().seq + 1;
@@ -108,6 +107,7 @@ OpenView::OpenView (ReadView const* base,
, info_ (base->info())
, base_ (base)
, hold_ (std::move(hold))
, open_ (base->open())
{
}
@@ -192,18 +192,16 @@ auto
OpenView::txsBegin() const ->
std::unique_ptr<txs_type::iter_base>
{
return std::make_unique<
txs_iter_impl>(
closed(), txs_.cbegin());
return std::make_unique<txs_iter_impl>(
!open(), txs_.cbegin());
}
auto
OpenView::txsEnd() const ->
std::unique_ptr<txs_type::iter_base>
{
return std::make_unique<
txs_iter_impl>(
closed(), txs_.cend());
return std::make_unique<txs_iter_impl>(
!open(), txs_.cend());
}
bool