KiCad PCB EDA Suite
Loading...
Searching...
No Matches
GIT_TRANSFER_BUSY Class Reference

The transfers running on one repository, so every window can show and cancel the others'. More...

#include <git_transfer_busy.h>

Inheritance diagram for GIT_TRANSFER_BUSY:
UTIL::OBSERVABLE< GIT_TRANSFER_WATCHER > UTIL::DETAIL::OBSERVABLE_BASE

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.
 

Detailed Description

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.

Member Function Documentation

◆ add_observer()

void UTIL::DETAIL::OBSERVABLE_BASE::add_observer ( void * observer)
protectedinherited

Definition at line 216 of file observable.cpp.

References allocate_impl(), and impl_.

◆ allocate_impl()

void UTIL::DETAIL::OBSERVABLE_BASE::allocate_impl ( )
privateinherited

Definition at line 188 of file observable.cpp.

References impl_.

Referenced by add_observer().

◆ allocate_shared_impl()

void UTIL::DETAIL::OBSERVABLE_BASE::allocate_shared_impl ( )
privateinherited

Definition at line 195 of file observable.cpp.

References impl_.

Referenced by get_shared_impl().

◆ CanCancel()

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().

◆ CancelAll()

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().

◆ deallocate_impl()

void UTIL::DETAIL::OBSERVABLE_BASE::deallocate_impl ( )
privateinherited

Definition at line 204 of file observable.cpp.

References impl_.

Referenced by on_observers_empty().

◆ enter_iteration()

void UTIL::DETAIL::OBSERVABLE_BASE::enter_iteration ( )
protectedinherited

◆ get_shared_impl()

std::shared_ptr< OBSERVABLE_BASE::IMPL > UTIL::DETAIL::OBSERVABLE_BASE::get_shared_impl ( )
privateinherited

Definition at line 209 of file observable.cpp.

References allocate_shared_impl(), and impl_.

Referenced by OBSERVABLE_BASE().

◆ IsBusy()

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().

◆ leave_iteration()

void UTIL::DETAIL::OBSERVABLE_BASE::leave_iteration ( )
protectedinherited

◆ Notify()

void UTIL::OBSERVABLE< GIT_TRANSFER_WATCHER >::Notify ( void(GIT_TRANSFER_WATCHER::* Ptr )(Args1...),
Args2 &&... aArgs )
inlineinherited

Notify event to all subscribed observers.

Parameters
Ptris a pointer to method of the observer interface.
aArgsis a list of arguments to each notification call, will be perfectly forwarded.

Definition at line 178 of file observable.h.

◆ NotifyIgnore()

void UTIL::OBSERVABLE< GIT_TRANSFER_WATCHER >::NotifyIgnore ( void(GIT_TRANSFER_WATCHER::* Ptr )(Args1...),
GIT_TRANSFER_WATCHER * aIgnore,
Args2 &&... aArgs )
inlineinherited

Notify event to all subscribed observers but one to be ignore.

Parameters
Ptris a pointer to method of the observer interface.
aIgnoreis an observer to ignore during this notification.
aArgsis a list of arguments to each notification call, will be perfectly forwarded.

Definition at line 214 of file observable.h.

◆ on_observers_empty()

void UTIL::DETAIL::OBSERVABLE_BASE::on_observers_empty ( )
protectedinherited

Definition at line 258 of file observable.cpp.

References deallocate_impl().

◆ remove_observer()

void UTIL::DETAIL::OBSERVABLE_BASE::remove_observer ( void * observer)
protectedinherited

Definition at line 223 of file observable.cpp.

References impl_.

◆ size()

size_t UTIL::DETAIL::OBSERVABLE_BASE::size ( ) const
inherited

Definition at line 249 of file observable.cpp.

References impl_.

Referenced by BOOST_AUTO_TEST_CASE().

◆ Status()

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().

◆ Subscribe()

LINK UTIL::OBSERVABLE< GIT_TRANSFER_WATCHER >::Subscribe ( GIT_TRANSFER_WATCHER * aObserver)
inlineinherited

Add a subscription returning an RAII link.

Parameters
aObserverobserver to subscribe
Returns
RAII link controlling the lifetime of the subscription

Definition at line 153 of file observable.h.

◆ SubscribeUnmanaged()

void UTIL::OBSERVABLE< GIT_TRANSFER_WATCHER >::SubscribeUnmanaged ( GIT_TRANSFER_WATCHER * aObserver)
inlineinherited

Add a subscription without RAII link.

Parameters
aObserverObserver to subscribe.

Definition at line 142 of file observable.h.

◆ Unsubscribe()

void UTIL::OBSERVABLE< GIT_TRANSFER_WATCHER >::Unsubscribe ( GIT_TRANSFER_WATCHER * aObserver)
inlineinherited

Cancel the subscription of a subscriber.

This can be called during notification calls.

Parameters
aObserverobserver to remove from the subscription list.

Definition at line 166 of file observable.h.

Member Data Documentation

◆ impl_

◆ m_live

std::map<uint64_t, LIVE> GIT_TRANSFER_BUSY::m_live
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().


The documentation for this class was generated from the following files: