HDK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_JobScriptInfo.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  */
8 
9 #ifndef __PDG_JOB_SCRIPT_INFO_H__
10 #define __PDG_JOB_SCRIPT_INFO_H__
11 
12 #include "PDG_API.h"
13 
14 #include <UT/UT_StringArray.h>
15 #include <UT/UT_StringHolder.h>
16 
17 class PDG_Service;
18 class UT_WorkBuffer;
19 
21 {
22 public:
23  /// Enumeration of possible command override types. By default, nodes
24  /// will be configured to use the standard command. But it's possible
25  /// to override the script or entire commandline in a specific node
26  /// instance
28  {
29  /// Use the default command or the one set by the node itself
31 
32  /// Use a custom script, but using the same interepreter and
33  /// script path as normal
35 
36  /// Use a fully custom command string
38  };
39 
40 public:
42 
43  void setScriptInfo(
44  const UT_StringHolder& module_name,
45  const UT_StringHolder& python_module,
46  const UT_StringHolder& extra_args);
47  void setServiceCompatibility(
48  const UT_StringArray& service_type_names);
49  void setServiceCompatibility(
50  const UT_StringHolder& service_type_name,
51  bool compatible);
52 
53  void setIsMainThread(bool is_main_thread)
54  { myIsMainThread = is_main_thread; }
55  void setIsNative(bool is_native)
56  { myIsNative = is_native; }
57 
58  void setCommandOverride(
59  CommandType command_type,
60  const UT_StringHolder& custom);
61 
62  bool isServiceCompatible(
63  const UT_StringHolder& service_type_name) const;
64  bool isServiceCompatible(
65  const PDG_Service& service) const;
66 
67  void formatCommand(UT_WorkBuffer& buffer) const;
68  UT_StringHolder formatCommand() const;
69 
70  bool isStandardScript() const
71  { return myIsStandardScript; }
72  bool isMainThread() const
73  { return myIsMainThread; }
74  bool isNative() const
75  { return myIsNative; }
76 
77  const UT_StringHolder& moduleName() const
78  { return myModuleName; }
80  { return myPythonExecutable; }
81  const UT_StringHolder& extraArgs() const
82  { return myExtraArgs; }
84  { return myCustomCommand; }
86  { return myServiceTypeNames; }
87 
89  { return myCommandType; }
90 
91 private:
92  UT_StringHolder myModuleName;
93  UT_StringHolder myPythonExecutable;
94  UT_StringHolder myExtraArgs;
95  UT_StringHolder myCustomCommand;
96 
97  UT_StringArray myServiceTypeNames;
98 
99  CommandType myCommandType;
100 
101  bool myIsStandardScript;
102  bool myIsMainThread;
103  bool myIsNative;
104 };
105 
106 #endif
CommandType commandType() const
bool isStandardScript() const
const UT_StringHolder & moduleName() const
Use a fully custom command string.
const UT_StringArray & serviceTypeNames() const
#define PDG_API
Definition: PDG_API.h:23
const UT_StringHolder & pythonExecutable() const
Definition: core.h:760
void setIsMainThread(bool is_main_thread)
const UT_StringHolder & extraArgs() const
Use the default command or the one set by the node itself.
const UT_StringHolder & customCommand() const
void setIsNative(bool is_native)
bool isMainThread() const
bool isNative() const