HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_GraphContext.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_GRAPH_CONTEXT_H__
10 #define __PDG_GRAPH_CONTEXT_H__
11 
12 #include "PDG_API.h"
13 
14 #include "PDG_ApplicationShim.h"
15 #include "PDG_CheckpointManager.h"
16 #include "PDG_CommandManager.h"
17 #include "PDG_CookState.h"
18 #include "PDG_EventEmitter.h"
19 #include "PDG_EventQueue.h"
20 #include "PDG_EventTypes.h"
21 #include "PDG_Graph.h"
22 
24 
25 #include <PDGE/PDGE_Evaluator.h>
26 #include <PDGT/PDGT_ValueArgs.h>
27 
28 #include <UT/UT_ArrayMap.h>
29 #include <UT/UT_ArraySet.h>
30 #include <UT/UT_ArrayStringMap.h>
31 #include <UT/UT_Lock.h>
32 #include <UT/UT_NonCopyable.h>
33 #include <UT/UT_StringArray.h>
34 #include <UT/UT_StringHolder.h>
35 #include <UT/UT_StringMap.h>
36 #include <UT/UT_TBBSpinLock.h>
37 #include <UT/UT_UniquePtr.h>
38 #include <UT/UT_ValArray.h>
39 #include <UT/UT_VectorTypes.h>
40 
41 #include <SYS/SYS_AtomicInt.h>
42 
43 class PDG_CommandChunk;
44 class PDG_Command;
45 struct PDG_CookOptions;
46 class PDG_InProcessScheduler;
47 struct PDG_MemoryInfo;
48 class PDG_Scheduler;
49 class PDG_SchedulerType;
50 class PDG_ServiceScheduler;
51 class PDG_WorkItem;
52 
53 class UT_JSONWriter;
54 class UT_Thread;
55 class UT_WorkBuffer;
56 
57 /*
58  * Stores core components of a PDG graph, such as the node graph itself, the
59  * schedulers and the event queue
60  */
62 {
63 public:
65 
66  /*
67  * Observer that gets called each time a graph context is created or
68  * destroyed
69  */
71  {
72  public:
73  Observer() {}
74  virtual ~Observer() {}
76 
77  virtual void onPDGGraphContextRegistered(
78  PDG_GraphContext *context) = 0;
79  virtual void onPDGGraphContextDeregistered(
80  PDG_GraphContext *context) = 0;
81  };
82 
83 public:
84  /// Returns the context with the specified name, or nullptr if no such
85  /// context exists
86  static PDG_GraphContext* contextByName(const UT_StringHolder& name);
87 
88  /// Returns the context with the specified ID, or nullptr if no such
89  /// context exists
90  static PDG_GraphContext* contextByID(int id);
91 
92  /// Returns the list of all registered context names
93  static UT_StringArray contextNames();
94 
95  /// Returns the list of all registered context IDs
96  static UT_IntArray contextIDs();
97 
98  /// Adds and removes a global observer, which is notified each time a
99  /// graph context is created
100  static void addGraphContextObserver(Observer *observer);
101  static void removeGraphContextObserver(Observer *observer);
102 
103  /// Constructs a new context with the specified name and id. It is up to
104  /// the caller to supply a unique id, which is typically set to an
105  /// application-specific value such as the unique ID of a TOP_Network.
107  const char* name="context",
108  int id=-1);
109  ~PDG_GraphContext() override;
110 
111  /// Returns the list of supported event types
112  const PDG_EventFilter& supportedEventTypes() const override;
113 
114  /// Returns total memory usage of the graph and schedulers contained in
115  /// this context
116  int64 getMemoryUsage(
117  bool inclusive) const override;
118 
119  /// Returns a fined grained breakdown of memory used by the nodes and
120  /// work items in the graph context
121  void memoryInfo(
122  PDG_MemoryInfo& memory_info,
123  bool inclusive) const;
124 
125  /// Sets the application-specific graph object
126  void setAppGraph(PDG_ApplicationShim::Graph* graph)
127  { myAppGraph = graph; }
128 
129  /// The graph owned by this instance
131  { return &myGraph; }
132 
133  /// Returns the event queue associted with this context
135  { return &theEventQueue; }
136 
137  /// Returns the checkpoint manager associated with this instance
139  { return &myCheckpointManager; }
140 
141  /// The unique name of the graph context
142  const UT_StringHolder& name() const
143  { return myName; }
144 
145  /// Returns the id of the graph context
146  int id() const
147  { return myId; }
148 
149  /// Returns the default work item label
150  bool defaultWorkItemLabel(
151  UT_StringHolder& label) const;
152 
153  /// Returns the current cook state object, which stores various
154  /// metadata relating to the active grap hook
155  const PDG_CookState& cookState() const
156  { return myCookState; }
157 
158  /// Returns true if the context is actively cooking
159  bool cooking() const
160  { return myCooking; }
161 
162  /// Returns true if the context is processing a cancel request from the
163  /// user
164  bool canceling() const
165  { return myCanceling; }
166 
167 
168  /// Returns the current default scheduler, or nullptr if no schedulers
169  /// exist. The first scheduled created is automatically set as the
170  /// default.
172  { return myDefaultScheduler; }
173 
174  /// Returns the service scheduler, which is used to process work items
175  /// from nodes with service mode enabled.
176  PDG_ServiceScheduler* serviceScheduler() const
177  { return myServiceScheduler; }
178 
179  /// Returns the default in process scheduler, which is used to process
180  /// in process items that need to run on the main thread
181  PDG_InProcessScheduler* inProcessScheduler() const
182  { return myInProcessScheduler; }
183 
184  /// Adds a new scheduler instance to the graph context
185  void addScheduler(
186  const UT_StringHolder& name,
187  PDG_SchedulerPtr scheduler);
188 
189  /// Adds a new scheduler constructed from the specified type instance,
190  /// and with the desired named. This method ensures that the name is
191  /// unique.
192  PDG_Scheduler* addScheduler(
193  const UT_StringHolder& preferred_name,
194  PDG_SchedulerType* scheduler_type,
195  UT_WorkBuffer& errors);
196 
197  /// Removes the scheduler with the specified name, and returns true if
198  /// it was found/removed.
199  bool removeScheduler(
200  const UT_StringHolder& name);
201 
202  /// Sets the specified scheduler as the new default.
203  void setDefaultScheduler(
204  PDG_Scheduler* scheduler);
205 
206  /// Returns the scheduler with the specified name, or nullptr if no such
207  /// scheduler exists.
208  PDG_Scheduler* schedulerForName(
209  const UT_StringHolder& name) const;
210 
211  /// Returns the first scheduler instance with the specified type name, or
212  /// nullptr if no such scheduler exists
213  PDG_Scheduler* schedulerForTypeName(
214  const UT_StringHolder& type_name) const;
215 
216  /// Returns the map of scheduler name -> scheduler pointer that exist
217  /// in the graph context
218  const SchedulerMap& schedulers() const;
219 
220  /// Returns shared server info by searching for it across all active
221  /// schedulers
222  PDGT_ValueArgs getSharedServerInfo(
223  const UT_StringHolder &sharedserver_name);
224 
225  /// Cleans the temporary file directory for the specified scheduler
226  void cleanTempDirectory(
227  const UT_StringHolder& scheduler_name);
228 
229  /// Cancel the cook if it's running and block until it's finished canceling
230  void cancelCook();
231 
232  /// Similar to cancel, except work items that are in-progress are not
233  /// killed, and results can be collected later.
234  void pauseCook();
235 
236  /// Cooks the graph with the specified options. Returns false if there was
237  /// a probably starting the cook
238  bool cook(
239  const PDG_CookOptions& options,
240  UT_WorkBuffer& errors);
241 
242 
243  /// Returns the current open command chunk
244  PDG_CommandChunk* currentChunk() const;
245 
246  /// Opens a new command chunk with an option description string
247  PDG_CommandChunk* openChunk(UT_StringHolder description = "");
248 
249  /// Opens a new delayed command chunk
250  PDG_CommandChunk* openChunk(
251  bool delayed,
252  const UT_StringHolder& description);
253 
254  /// Record, undo and redo commands
255  bool commitChunk(UT_WorkBuffer& errors);
256  bool rollbackChunk(UT_WorkBuffer& errors);
257  bool undoIt(UT_WorkBuffer& errors);
258  bool redoIt(UT_WorkBuffer& errors);
259  bool recordCommand(
261  UT_WorkBuffer& errors);
262 
263  /// Returns the number of entries in the command manager
264  int stateCount() const;
265 
266  /// Returns the number of entries in the current command chunk
267  int chunkDepth() const;
268 
269  /// Dumps the current command manager contents to the input buffer
270  void commandDescriptions(
271  UT_WorkBuffer& buffer) const;
272 
273  /// Serializes the node graph to a buffer
274  void serializeGraph(UT_WorkBuffer& buffer);
275  void serializeGraph(
276  const UT_StringHolder& file_name,
277  UT_StringHolder extras = "");
278 
279  /// Serializes the work item graph to a buffer
280  void serializeWorkItems(UT_WorkBuffer& buffer);
281  void serializeWorkItems(
282  const UT_StringHolder& file_name,
283  UT_StringHolder extras = "");
284 
285  /// Serializes both the work item and node graph
286  void serialize(UT_WorkBuffer& buffer);
287  void serialize(
288  const UT_StringHolder& file_name,
289  UT_StringHolder extras = "");
290 
291  /// Serializes the specified work item to JSON
292  UT_StringHolder serializeWorkItemToJSON(
293  PDG_WorkItem* work_item,
294  bool pretty_print) const;
295 
296  /// Loads a work item from JSON
297  PDG_WorkItem* deserializeWorkItemFromJSON(
298  const UT_StringHolder& buffer,
299  UT_WorkBuffer& errors);
300 
301  /// Loads a work item checkpoint file
302  bool deserializeCheckpoint(
303  const UT_StringHolder& file_path,
304  UT_WorkBuffer& errors);
305 
306  /// Begins deserializing a work item graph, part of the Python
307  /// serialization API
308  void beginDeserialization();
309 
310  /// Deserializes a work item from a serialization struct
311  void addWorkItem(
312  const PDG_WorkItemSerialization& serialization);
313 
314  /// Adds a dependency between two work items, given their names
315  void addWorkItemDependency(
316  const UT_StringHolder& item_name,
317  const UT_StringHolder& dep_name,
318  bool required,
319  bool user_defined);
320 
321  /// Adds a dependency between two work items, given their IDs
322  void addWorkItemDependencyId(
323  PDG_WorkItemID item_id,
324  PDG_WorkItemID dep_id,
325  bool required,
326  bool user_defined);
327 
328  /// Adds a propagate dependency between two work iems, given their names
330  const UT_StringHolder& item_name,
331  const UT_StringHolder& dep_name) {}
332 
333  /// Adds a propagate dependency between two work iems, given their IDs
335  PDG_WorkItemID item_id,
336  PDG_WorkItemID dep_id) {}
337 
338  /// Adds work item output files onto the specified work item, by name
339  void addWorkItemResults(
340  const UT_StringHolder& item_name,
341  const UT_StringArray& results,
342  const UT_StringArray& tags,
343  const UT_Array<int64>& hash_codes,
344  const UT_Array<bool>& is_expected,
345  const UT_Array<bool>& is_owned);
346 
347  /// Adds work item output files onto the specified work item, by id
348  void addWorkItemResultsId(
349  PDG_WorkItemID item_id,
350  const UT_StringArray& results,
351  const UT_StringArray& tags,
352  const UT_Array<int64>& hash_codes,
353  const UT_Array<bool>& is_expected,
354  const UT_Array<bool>& is_owned);
355 
356  /// Commits a partially deserialized work item to the PDG graph
357  void commitWorkItem(
358  const UT_StringHolder& item_name);
359  void commitWorkItemId(PDG_WorkItemID item_id);
360 
361  /// Writes the nodes and schedulers in the graph to JSON
362  bool asJSON(
363  UT_JSONWriter& writer,
364  bool skip_defaults) const;
365  bool saveJSON(
367  bool pretty_print,
368  bool skip_defaults) const;
369  bool saveJSON(
370  std::ostream &os,
371  bool binary,
372  bool skip_defaults) const;
373  bool saveJSON(
374  const UT_StringHolder& file_path,
375  bool pretty_print,
376  bool skip_defaults) const;
377 
378  /// Creates a graph from JSON
379  bool fromJSON(
380  const UT_JSONValue& value,
381  UT_WorkBuffer& errors);
382 
383  bool loadJSON(
384  const UT_StringHolder& file_path,
385  UT_WorkBuffer& errors);
386 
387  /// Runs a function with the context lock held, for a specific graph
388  /// context. If a context with the name does not exist, the function is
389  /// not called.
390  template <typename Func>
392  const UT_StringHolder& name,
393  const Func& func)
394  {
395  UT_Lock::Scope auto_lock(
396  theContextLock);
397  auto it = theContextMap.find(name);
398  if (it != theContextMap.end())
399  func(it->second);
400  }
401 
402  /// Runs a function over all graph contexts with the context lock held
403  template <typename Func>
404  static void safeGraphContextAccess(const Func& func)
405  {
406  UT_Lock::Scope auto_lock(
407  theContextLock);
408  for (auto&& entry : theContextMap)
409  func(entry.second);
410  }
411 
412  /// Runs a function with the scheduler lock held
413  template<typename Func>
415  const UT_StringHolder& name,
416  const Func& func)
417  {
418  UT_Lock::Scope schedulersLock(
419  mySchedulersLock);
420 
421  auto it = mySchedulers.find(name);
422  if (it != mySchedulers.end())
423  func(it->second.get());
424  }
425 
426 protected:
427  bool preEvaluation() override;
428  bool tickEvaluation() override;
429  void postEvaluation(
431  bool canceled) override;
432 
433 private:
434  using ContextMap = UT_ArrayStringMap<PDG_GraphContext*>;
435  using ObserverSet = UT_ArraySet<Observer*>;
436  using SerializationMap = UT_ArrayMap<PDG_WorkItemID, bool>;
437 
438  /// The JSON key for nodes, when writing the graph to JSON
439  static const UT_StringHolder theNodesKey;
440 
441  /// The JSON key for schedulers, when writing the graph to JSON
442  static const UT_StringHolder theSchedulersKey;
443 
444 
445  static void registerContext(PDG_GraphContext* context);
446  static void deregisterContext(PDG_GraphContext* context);
447  static void onExit(void* data);
448  static void onPyExit();
449  static void* doTickThread(void* data);
450 
451  void commitWorkItemInternal(
452  PDG_WorkItem* work_item);
453  void addWorkItemDependencyInternal(
454  PDG_WorkItem* work_item,
455  PDG_WorkItem* dependency,
456  bool required,
457  bool user_defined);
458  void addWorkItemResultsInternal(
459  PDG_WorkItem* work_item,
460  const UT_StringArray& results,
461  const UT_StringArray& tags,
462  const UT_Array<int64>& hash_codes,
463  const UT_Array<bool>& is_expected,
464  const UT_Array<bool>& is_owned);
465 
466  void serializeWorkItem(
468  SerializationMap& serialization_map,
469  const PDG_WorkItem* item) const;
470  void serializeWorkItemCommit(
472  SerializationMap& serialization_map,
473  const PDG_WorkItem* item) const;
474 
475  PDG_GraphContext* context()
476  { return this; }
477 
478 private:
479  static ContextMap theContextMap;
480  static UT_Lock theContextLock;
481  static ObserverSet theObservers;
482  static UT_TBBSpinLock theObserverLock;
483  static bool theRegisteredAtExit;
484 
485  UT_StringHolder myName;
486  int myId;
487 
488  PDG_Graph myGraph;
489  PDG_CommandManager myUserCmdManager;
490  PDG_WorkItemSerialization::Map mySerializationMap;
491 
492  PDG_CheckpointManager myCheckpointManager;
493 
494  mutable UT_Lock mySchedulersLock;
495  SchedulerMap mySchedulers;
496 
497  PDG_Scheduler* myDefaultScheduler;
498  PDG_ServiceScheduler* myServiceScheduler;
499  PDG_InProcessScheduler* myInProcessScheduler;
500 
501  UT_Thread* myTickThread;
502  PDG_ApplicationShim::Graph* myAppGraph;
503 
504  PDG_CookState myCookState;
505 
506  bool myCooking;
507  bool myCanceling;
508  SYS_AtomicInt32 myTickActive;
509 
510  static PDG_EventQueue theEventQueue;
511 };
512 
513 #endif /* __PDG_GRAPH_CONTEXT_H__ */
exint PDG_WorkItemID
Type defs for unique work item IDs.
State
The state of the evaluator object.
PDG_ServiceScheduler * serviceScheduler() const
PDG_CheckpointManager * checkpointManager()
Returns the checkpoint manager associated with this instance.
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2545
GLsizei const GLfloat * value
Definition: glcorearb.h:824
const GLuint GLenum const void * binary
Definition: glcorearb.h:1924
#define PDG_API
Definition: PDG_API.h:23
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:39
GLuint buffer
Definition: glcorearb.h:660
PDG_InProcessScheduler * inProcessScheduler() const
static void safeGraphContextAccess(const UT_StringHolder &name, const Func &func)
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
bool canceling() const
int id() const
Returns the id of the graph context.
void addWorkItemPropagateDep(const UT_StringHolder &item_name, const UT_StringHolder &dep_name)
Adds a propagate dependency between two work iems, given their names.
constexpr std::enable_if< I< type_count_base< T >::value, int >::type tuple_type_size(){return subtype_count< typename std::tuple_element< I, T >::type >::value+tuple_type_size< T, I+1 >);}template< typename T > struct type_count< T, typename std::enable_if< is_tuple_like< T >::value >::type >{static constexpr int value{tuple_type_size< T, 0 >)};};template< typename T > struct subtype_count{static constexpr int value{is_mutable_container< T >::value?expected_max_vector_size:type_count< T >::value};};template< typename T, typename Enable=void > struct type_count_min{static const int value{0};};template< typename T >struct type_count_min< T, typename std::enable_if<!is_mutable_container< T >::value &&!is_tuple_like< T >::value &&!is_wrapper< T >::value &&!is_complex< T >::value &&!std::is_void< T >::value >::type >{static constexpr int value{type_count< T >::value};};template< typename T > struct type_count_min< T, typename std::enable_if< is_complex< T >::value >::type >{static constexpr int value{1};};template< typename T >struct type_count_min< T, typename std::enable_if< is_wrapper< T >::value &&!is_complex< T >::value &&!is_tuple_like< T >::value >::type >{static constexpr int value{subtype_count_min< typename T::value_type >::value};};template< typename T, std::size_t I >constexpr typename std::enable_if< I==type_count_base< T >::value, int >::type tuple_type_size_min(){return 0;}template< typename T, std::size_t I > constexpr typename std::enable_if< I< type_count_base< T >::value, int >::type tuple_type_size_min(){return subtype_count_min< typename std::tuple_element< I, T >::type >::value+tuple_type_size_min< T, I+1 >);}template< typename T > struct type_count_min< T, typename std::enable_if< is_tuple_like< T >::value >::type >{static constexpr int value{tuple_type_size_min< T, 0 >)};};template< typename T > struct subtype_count_min{static constexpr int value{is_mutable_container< T >::value?((type_count< T >::value< expected_max_vector_size)?type_count< T >::value:0):type_count_min< T >::value};};template< typename T, typename Enable=void > struct expected_count{static const int value{0};};template< typename T >struct expected_count< T, typename std::enable_if<!is_mutable_container< T >::value &&!is_wrapper< T >::value &&!std::is_void< T >::value >::type >{static constexpr int value{1};};template< typename T > struct expected_count< T, typename std::enable_if< is_mutable_container< T >::value >::type >{static constexpr int value{expected_max_vector_size};};template< typename T >struct expected_count< T, typename std::enable_if<!is_mutable_container< T >::value &&is_wrapper< T >::value >::type >{static constexpr int value{expected_count< typename T::value_type >::value};};enum class object_category:int{char_value=1, integral_value=2, unsigned_integral=4, enumeration=6, boolean_value=8, floating_point=10, number_constructible=12, double_constructible=14, integer_constructible=16, string_assignable=23, string_constructible=24, other=45, wrapper_value=50, complex_number=60, tuple_value=70, container_value=80,};template< typename T, typename Enable=void > struct classify_object{static constexpr object_category value{object_category::other};};template< typename T >struct classify_object< T, typename std::enable_if< std::is_integral< T >::value &&!std::is_same< T, char >::value &&std::is_signed< T >::value &&!is_bool< T >::value &&!std::is_enum< T >::value >::type >{static constexpr object_category value{object_category::integral_value};};template< typename T >struct classify_object< T, typename std::enable_if< std::is_integral< T >::value &&std::is_unsigned< T >::value &&!std::is_same< T, char >::value &&!is_bool< T >::value >::type >{static constexpr object_category value{object_category::unsigned_integral};};template< typename T >struct classify_object< T, typename std::enable_if< std::is_same< T, char >::value &&!std::is_enum< T >::value >::type >{static constexpr object_category value{object_category::char_value};};template< typename T > struct classify_object< T, typename std::enable_if< is_bool< T >::value >::type >{static constexpr object_category value{object_category::boolean_value};};template< typename T > struct classify_object< T, typename std::enable_if< std::is_floating_point< T >::value >::type >{static constexpr object_category value{object_category::floating_point};};template< typename T >struct classify_object< T, typename std::enable_if<!std::is_floating_point< T >::value &&!std::is_integral< T >::value &&std::is_assignable< T &, std::string >::value >::type >{static constexpr object_category value{object_category::string_assignable};};template< typename T >struct classify_object< T, typename std::enable_if<!std::is_floating_point< T >::value &&!std::is_integral< T >::value &&!std::is_assignable< T &, std::string >::value &&(type_count< T >::value==1)&&std::is_constructible< T, std::string >::value >::type >{static constexpr object_category value{object_category::string_constructible};};template< typename T > struct classify_object< T, typename std::enable_if< std::is_enum< T >::value >::type >{static constexpr object_category value{object_category::enumeration};};template< typename T > struct classify_object< T, typename std::enable_if< is_complex< T >::value >::type >{static constexpr object_category value{object_category::complex_number};};template< typename T > struct uncommon_type{using type=typename std::conditional<!std::is_floating_point< T >::value &&!std::is_integral< T >::value &&!std::is_assignable< T &, std::string >::value &&!std::is_constructible< T, std::string >::value &&!is_complex< T >::value &&!is_mutable_container< T >::value &&!std::is_enum< T >::value, std::true_type, std::false_type >::type;static constexpr bool value=type::value;};template< typename T >struct classify_object< T, typename std::enable_if<(!is_mutable_container< T >::value &&is_wrapper< T >::value &&!is_tuple_like< T >::value &&uncommon_type< T >::value)>::type >{static constexpr object_category value{object_category::wrapper_value};};template< typename T >struct classify_object< T, typename std::enable_if< uncommon_type< T >::value &&type_count< T >::value==1 &&!is_wrapper< T >::value &&is_direct_constructible< T, double >::value &&is_direct_constructible< T, int >::value >::type >{static constexpr object_category value{object_category::number_constructible};};template< typename T >struct classify_object< T, typename std::enable_if< uncommon_type< T >::value &&type_count< T >::value==1 &&!is_wrapper< T >::value &&!is_direct_constructible< T, double >::value &&is_direct_constructible< T, int >::value >::type >{static constexpr object_category value{object_category::integer_constructible};};template< typename T >struct classify_object< T, typename std::enable_if< uncommon_type< T >::value &&type_count< T >::value==1 &&!is_wrapper< T >::value &&is_direct_constructible< T, double >::value &&!is_direct_constructible< T, int >::value >::type >{static constexpr object_category value{object_category::double_constructible};};template< typename T >struct classify_object< T, typename std::enable_if< is_tuple_like< T >::value &&((type_count< T >::value >=2 &&!is_wrapper< T >::value)||(uncommon_type< T >::value &&!is_direct_constructible< T, double >::value &&!is_direct_constructible< T, int >::value)||(uncommon_type< T >::value &&type_count< T >::value >=2))>::type >{static constexpr object_category value{object_category::tuple_value};};template< typename T > struct classify_object< T, typename std::enable_if< is_mutable_container< T >::value >::type >{static constexpr object_category value{object_category::container_value};};template< typename T, enable_if_t< classify_object< T >::value==object_category::char_value, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"CHAR";}template< typename T, enable_if_t< classify_object< T >::value==object_category::integral_value||classify_object< T >::value==object_category::integer_constructible, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"INT";}template< typename T, enable_if_t< classify_object< T >::value==object_category::unsigned_integral, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"UINT";}template< typename T, enable_if_t< classify_object< T >::value==object_category::floating_point||classify_object< T >::value==object_category::number_constructible||classify_object< T >::value==object_category::double_constructible, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"FLOAT";}template< typename T, enable_if_t< classify_object< T >::value==object_category::enumeration, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"ENUM";}template< typename T, enable_if_t< classify_object< T >::value==object_category::boolean_value, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"BOOLEAN";}template< typename T, enable_if_t< classify_object< T >::value==object_category::complex_number, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"COMPLEX";}template< typename T, enable_if_t< classify_object< T >::value >=object_category::string_assignable &&classify_object< T >::value<=object_category::other, detail::enabler >=detail::dummy >constexpr const char *type_name(){return"TEXT";}template< typename T, enable_if_t< classify_object< T >::value==object_category::tuple_value &&type_count_base< T >::value >=2, detail::enabler >=detail::dummy >std::string type_name();template< typename T, enable_if_t< classify_object< T >::value==object_category::container_value||classify_object< T >::value==object_category::wrapper_value, detail::enabler >=detail::dummy >std::string type_name();template< typename T, enable_if_t< classify_object< T >::value==object_category::tuple_value &&type_count_base< T >::value==1, detail::enabler >=detail::dummy >inline std::string type_name(){return type_name< typename std::decay< typename std::tuple_element< 0, T >::type >::type >);}template< typename T, std::size_t I >inline typename std::enable_if< I==type_count_base< T >::value, std::string >::type tuple_name(){return std::string{};}template< typename T, std::size_t I >inline typename std::enable_if<(I< type_count_base< T >::value), std::string >::type tuple_name(){auto str=std::string{type_name< typename std::decay< typename std::tuple_element< I, T >::type >::type >)}+ ','+tuple_name< T, I+1 >);if(str.back()== ',') str.pop_back();return str;}template< typename T, enable_if_t< classify_object< T >::value==object_category::tuple_value &&type_count_base< T >::value >=2, detail::enabler > > std::string type_name()
Recursively generate the tuple type name.
Definition: CLI11.h:1729
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
void addWorkItemPropagateDepId(PDG_WorkItemID item_id, PDG_WorkItemID dep_id)
Adds a propagate dependency between two work iems, given their IDs.
long long int64
Definition: SYS_Types.h:116
static void safeGraphContextAccess(const Func &func)
Runs a function over all graph contexts with the context lock held.
bool cooking() const
Returns true if the context is actively cooking.
void safeSchedulerAccess(const UT_StringHolder &name, const Func &func)
Runs a function with the scheduler lock held.
GLuint const GLchar * name
Definition: glcorearb.h:786
PDG_EventQueue * getEventQueue()
Returns the event queue associted with this context.
const PDG_CookState & cookState() const
PDG_Graph * graph()
The graph owned by this instance.
GLenum func
Definition: glcorearb.h:783
UT_SharedPtr< PDG_Scheduler > PDG_SchedulerPtr
Type def for registered type objects.
Class to store JSON objects as C++ objects.
Definition: UT_JSONValue.h:99
PDG_Scheduler * defaultScheduler() const
state
Definition: core.h:2289
Definition: format.h:1821
const UT_StringHolder & name() const
The unique name of the graph context.