0025619: CAST analysis: Avoid classes with a non-empty destructor and not implementin...
[occt.git] / src / Message / Message_ProgressSentry.cdl
CommitLineData
b311480e 1-- Created on: 2002-02-22
2-- Created by: Andrey BETENEV
973c2be1 3-- Copyright (c) 2002-2014 OPEN CASCADE SAS
b311480e 4--
973c2be1 5-- This file is part of Open CASCADE Technology software library.
b311480e 6--
d5f74e42 7-- This library is free software; you can redistribute it and/or modify it under
8-- the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 9-- by the Free Software Foundation, with special exception defined in the file
10-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11-- distribution for complete text of the license and disclaimer of any warranty.
b311480e 12--
973c2be1 13-- Alternatively, this file may be used under the terms of Open CASCADE
14-- commercial license or contractual agreement.
7fd59977 15
16class ProgressSentry from Message
17
18 ---Purpose: This class is a tool allowing to manage opening/closing
19 -- scopes in the ProgressIndicator in convenient and safe way.
20 --
21 -- Its main features are:
22 -- - Set all parameters for the current scale on the given
23 -- ProgressIndicator and open a new scope at one line
24 -- - Iterator-like interface to opening next scopes and
25 -- check for user break
26 -- - Automatic scope closing in destructor
27 -- - Safe for NULL ProgressIndicator (just does nothing)
28
29uses
30 HAsciiString from TCollection,
31 ProgressIndicator from Message
32
33is
34
35 Create (PI: ProgressIndicator from Message; name: CString;
36 min, max, step: Real; isInf: Boolean = Standard_False;
37 newScopeSpan: Real = 0.0);
38 Create (PI: ProgressIndicator from Message; name: HAsciiString from TCollection;
39 min, max, step: Real; isInf: Boolean = Standard_False;
40 newScopeSpan: Real = 0.0);
41 ---Purpose: Creates an instance of ProgressSentry attaching it to
42 -- the specified ProgressIndicator, selects parameters of
43 -- the current scale, and opens a new scope with specified
44 -- span (equal to step by default)
45
46 Relieve (me: in out);
47 ---C++: inline
48 ---C++: alias ~
49 ---Purpose: Moves progress indicator to the end of the current scale
50 -- and relieves sentry from its duty. Methods other than Show()
51 -- will do nothing after this one is called.
52
53 Next (me; name: CString = 0);
54 ---C++: inline
55 Next (me; span: Real; name: CString = 0);
56 ---C++: inline
57 Next (me; span: Real; name: HAsciiString from TCollection);
58 ---C++: inline
59 ---Purpose: Closes current scope and opens next one
60 -- with either specified or default span
61
62 More (me) returns Boolean;
63 ---C++: inline
64 ---Purpose: Returns False if ProgressIndicator signals UserBreak
65
66 Show (me);
67 ---C++: inline
68 ---Purpose: Forces update of progress indicator display
69
70fields
71
72 myProgress: ProgressIndicator from Message;
73 myActive: Boolean; -- True if ProgressIndicator is non-Null and scope is opened
74
75end ProgressSentry;
76