Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose store snapshot to query interface. #467

Merged
merged 1 commit into from
May 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions include/bitcoin/database/impl/query/query.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ code CLASS::get_code() const NOEXCEPT
return is_full() ? error::disk_full : store_.get_fault();
}

TEMPLATE
code CLASS::snapshot(
const typename Store::event_handler& handler) const NOEXCEPT
{
return store_.snapshot(handler);
}

} // namespace database
} // namespace libbitcoin

Expand Down
6 changes: 6 additions & 0 deletions include/bitcoin/database/query.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ class query

query(Store& value) NOEXCEPT;

/// Store management from query-holder (not store owner) context.
/// -----------------------------------------------------------------------

/// True if disk is full and no other store error condition.
bool is_full() const NOEXCEPT;

Expand All @@ -91,6 +94,9 @@ class query
/// Get priority condition, error::disk_full if is_full, else first code.
code get_code() const NOEXCEPT;

/// Snapshot the store while running.
code snapshot(const typename Store::event_handler& handler) const NOEXCEPT;

/// Initialization (natural-keyed).
/// -----------------------------------------------------------------------
/// Not reliable during organization.
Expand Down
Loading