M/c++_api/inc/DM/IControlObject.hpp
1 #pragma once
2 
3 #include "DM/config.hpp"
4 #include "DM/Handle.hpp"
5 #include "DM/ObjectBase.hpp"
6 
7 DM_NAMESPACE_BEGIN
8 
9 /// \brief Control object are used to get status information of extensive processing step and/or to interrupt those processing steps
10 class DM_API IControlObject : public ObjectBase
11 {
12 public:
13  /// creates an control object for the standard output
14  static IControlObject* NewStdOut(bool clearAfterFinish = false, int updatePrecision = 0);
15  /// creates an control object for the standard output with callbacks
16  static IControlObject* NewStdOut(void *callbackObj, bool (*isInterrupted)(void *), void (*setStepCount)(void *, long long), void (*setCurrStep)(void *, long long), bool clearAfterFinish = false, int updatePrecision = 0);
17 
18  /// creates an 'silent' control object which doesn't make any output
19  static IControlObject* NewSilent();
20  /// creates an 'silent' control object which doesn't make any output but with callbacks
21  static IControlObject* NewSilent(void *callbackObj, bool (*isInterrupted)(void *), void (*setStepCount)(void *, long long), void (*setCurrStep)(void *, long long));
22 
23 protected:
24  virtual ~IControlObject() {}
25 
26 public:
27  virtual IControlObject *clone() const = 0;
28 
29  /// set overall step count
30  virtual void stepCount( int64_t stepCount ) = 0;
31  /// get overall step count
32  virtual int64_t stepCount() const = 0;
33 
34  /// set current step
35  virtual void currentStep( int64_t currStep ) = 0;
36  /// increase current step
37  virtual void increaseCurrentStep( int64_t incCount = 1 ) = 0;
38  /// get current step
39  virtual int64_t currentStep() const = 0;
40  /// returns current step in [%]
41  virtual double currentStepPercentage() const = 0;
42 
43  /// set the interrupt flag
44  virtual void interrupt( bool flag ) = 0;
45  /// returns the interrupt flag
46  virtual bool interrupted() const = 0;
47 
48  /// set the finished flag
49  virtual void finish( bool flag ) = 0;
50  /// returns the finished flag
51  virtual bool finished() const = 0;
52 };
53 
54 
56 
57 DM_NAMESPACE_END
Control object are used to get status information of extensive processing step and/or to interrupt th...
Definition: M/c++_api/inc/DM/IControlObject.hpp:10
Smart pointer class using reference counting with support for DM objects (see ObjectBase)
Definition: Handle.hpp:75
Definition: M/c++_api/inc/DM/ObjectBase.hpp:8
@ interrupted
export was interrupted