0031763: Foundation Classes - reporting of progress within parallel algorithms
[occt.git] / src / Message / Message_ProgressSentry.hxx
CommitLineData
7e785937 1// Copyright (c) 2020 OPEN CASCADE SAS
42cf5bc1 2//
3// This file is part of Open CASCADE Technology software library.
4//
5// This library is free software; you can redistribute it and/or modify it under
6// the terms of the GNU Lesser General Public License version 2.1 as published
7// by the Free Software Foundation, with special exception defined in the file
8// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9// distribution for complete text of the license and disclaimer of any warranty.
10//
11// Alternatively, this file may be used under the terms of Open CASCADE
12// commercial license or contractual agreement.
13
7e785937 14#ifndef Message_ProgressSentry_HeaderFile
15#define Message_ProgressSentry_HeaderFile
42cf5bc1 16
7e785937 17#include <Message_ProgressScope.hxx>
42cf5bc1 18
7e785937 19//! Functionality of this class (Message_ProgressSentry) has been superseded by Message_ProgressScope.
20//! This class is kept just to simplify transition of an old code and will be removed in future.
21class Standard_DEPRECATED("Deprecated class, Message_ProgressScope should be used instead")
22Message_ProgressSentry : public Message_ProgressScope
42cf5bc1 23{
24public:
7e785937 25 //! Deprecated constructor, Message_ProgressScope should be created instead.
26 Message_ProgressSentry (const Message_ProgressRange& theRange,
27 const Standard_CString theName,
28 const Standard_Real theMin,
29 const Standard_Real theMax,
30 const Standard_Real theStep,
31 const Standard_Boolean theIsInf = Standard_False,
32 const Standard_Real theNewScopeSpan = 0.0)
33 : Message_ProgressScope (theRange, theName, theMax, theIsInf)
34 {
35 if (theMin != 0.0 || theStep != 1.0 || theNewScopeSpan != 0.0)
36 {
37 throw Standard_ProgramError ("Message_ProgressSentry, invalid parameters");
38 }
39 }
42cf5bc1 40
7a3e8aad 41 //! Method Relieve() was replaced by Close() in Message_ProgressScope
42 void Relieve () { Close(); }
43
42cf5bc1 44private:
7e785937 45 //! Message_ProgressRange should be passed to constructor instead of Message_ProgressIndicator.
46 Message_ProgressSentry (const Handle(Message_ProgressIndicator)& theProgress,
47 const Standard_CString theName,
48 const Standard_Real theMin,
49 const Standard_Real theMax,
50 const Standard_Real theStep,
51 const Standard_Boolean theIsInf = Standard_False,
52 const Standard_Real theNewScopeSpan = 0.0);
42cf5bc1 53};
54
7e785937 55#endif // Message_ProgressSentry_HeaderFile