libzypp: zyppng::ProgressObserver Class Reference

libzypp 17.38.5

zyppng::ProgressObserver Class Reference

`#include <zypp-core/ng/ui/progressobserver.h>`

Inheritance diagram for zyppng::ProgressObserver:

## Public Types
enum | FinishResult { Success , Error }
Public Types inherited from zyppng::Base
using | Ptr = std::shared_ptr<Base>
using | WeakPtr = std::weak_ptr<Base>

## Public Member Functions
| ZYPP_DECL_PRIVATE_CONSTR_ARGS (ProgressObserver, const std::string &label=std::string(), int steps=100)
void | setBaseSteps (int steps)
int | baseSteps () const
int | steps () const
bool | started () const
void | start ()
void | reset ()
void | setCurrent (double curr)
void | setFinished (FinishResult result=Success)
void | inc (double inc=1.0, const std::optional< std::string > &newLabel={})
double | progress () const
double | current () const
const std::vector< zyppng::ProgressObserverRef > & | children ()
void | setLabel (const std::string &label)
const std::string & | label () const
void | registerSubTask (const ProgressObserverRef &child, float weight=1.0)
ProgressObserverRef | makeSubTask (float weight=1.0, const std::string &label=std::string(), int steps=100)
zypp::ProgressData::ReceiverFnc | makeProgressDataReceiver ()
SignalProxy< void(ProgressObserver &sender)> | sigStarted ()
SignalProxy< void(ProgressObserver &sender, const std::string &str)> | sigLabelChanged ()
SignalProxy< void(ProgressObserver &sender, double steps)> | sigStepsChanged ()
SignalProxy< void(ProgressObserver &sender, double current) > | sigValueChanged ()
SignalProxy< void(ProgressObserver &sender, double progress)> | sigProgressChanged ()
SignalProxy< void(ProgressObserver &sender, FinishResult result)> | sigFinished ()
SignalProxy< void(ProgressObserver &sender, ProgressObserverRef child)> | sigNewSubprogress ()
Public Member Functions inherited from zyppng::Base
| Base ()
virtual | ~Base ()
WeakPtr | parent () const
void | addChild (const Base::Ptr &child)
void | removeChild (const Ptr &child)
const std::unordered_set< Ptr > & | children () const
std::thread::id | threadId () const
template<typename T>
std::vector< std::weak_ptr< T > > | findChildren () const
template<typename T>
std::shared_ptr< T > | shared_this () const
template<typename T>
std::shared_ptr< T > | shared_this ()
template<typename T>
std::weak_ptr< T > | weak_this () const
template<typename T>
std::weak_ptr< T > | weak_this ()
template<typename SenderFunc, typename ReceiverFunc>
auto | connect (SenderFunc &&sFun, typename internal::MemberFunction< ReceiverFunc >::ClassType &recv, ReceiverFunc &&rFunc)
template<typename SenderFunc, typename ReceiverFunc, typename ... Tracker>
std::enable_if_t< std::is_member_function_pointer_v< SenderFunc >, connection > | connectFunc (SenderFunc &&sFun, ReceiverFunc &&rFunc, const Tracker &...trackers)

## Static Public Member Functions
static ProgressObserverRef | makeSubTask (ProgressObserverRef parentProgress, float weight=1.0, const std::string &label=std::string(), int steps=100)
static void | start (ProgressObserverRef progress)
static void | setup (ProgressObserverRef progress, const std::string &label=std::string(), int steps=100)
static void | increase (ProgressObserverRef progress, double inc=1.0, const std::optional< std::string > &newLabel={})
static void | setCurrent (ProgressObserverRef progress, double curr)
static void | setLabel (ProgressObserverRef progress, const std::string &label)
static void | setSteps (ProgressObserverRef progress, int steps)
static void | finish (ProgressObserverRef progress, ProgressObserver::FinishResult result=ProgressObserver::Success)
Static Public Member Functions inherited from zyppng::Base
template<typename Obj, typename Functor>
static decltype(auto) | make_base_slot (Obj *o, Functor &&f)
template<typename SenderFunc, typename ReceiverFunc>
static auto | connect (typename internal::MemberFunction< SenderFunc >::ClassType &s, SenderFunc &&sFun, typename internal::MemberFunction< ReceiverFunc >::ClassType &recv, ReceiverFunc &&rFunc)
template<typename SenderFunc, typename ReceiverFunc, typename ... Tracker>
static auto | connectFunc (typename internal::MemberFunction< SenderFunc >::ClassType &s, SenderFunc &&sFun, ReceiverFunc &&rFunc, const Tracker &...trackers)

