|
KiCad PCB EDA Suite
|
The transfers running on one repository, so every window can show and cancel the others'. More...
#include <git_transfer_busy.h>
Classes | |
| class | HOLD |
| One transfer's hold on its repository, released when reset, begun again or destroyed. More... | |
| struct | LIVE |
Public Member Functions | |
| bool | IsBusy (const HOLD &aExcept) const |
| True while a transfer other than aExcept's is live. | |
| wxString | Status (const HOLD &aExcept) const |
| The status of the latest live transfer other than aExcept's, or empty when none is. | |
| bool | CanCancel (const HOLD &aExcept) const |
| True while a live transfer other than aExcept's has a cancel that has not been called. | |
| void | CancelAll () |
| Call each live transfer's cancel once. They stay live until their owners end them. | |
| void | SubscribeUnmanaged (GIT_TRANSFER_WATCHER *aObserver) |
| Add a subscription without RAII link. | |
| LINK | Subscribe (GIT_TRANSFER_WATCHER *aObserver) |
| Add a subscription returning an RAII link. | |
| void | Unsubscribe (GIT_TRANSFER_WATCHER *aObserver) |
| Cancel the subscription of a subscriber. | |
| void | Notify (void(GIT_TRANSFER_WATCHER::*Ptr)(Args1...), Args2 &&... aArgs) |
| Notify event to all subscribed observers. | |
| void | NotifyIgnore (void(GIT_TRANSFER_WATCHER::*Ptr)(Args1...), GIT_TRANSFER_WATCHER *aIgnore, Args2 &&... aArgs) |
| Notify event to all subscribed observers but one to be ignore. | |
| size_t | size () const |
Protected Member Functions | |
| void | on_observers_empty () |
| void | enter_iteration () |
| void | leave_iteration () |
| void | add_observer (void *observer) |
| void | remove_observer (void *observer) |
Protected Attributes | |
| std::shared_ptr< IMPL > | impl_ |
Private Member Functions | |
| void | allocate_impl () |
| void | allocate_shared_impl () |
| void | deallocate_impl () |
| std::shared_ptr< IMPL > | get_shared_impl () |
Private Attributes | |
| std::map< uint64_t, LIVE > | m_live |
| Keyed by an id that only grows, so the last entry is the latest transfer. | |
The transfers running on one repository, so every window can show and cancel the others'.
UI thread only.
An Advanced Git fetch and force push can overlap, so neither may end the busy state or replace the cancel of the other.
Definition at line 52 of file git_transfer_busy.h.
|
protectedinherited |
Definition at line 216 of file observable.cpp.
References allocate_impl(), and impl_.
|
privateinherited |
|
privateinherited |
| bool GIT_TRANSFER_BUSY::CanCancel | ( | const HOLD & | aExcept | ) | const |
True while a live transfer other than aExcept's has a cancel that has not been called.
Definition at line 71 of file git_transfer_busy.cpp.
References GIT_TRANSFER_BUSY::HOLD::m_id, and m_live.
Referenced by GIT_COMMIT_PANE::othersCanCancel().
| void GIT_TRANSFER_BUSY::CancelAll | ( | ) |
Call each live transfer's cancel once. They stay live until their owners end them.
Definition at line 83 of file git_transfer_busy.cpp.
References cancel, and m_live.
Referenced by GIT_COMMIT_PANE::onPull().
|
privateinherited |
Definition at line 204 of file observable.cpp.
References impl_.
Referenced by on_observers_empty().
|
protectedinherited |
Definition at line 230 of file observable.cpp.
References impl_.
Referenced by UTIL::OBSERVABLE< ObserverInterface >::Notify(), and UTIL::OBSERVABLE< ObserverInterface >::NotifyIgnore().
|
privateinherited |
Definition at line 209 of file observable.cpp.
References allocate_shared_impl(), and impl_.
Referenced by OBSERVABLE_BASE().
| bool GIT_TRANSFER_BUSY::IsBusy | ( | const HOLD & | aExcept | ) | const |
True while a transfer other than aExcept's is live.
Definition at line 53 of file git_transfer_busy.cpp.
References GIT_TRANSFER_BUSY::HOLD::m_id, and m_live.
Referenced by GIT_COMMIT_PANE::othersBusy().
|
protectedinherited |
Definition at line 237 of file observable.cpp.
References impl_.
Referenced by UTIL::OBSERVABLE< ObserverInterface >::Notify(), and UTIL::OBSERVABLE< ObserverInterface >::NotifyIgnore().
|
inlineinherited |
Notify event to all subscribed observers.
| Ptr | is a pointer to method of the observer interface. |
| aArgs | is a list of arguments to each notification call, will be perfectly forwarded. |
Definition at line 178 of file observable.h.
|
inlineinherited |
Notify event to all subscribed observers but one to be ignore.
| Ptr | is a pointer to method of the observer interface. |
| aIgnore | is an observer to ignore during this notification. |
| aArgs | is a list of arguments to each notification call, will be perfectly forwarded. |
Definition at line 214 of file observable.h.
|
protectedinherited |
Definition at line 258 of file observable.cpp.
References deallocate_impl().
|
protectedinherited |
Definition at line 223 of file observable.cpp.
References impl_.
|
inherited |
Definition at line 249 of file observable.cpp.
References impl_.
Referenced by BOOST_AUTO_TEST_CASE().
| wxString GIT_TRANSFER_BUSY::Status | ( | const HOLD & | aExcept | ) | const |
The status of the latest live transfer other than aExcept's, or empty when none is.
Definition at line 59 of file git_transfer_busy.cpp.
References GIT_TRANSFER_BUSY::HOLD::m_id, and m_live.
Referenced by GIT_COMMIT_PANE::othersStatus().
|
inlineinherited |
Add a subscription returning an RAII link.
| aObserver | observer to subscribe |
Definition at line 153 of file observable.h.
|
inlineinherited |
Add a subscription without RAII link.
| aObserver | Observer to subscribe. |
Definition at line 142 of file observable.h.
|
inlineinherited |
Cancel the subscription of a subscriber.
This can be called during notification calls.
| aObserver | observer to remove from the subscription list. |
Definition at line 166 of file observable.h.
|
protectedinherited |
Definition at line 89 of file observable.h.
Referenced by add_observer(), allocate_impl(), allocate_shared_impl(), deallocate_impl(), enter_iteration(), get_shared_impl(), leave_iteration(), UTIL::OBSERVABLE< ObserverInterface >::Notify(), UTIL::OBSERVABLE< ObserverInterface >::NotifyIgnore(), OBSERVABLE_BASE(), remove_observer(), size(), and UTIL::OBSERVABLE< ObserverInterface >::Subscribe().
|
private |
Keyed by an id that only grows, so the last entry is the latest transfer.
Definition at line 99 of file git_transfer_busy.h.
Referenced by GIT_TRANSFER_BUSY::HOLD::Begin(), CanCancel(), CancelAll(), IsBusy(), and Status().