Notcurses 3.0.13
a blingful library for TUIs and character graphics
Loading...
Searching...
No Matches
Progbar Class Reference

#include <Progbar.hh>

Inheritance diagram for Progbar:
Collaboration diagram for Progbar:

Public Member Functions

 Progbar (Plane &n, const ncprogbar_options *opts)
 
 ~Progbar ()
 
Planeget_plane () const noexcept
 
void set_progress (double p) const noexcept
 
double get_progress () const noexcept
 
- Public Member Functions inherited from Root
notcursesget_notcurses () const
 
NotCursesget_notcurses_cpp () const
 

Additional Inherited Members

- Protected Member Functions inherited from Root
 Root (NotCurses *ncinst)
 
bool is_notcurses_stopped () const noexcept
 
- Static Protected Member Functions inherited from Root
template<typename TRet = bool, typename TValue = int>
static TRet error_guard (TValue ret, TValue error_value)
 
template<typename TRet = bool, typename TValue = int>
static TRet error_guard_cond (TValue ret, bool error_value)
 
- Static Protected Attributes inherited from Root
static constexpr char ncpp_invalid_state_message [] = "notcurses++ is in an invalid state (already stopped?)"
 

Detailed Description

Definition at line 12 of file Progbar.hh.

Constructor & Destructor Documentation

◆ Progbar()

Progbar ( Plane n,
const ncprogbar_options opts 
)
inline

Definition at line 15 of file Progbar.hh.

16 : Root (nullptr)
17 {
18 if (opts == nullptr) {
19 throw invalid_argument ("Argument 'opts' must be a valid pointer");
20 }
21
22 progbar = ncprogbar_create (n, opts);
23 if (progbar == nullptr) {
24 throw init_error ("Notcurses failed to create ncprogbar");
25 }
26 }
Root(NotCurses *ncinst)
Definition Root.hh:34
const struct ncplane_options * opts
Definition notcurses.h:3483
vopts n
Definition notcurses.h:3502
ncprogbar * ncprogbar_create(ncplane *n, const ncprogbar_options *opts)
Definition progbar.c:4
Here is the call graph for this function:

◆ ~Progbar()

~Progbar ( )
inline

Definition at line 28 of file Progbar.hh.

29 {
30 if (!is_notcurses_stopped ()) {
31 ncprogbar_destroy (progbar);
32 }
33 }
bool is_notcurses_stopped() const noexcept
void ncprogbar_destroy(ncprogbar *n)
Definition progbar.c:190
Here is the call graph for this function:

Member Function Documentation

◆ get_plane()

Plane * get_plane ( ) const
inlinenoexcept

Definition at line 35 of file Progbar.hh.

36 {
37 ncplane *ret = ncprogbar_plane (progbar);
38 if (ret == nullptr) {
39 return nullptr;
40 }
41
42 return Plane::map_plane (ret);
43 }
static Plane * map_plane(ncplane *ncp, Plane *associated_plane=nullptr) noexcept
ncplane * ncprogbar_plane(ncprogbar *n)
Definition progbar.c:32
Here is the call graph for this function:

◆ get_progress()

double get_progress ( ) const
inlinenoexcept

Definition at line 50 of file Progbar.hh.

51 {
52 return ncprogbar_progress (progbar);
53 }
double ncprogbar_progress(const ncprogbar *n)
Definition progbar.c:186
Here is the call graph for this function:

◆ set_progress()

void set_progress ( double  p) const
inlinenoexcept

Definition at line 45 of file Progbar.hh.

46 {
47 ncprogbar_set_progress (progbar, p);
48 }
int ncprogbar_set_progress(ncprogbar *n, double p)
Definition progbar.c:176
Here is the call graph for this function:

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