Callback Structures
Long running main operations all allow the passing of an optional callback for use in receiving status updates from resources.
-
using CarbonResources::StatusCallback = std::function<void(StatusLevel statusLevel, StatusProgressType statusProgressType, unsigned int progress, const std::string &info)>
Status Callback function signature.
- Param statusLevel:
The status granularity level for the update.
- Param statusProgressType:
Type of progress update to expect in update. Affects how progress parameter may be interpreted.
- Param progress:
Progress, format is inferred from statusProgressType.
- Param info:
Update message string.
-
enum class CarbonResources::StatusProgressType
Type of progress reported in callback.
Values:
-
enumerator UNBOUNDED
Status update with unbounded progress. When set the progress integer doesn’t report progress.
-
enumerator PERCENTAGE
Status update with accompanying percentage progress. When set the progress integer reports percentage complete.
-
enumerator WARNING
Warning message. When set the progress integer doesn’t report progress
-
enumerator UNBOUNDED