## Additional Inherited Members
Protected Member Functions inherited from zyppng::Base
| Base (BasePrivate &dd)
Protected Attributes inherited from zyppng::Base
std::unique_ptr< BasePrivate > | d_ptr

## Detailed Description

Definition at line 27 of file progressobserver.h.

## Member Enumeration Documentation

## ◆ FinishResult

enum zyppng::ProgressObserver::FinishResult

Enumerator
Success |
Error |

Definition at line 34 of file progressobserver.h.

## Member Function Documentation

## ◆ ZYPP_DECL_PRIVATE_CONSTR_ARGS()

zyppng::ProgressObserver::ZYPP_DECL_PRIVATE_CONSTR_ARGS | ( | ProgressObserver | ,
|  | const std::string & | label = std::string(),
|  | int | steps = 100 )

## ◆ setBaseSteps()

void zyppng::ProgressObserver::setBaseSteps | ( | int | steps | ) |

Definition at line 241 of file progressobserver.cc.

## ◆ baseSteps()

int zyppng::ProgressObserver::baseSteps | ( |  | ) | const

Definition at line 270 of file progressobserver.cc.

## ◆ steps()

int zyppng::ProgressObserver::steps | ( |  | ) | const

Definition at line 153 of file progressobserver.cc.

## ◆ started()

bool zyppng::ProgressObserver::started | ( |  | ) | const

Definition at line 158 of file progressobserver.cc.

## ◆ start() [1/2]

void zyppng::ProgressObserver::start | ( |  | ) |

Tells the ProgressObserver to start sending signals on updates. If start was not called, no progress update or finished signals are emitted.

Calling start will also trigger all parent observers to be started, but not the children

Definition at line 163 of file progressobserver.cc.

## ◆ reset()

void zyppng::ProgressObserver::reset | ( |  | ) |

Definition at line 175 of file progressobserver.cc.

## ◆ setCurrent() [1/2]

void zyppng::ProgressObserver::setCurrent | ( | double | curr | ) |

Definition at line 258 of file progressobserver.cc.

## ◆ setFinished()

void zyppng::ProgressObserver::setFinished | ( | FinishResult | result = Success | ) |

Definition at line 275 of file progressobserver.cc.

## ◆ inc()

void zyppng::ProgressObserver::inc | ( | double | inc = 1.0,
|  | const std::optional< std::string > & | newLabel = {} )

Definition at line 295 of file progressobserver.cc.

## ◆ progress()

double zyppng::ProgressObserver::progress | ( |  | ) | const

Definition at line 186 of file progressobserver.cc.

## ◆ current()

double zyppng::ProgressObserver::current | ( |  | ) | const

Definition at line 191 of file progressobserver.cc.

## ◆ makeSubTask() [1/2]

ProgressObserverRef zyppng::ProgressObserver::makeSubTask | ( | ProgressObserverRef | parentProgress,
|  | float | weight = 1.0,
|  | const std::string & | label = std::string(),
|  | int | steps = 100 )
| inlinestatic

Definition at line 62 of file progressobserver.h.

## ◆ start() [2/2]

void zyppng::ProgressObserver::start | ( | ProgressObserverRef | progress | ) |
| inlinestatic

Definition at line 67 of file progressobserver.h.

## ◆ setup()

void zyppng::ProgressObserver::setup | ( | ProgressObserverRef | progress,
|  | const std::string & | label = std::string(),
|  | int | steps = 100 )
| inlinestatic

Definition at line 71 of file progressobserver.h.

## ◆ increase()

void zyppng::ProgressObserver::increase | ( | ProgressObserverRef | progress,
|  | double | inc = 1.0,
|  | const std::optional< std::string > & | newLabel = {} )
| inlinestatic

