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, bool open_interrupt_dialog=false)
31  {
32  return HOM().newInterruptableOperation(operation_name,
33  long_operation_name, open_interrupt_dialog);
34  }
35 }
36 #else
38  { HOM_CONSTRUCT_OBJECT(this) }
40  { HOM_CONSTRUCT_OBJECT(this) }
41 #endif
43  { HOM_DESTRUCT_OBJECT(this) }
44 
45  // Let swig know we're overriding __repr__ for this class so it doesn't
46  // provide its own __repr__.
47  virtual std::string __repr__() = 0;
48 
49  SWIGOUT(%kwargs updateLongProgress;)
50  virtual void updateLongProgress(double percentage=-1.0,
51  const char *long_op_status=NULL) = 0;
52 
53  SWIGOUT(%kwargs updateProgress;)
54  virtual void updateProgress(double percentage=-1.0) = 0;
55 
56  virtual HOM_InterruptableOperation *__enter__() = 0;
57 
58  SWIGOUT(%ignore opaqueExit;)
59  virtual void opaqueExit() = 0;
60 
61 #ifdef SWIG
62 %extend
63 {
64  // We can ignore the type, value, and traceback Python objects.
65  SWIGOUT(virtual void __exit__(
66  InterpreterObject type, InterpreterObject value,
67  InterpreterObject traceback)
68  { self->opaqueExit(); };)
69 }
70 #endif
71 
72 };
73 
74 #endif
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1303
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:349
#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:1302
HOM_InterruptableOperation(const HOM_InterruptableOperation &operation)
virtual HOM_InterruptableOperation * newInterruptableOperation(const char *operation_name, const char *long_operation_name, bool open_interrupt_dialog)=0
OIIO_UTIL_API bool rename(string_view from, string_view to, std::string &err)
Definition: core.h:1131
HOM_API HOM_Module & HOM()
type
Definition: core.h:1059