HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
PY_Result.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
* This class holds the result of python code that was run.
8
*/
9
10
#ifndef __PY_Result_h__
11
#define __PY_Result_h__
12
13
#include "
PY_API.h
"
14
#include "
PY_OpaqueObject.h
"
15
#include <
UT/UT_StringArray.h
>
16
#include <
UT/UT_StringHolder.h
>
17
#include <
UT/UT_Options.h
>
18
#include <
UT/UT_Variant.h
>
19
#include <vector>
20
21
// This class contains information about the return value of python code
22
// that was executed.
23
class
PY_API
PY_Result
24
{
25
public
:
26
PY_Result
()
27
: myResultType(
NONE
)
28
, myOpaquePyObject(nullptr)
29
, myVoidPtr(nullptr)
30
{}
31
32
UT_StringHolder
asStringForDebugging();
33
34
UT_Variant
myValue
;
35
36
// Errors (uncaught exceptions) and exit requests (because sys.exit()
37
// was called) are possible result types, in addition to the standard
38
// int, double, and string types. (Python uses doubles internally,
39
// so double is used instead of float.) If the python None object is
40
// returned or some other object is returned, the result type is "none".
41
// If you request a result type of PY_OBJECT, the raw PyObject * is
42
// set and it is up to you to decrement the reference count on it.
43
enum
Type
{ INT, DOUBLE, STRING, INT_ARRAY, DOUBLE_ARRAY, STRING_ARRAY,
44
OPTIONS, PY_OBJECT,
VOID_PTR
,
NONE
, EXIT, ERR, VARIANT };
45
Type
myResultType
;
46
47
// Type Fields Used
48
// ------- -----------
49
// INT myIntValue
50
// DOUBLE myDoubleValue
51
// STRING myStringValue
52
// INT_ARRAY myIntArray
53
// DOUBLE_ARRAY myDoubleArray
54
// STRING_ARRAY myStringArray
55
// OPTIONS myOptions
56
// PY_OBJECT myOpaquePyObject
57
// VOID_PTR myVoidPtr
58
// VARIANT myValue - Always filled in.
59
// NONE none
60
// EXIT myIntValue for exit code, myStringValue in case
61
// user called sys.exit() with a non-integer object
62
// ERR myDetailedErrValue for exception back trace
63
// myErrValue for a simplified error message
64
// myExceptionClass is the name of the exception (if any)
65
66
int
myIntValue
;
67
double
myDoubleValue
;
68
UT_StringHolder
myStringValue
;
69
std::vector<int>
myIntArray
;
70
std::vector<double>
myDoubleArray
;
71
UT_StringArray
myStringArray
;
72
UT_Options
myOptions
;
73
UT_StringHolder
myErrValue
;
74
UT_StringHolder
myDetailedErrValue
;
75
UT_StringHolder
myExceptionClass
;
76
PY_OpaqueObject
myOpaquePyObject
;
77
void
*
myVoidPtr
;
78
};
79
80
#endif
PY_Result::VOID_PTR
Definition:
PY_Result.h:44
PY_Result
Definition:
PY_Result.h:23
UT_Variant.h
PY_API.h
UT_StringArray.h
PY_Result::myValue
UT_Variant myValue
Definition:
PY_Result.h:34
PY_Result::myOptions
UT_Options myOptions
Definition:
PY_Result.h:72
UT_Options.h
PY_Result::myStringValue
UT_StringHolder myStringValue
Definition:
PY_Result.h:68
PY_Result::myOpaquePyObject
PY_OpaqueObject myOpaquePyObject
Definition:
PY_Result.h:76
UT_StringHolder
Definition:
UT_StringHolder.h:1009
UT_StringArray
Definition:
UT_StringArray.h:24
HUSD_TimeSampling::NONE
PY_Result::myIntArray
std::vector< int > myIntArray
Definition:
PY_Result.h:69
PY_Result::myDoubleArray
std::vector< double > myDoubleArray
Definition:
PY_Result.h:70
PY_API
#define PY_API
Definition:
PY_API.h:10
PY_Result::Type
Type
Definition:
PY_Result.h:43
PY_Result::myVoidPtr
void * myVoidPtr
Definition:
PY_Result.h:77
UT_Options
A map of string to various well defined value types.
Definition:
UT_Options.h:84
PY_Result::myErrValue
UT_StringHolder myErrValue
Definition:
PY_Result.h:73
UT_StringHolder.h
PY_OpaqueObject.h
PY_Result::myExceptionClass
UT_StringHolder myExceptionClass
Definition:
PY_Result.h:75
PY_Result::myDetailedErrValue
UT_StringHolder myDetailedErrValue
Definition:
PY_Result.h:74
PY_Result::PY_Result
PY_Result()
Definition:
PY_Result.h:26
PY_OpaqueObject
Definition:
PY_OpaqueObject.h:24
UT_Variant
Definition:
UT_Variant.h:204
PY_Result::myStringArray
UT_StringArray myStringArray
Definition:
PY_Result.h:71
PY_Result::myResultType
Type myResultType
Definition:
PY_Result.h:45
PY_Result::myDoubleValue
double myDoubleValue
Definition:
PY_Result.h:67
PY_Result::myIntValue
int myIntValue
Definition:
PY_Result.h:66
PY
PY_Result.h
Generated on Wed Aug 27 2025 03:08:14 for HDK by
1.8.6