Definition at line 78 of file progressobserver.h.

## ◆ setCurrent() [2/2]

void zyppng::ProgressObserver::setCurrent | ( | ProgressObserverRef | progress,
|  | double | curr )
| inlinestatic

Definition at line 82 of file progressobserver.h.

## ◆ setLabel() [1/2]

void zyppng::ProgressObserver::setLabel | ( | ProgressObserverRef | progress,
|  | const std::string & | label )
| inlinestatic

Definition at line 86 of file progressobserver.h.

## ◆ setSteps()

void zyppng::ProgressObserver::setSteps | ( | ProgressObserverRef | progress,
|  | int | steps )
| inlinestatic

Definition at line 90 of file progressobserver.h.

## ◆ finish()

void zyppng::ProgressObserver::finish | ( | ProgressObserverRef | progress,
|  | ProgressObserver::FinishResult | result = ProgressObserver::Success )
| inlinestatic

Definition at line 94 of file progressobserver.h.

## ◆ children()

const std::vector< ProgressObserverRef > & zyppng::ProgressObserver::children | ( |  | ) |

Definition at line 196 of file progressobserver.cc.

## ◆ setLabel() [2/2]

void zyppng::ProgressObserver::setLabel | ( | const std::string & | label | ) |

Definition at line 253 of file progressobserver.cc.

## ◆ label()

const std::string & zyppng::ProgressObserver::label | ( |  | ) | const

Definition at line 201 of file progressobserver.cc.

## ◆ registerSubTask()

void zyppng::ProgressObserver::registerSubTask | ( | const ProgressObserverRef & | child,
|  | float | weight = 1.0 )

Definition at line 301 of file progressobserver.cc.

## ◆ makeSubTask() [2/2]

ProgressObserverRef zyppng::ProgressObserver::makeSubTask | ( | float | weight = 1.0,
|  | const std::string & | label = std::string(),
|  | int | steps = 100 )

Definition at line 330 of file progressobserver.cc.

## ◆ makeProgressDataReceiver()

zypp::ProgressData::ReceiverFnc zyppng::ProgressObserver::makeProgressDataReceiver | ( |  | ) |

Creates a new zypp::ProgressData::ReceiverFnc and links it to the current ProgressObserver, this can be used to interface with zypp code that was not yet migrated to the new ProgressObserver API.

Note
  the returned zypp::ProgressData::ReceiverFnc will keep a reference to the ProgressObserver

Definition at line 344 of file progressobserver.cc.

## ◆ sigStarted()

SignalProxy< void(ProgressObserver &)> zyppng::ProgressObserver::sigStarted | ( |  | ) |

Definition at line 206 of file progressobserver.cc.

## ◆ sigLabelChanged()

SignalProxy< void(ProgressObserver &, const std::string &)> zyppng::ProgressObserver::sigLabelChanged | ( |  | ) |

Definition at line 211 of file progressobserver.cc.

## ◆ sigStepsChanged()

SignalProxy< void(ProgressObserver &, double)> zyppng::ProgressObserver::sigStepsChanged | ( |  | ) |

Definition at line 216 of file progressobserver.cc.

## ◆ sigValueChanged()

SignalProxy< void(ProgressObserver &, double steps)> zyppng::ProgressObserver::sigValueChanged | ( |  | ) |

Definition at line 221 of file progressobserver.cc.

## ◆ sigProgressChanged()

SignalProxy< void(ProgressObserver &, double)> zyppng::ProgressObserver::sigProgressChanged | ( |  | ) |

Definition at line 226 of file progressobserver.cc.

## ◆ sigFinished()

SignalProxy< void(ProgressObserver &sender, ProgressObserver::FinishResult result)> zyppng::ProgressObserver::sigFinished | ( |  | ) |

Definition at line 231 of file progressobserver.cc.

## ◆ sigNewSubprogress()

SignalProxy< void(ProgressObserver &, ProgressObserverRef)> zyppng::ProgressObserver::sigNewSubprogress | ( |  | ) |

Definition at line 236 of file progressobserver.cc.

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

- zypp-core/ng/ui/progressobserver.h
- zypp-core/ng/ui/progressobserver.cc