mirror of
https://github.com/Zygo/bees.git
synced 2025-05-17 13:25:45 +02:00
progress: lock down some const methods
begin() and end() don't mutate their object Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
parent
d0c35b4734
commit
a3d2bc26d5
@ -20,8 +20,8 @@ namespace crucible {
|
||||
using ProgressHolder = shared_ptr<ProgressHolderState>;
|
||||
|
||||
ProgressTracker(const value_type &v);
|
||||
value_type begin();
|
||||
value_type end();
|
||||
value_type begin() const;
|
||||
value_type end() const;
|
||||
|
||||
ProgressHolder hold(const value_type &v);
|
||||
|
||||
@ -51,7 +51,7 @@ namespace crucible {
|
||||
|
||||
template <class T>
|
||||
typename ProgressTracker<T>::value_type
|
||||
ProgressTracker<T>::begin()
|
||||
ProgressTracker<T>::begin() const
|
||||
{
|
||||
unique_lock<mutex> lock(m_state->m_mutex);
|
||||
return m_state->m_begin;
|
||||
@ -59,7 +59,7 @@ namespace crucible {
|
||||
|
||||
template <class T>
|
||||
typename ProgressTracker<T>::value_type
|
||||
ProgressTracker<T>::end()
|
||||
ProgressTracker<T>::end() const
|
||||
{
|
||||
unique_lock<mutex> lock(m_state->m_mutex);
|
||||
return m_state->m_end;
|
||||
|
Loading…
x
Reference in New Issue
Block a user