HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_InterruptableOperation.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * COMMENTS:
7  * Class used to turn any Python code block into an interruptable
8  * operation.
9  */
10 
11 #ifndef __HOM_InterruptableOperation_h__
12 #define __HOM_InterruptableOperation_h__
13 
14 #include "HOM_API.h"
15 #include "HOM_Errors.h"
16 #include "HOM_Module.h"
17 
18 SWIGOUT(%feature("notabstract") HOM_InterruptableOperation;)
19 SWIGOUT(%rename(InterruptableOperation) HOM_InterruptableOperation;)
20 
22 {
23 public:
24 
25 #ifdef SWIG
26 %extend
27 {
29  HOM_InterruptableOperation(const char *operation_name,
30  const char *long_operation_name=NULL,
31  bool open_interrupt_dialog=false,
32  int timeout_ms=0)
33  {
34  return HOM().newInterruptableOperation(operation_name,
35  long_operation_name, open_interrupt_dialog, timeout_ms);
36  }
37 }
38 #else
40  { HOM_CONSTRUCT_OBJECT(this) }
42  { HOM_CONSTRUCT_OBJECT(this) }
43 #endif
45  { HOM_DESTRUCT_OBJECT(this) }
46 
47  // Let swig know we're overriding __repr__ for this class so it doesn't
48  // provide its own __repr__.
49  virtual std::string __repr__() = 0;
50 
51  SWIGOUT(%kwargs updateLongProgress;)
52  virtual void updateLongProgress(double percentage=-1.0,
53  const char *long_op_status=NULL) = 0;
54 
55  SWIGOUT(%kwargs updateProgress;)
56  virtual void updateProgress(double percentage=-1.0) = 0;
57 
58  virtual HOM_InterruptableOperation *__enter__() = 0;
59 
60  SWIGOUT(%ignore opaqueExit;)
61  virtual void opaqueExit() = 0;
62 
63 #ifdef SWIG
64 %extend
65 {
66  // We can ignore the type, value, and traceback Python objects.
67  SWIGOUT(virtual void __exit__(
68  InterpreterObject type, InterpreterObject value,
69  InterpreterObject traceback)
70  { self->opaqueExit(); };)
71 }
72 #endif
73 
74 };
75 
76 #endif
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1343
GLsizei const GLfloat * value
Definition: glcorearb.h:824
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:312
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:108
#define HOM_API
Definition: HOM_API.h:13
void ignore(T const &) VULKAN_HPP_NOEXCEPT
Definition: vulkan.hpp:6508
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1342
virtual HOM_InterruptableOperation * newInterruptableOperation(const char *operation_name, const char *long_operation_name, bool open_interrupt_dialog, int timeout_ms)=0
HOM_InterruptableOperation(const HOM_InterruptableOperation &operation)
OIIO_UTIL_API bool rename(string_view from, string_view to, std::string &err)
HOM_API HOM_Module & HOM()