ProgressScope ProgressScope.hxx cadex/Base/ProgressScope.hxx. More...
Static Protected Member Functions | |
_close (obj) | |
ProgressScope ProgressScope.hxx cadex/Base/ProgressScope.hxx.
Represents a node in a hierarchy of progress scopes.
Scopes can be used to recursively split the range of ProgressStatus object. Scopes can only be created on stack (i.e. they cannot be dynamically allocated on heap). Base_ProgressStatus internally maintains a stack of created scopes. Whenever a scope is destroyed it notifies its parent by incrementing its value, the parent notifies its own parent and so on up to the ProgressStatus object itself.
Each scope has a range which is by default [0, 100]. A child scope is created as a portion of the parent scope (specified in the constructor). This weight information is used to compute increment in the parent range when the child scope's value changes.
The scope can be created either specifying a ProgressStatus object (in this case a parent scope will be automatically found) or with explicitly defined parent. The latter approach is required to support multi-threaded mode.
Example of usage:
As there can be only one current scope in the current thread, then the scope must be destroyed before its sibling can be created. Otherwise the sibling will interpret the previous scope as its parent resulting in wrong updated value. To do so, the explicit C++ scope constructions can be used as demonstrated in the example above.