Progress: Progress class.

ProgressR Documentation

Progress class.

Description

A class for informing user about the progress of a process.

Details

This class displays progress of a process to user, and sends notifications of this progress to observers too.

Methods

Public methods


Method new()

Initializer.

Usage
Progress$new(biodb = NULL, msg, total = NA_integer_)
Arguments
biodb

A BiodbMain instance that will be used to notify observers of progress.

msg

The message to display to the user.

total

The total number of elements to process or NA if unknown.

Returns

Nothing.


Method increment()

Increment progress.

Usage
Progress$increment()
Returns

Nothing.


Method clone()

The objects of this class are cloneable with this method.

Usage
Progress$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

# Create an instance
prg <- biodb::Progress$new(msg='Processing data.', total=10L)

# Processing
for (i in seq_len(10)) {
    print("Doing something.")
    prg$increment()
}


pkrog/biodb documentation built on Nov. 29, 2022, 4:24 a.m.