Structure Description: ProgressCallback#
-
struct ProgressCallback#
A simple callback which can be attached to some of the most common read/write operations to query the status of the operation during execution especially when its a long running task. This querying should be done asynchronously by either launching the read/write asynchronously or in a different thread. The default constructor is the one that the user should be using most of the time as the called code will take over to calculate and set the max value as well as incrementing the counter.
See the “ProgressCallback” example in the PhotoshopExamples/ folder of the repository for more information on how this can be achieved
Public Functions
-
ProgressCallback() = default#
Default ctor.
-
inline ProgressCallback(size_t maxElement)#
Initialize the progress callback with a maximum number of elements.
-
inline ~ProgressCallback()#
On destruction check if m_Count was able to reach m_Max, otherwise raise a warning.
-
inline float getProgress() const noexcept#
Get the current progress of the callback from 0-1 where 1 represents completion.
-
inline std::string getTask() const noexcept#
Get the current task the PhotoshopAPI is working on, this may be empty.
-
inline std::string_view getTaskView() const noexcept#
Get the current task the PhotoshopAPI is working on, this may be empty.
-
inline bool isComplete() const noexcept#
Query whether the current progress is completed or if it is still running.
-
ProgressCallback() = default#