HDK
|
#include <PDG_WorkItemSerialization.h>
Classes | |
struct | Stat |
Public Types | |
enum | CheckpointType { eCheckpointNone, eCheckpointInitial, eCheckpointUpdate } |
using | Array = UT_Array< PDG_WorkItemSerialization > |
using | Map = UT_ArrayStringMap< PDG_WorkItem * > |
Public Member Functions | |
PDG_WorkItemSerialization (int version=0) | |
Constructs an empty, default-initialized serialization object. More... | |
bool | loadAttributes (const UT_JSONValue &value, PDG_AttributeSaveType save_type, bool reset) |
Loads work item attributes from a JSON value. More... | |
bool | loadAttributes (const UT_WorkBuffer &buffer, PDG_AttributeSaveType save_type, bool reset) |
Loads work item attributres from a buffer. More... | |
PDG_WorkItem * | toWorkItem (PDG_GraphContext *context, PDG_WorkItemID base_id, bool strict, Map &compat_map, UT_WorkBuffer &errors) const |
bool | initializeString (const UT_StringHolder &data, UT_WorkBuffer &errors) |
Initializes this instance from JSON string data. More... | |
bool | initializeStream (UT_IStream &istream, UT_WorkBuffer &errors) |
Initializes this instance from a stream of JSON data. More... | |
bool | initializeFile (const UT_StringHolder &file_path, UT_WorkBuffer &errors) |
Initializes this instance from a JSON file. More... | |
bool | initializeDict (const UT_OptionsHolder &dict, UT_WorkBuffer &errors) |
Initializes this instance from a dictionary. More... | |
UT_StringHolder | workItemName () const |
Static Public Member Functions | |
static bool | saveJSON (UT_WorkBuffer &buffer, const PDG_WorkItem *work_item, const PDG_SerializationOptions &options, CheckpointType checkpoint=eCheckpointNone) |
Saves the specified work item to the buffer, as JSON. More... | |
static bool | saveJSON (std::ostream &ostream, const PDG_WorkItem *work_item, const PDG_SerializationOptions &options, CheckpointType checkpoint=eCheckpointNone) |
Saves the specified work item to the stream, as JSON. More... | |
static bool | saveJSON (const UT_StringHolder &file_path, const PDG_WorkItem *work_item, const PDG_SerializationOptions &options, CheckpointType checkpoint=eCheckpointNone) |
Saves the specified work item to the file, as JSON. More... | |
static bool | saveDict (UT_OptionsHolder &dict, const PDG_WorkItem *work_item, const PDG_SerializationOptions &options, CheckpointType checkpoint=eCheckpointNone) |
Saves the specified work item to the UT_Options as a dictionary. More... | |
static bool | saveArrayJSON (UT_WorkBuffer &buffer, const PDG_WorkItemArray &work_items, const PDG_SerializationOptions &options, CheckpointType checkpoint=eCheckpointNone) |
Saves the specified work item array to the buffer, as JSON. More... | |
static bool | saveArrayJSON (std::ostream &ostream, const PDG_WorkItemArray &work_items, const PDG_SerializationOptions &options, CheckpointType checkpoint=eCheckpointNone) |
Saves the specified work item array to the stream, as JSON. More... | |
static bool | saveArrayJSON (const UT_StringHolder &file_path, const PDG_WorkItemArray &work_items, const PDG_SerializationOptions &options, CheckpointType checkpoint=eCheckpointNone) |
Saves the specified work item array to the file, as JSON. More... | |
static bool | saveArrayDict (UT_OptionsHolder &dict, const PDG_WorkItemArray &work_items, const PDG_SerializationOptions &options, CheckpointType checkpoint=eCheckpointNone) |
Saves the specified work item array to UT_Options. More... | |
static bool | saveDependencyJSON (UT_WorkBuffer &buffer, const PDG_WorkItem *from, const PDG_WorkItem *to, bool required, bool user_defined, const PDG_SerializationOptions &options, CheckpointType checkpoint=eCheckpointNone) |
Saves the specified work item dependency pair to the buffer, as JSON. More... | |
static bool | saveDependencyJSON (std::ostream &ostream, const PDG_WorkItem *from, const PDG_WorkItem *to, bool required, bool user_defined, const PDG_SerializationOptions &options, CheckpointType checkpoint=eCheckpointNone) |
Saves the specified work item dependency pair to the stream, as JSON. More... | |
static bool | saveDependencyJSON (const UT_StringHolder &file_path, const PDG_WorkItem *from, const PDG_WorkItem *to, bool required, bool user_defined, const PDG_SerializationOptions &options, CheckpointType checkpoint=eCheckpointNone) |
Saves the specified work item dependency pair to the file, as JSON. More... | |
static bool | saveVersion (UT_WorkBuffer &buffer, const PDG_SerializationOptions &options) |
Saves a map with the data version to the buffer, as JSON. More... | |
static bool | saveVersion (std::ostream &ostream, const PDG_SerializationOptions &options) |
Saves a map with the data version to the stream, as JSON. More... | |
static bool | saveVersion (const UT_StringHolder &file_path, const PDG_SerializationOptions &options) |
Saves a map with the data version to the file, as JSON. More... | |
static bool | savePython (UT_WorkBuffer &buffer, const PDG_WorkItem *work_item, const PDG_SerializationOptions &options) |
Saves the specified work item to the buffer, as a Python script. More... | |
static PDG_WorkItem * | fromJSON (const UT_StringHolder &buffer, PDG_GraphContext *context, Map &compat_map, bool make_active, UT_WorkBuffer &errors) |
Loads a work item from a buffer containing JSON string data. More... | |
static PDG_WorkItem * | fromJSON (UT_IStream &istream, bool make_active, UT_WorkBuffer &errors) |
Loads a work item from a stream containing JSON data. More... | |
static PDG_WorkItem * | fromJSON (const UT_StringHolder &file_path, bool make_active, UT_WorkBuffer &errors) |
Loads a work item from a file path. More... | |
static PDG_WorkItem * | fromDict (const UT_OptionsHolder &dict, bool make_active, UT_WorkBuffer &errors) |
Loads a work item from a dict. More... | |
static bool | fromArrayJSON (PDG_WorkItemArray &work_items, UT_IStream &istream, PDG_GraphContext *context, bool is_compressed, UT_WorkBuffer &errors) |
Loads a work item array from a stream containing JSON data. More... | |
static bool | fromArrayJSON (Array &serialization_array, const UT_StringHolder &buffer, UT_WorkBuffer &errors) |
Loads a serialization object array from a buffer containing JSON data. More... | |
static bool | fromArrayJSON (Array &serialization_array, const UT_StringHolder &file_path, bool is_compressed, UT_WorkBuffer &errors) |
Loads a serialization object array from a file containing JSON data. More... | |
static bool | fromArrayDict (Array &serialization_array, const UT_OptionsHolder &dict, UT_WorkBuffer &errors) |
Loads a serialization object array from a dictionary. More... | |
static bool | statJSON (Stat &json_stat, const UT_StringHolder &buffer, UT_WorkBuffer &errors) |
Stats the JSON data in the specified string. More... | |
static bool | statJSON (Stat &json_stat, const UT_StringHolder &file_path, bool is_compressed, UT_WorkBuffer &errors) |
Stats the JSON data in the specified file. More... | |
static bool | statJSON (Stat &json_stat, UT_IStream &istream, bool is_compressed, UT_WorkBuffer &errors) |
Stats the JSON data in the stream. More... | |
static bool | statDict (Stat &dict_stat, const UT_OptionsHolder &dict, UT_WorkBuffer &errors) |
Stats the dictionary data. More... | |
static UT_StringHolder | createJSONPatch (const PDG_WorkItem *work_item, bool pretty_print) |
static bool | applyJSONPatch (PDG_WorkItem *work_item, const UT_JSONValueMap &patch_map, UT_WorkBuffer &errors) |
static bool | loadCheckpoint (PDG_GraphContext *context, const UT_StringHolder &file_path, UT_WorkBuffer &errors) |
Loads a checkpoint .json file. More... | |
Helper class for loading and storing work items to serialization formats
Definition at line 44 of file PDG_WorkItemSerialization.h.
Definition at line 47 of file PDG_WorkItemSerialization.h.
Definition at line 48 of file PDG_WorkItemSerialization.h.
Enumeration of checkpoint save types, which are used to determine which set of fields to write to the JSON object for a serialized work item
Definition at line 64 of file PDG_WorkItemSerialization.h.
PDG_WorkItemSerialization::PDG_WorkItemSerialization | ( | int | version = 0 | ) |
Constructs an empty, default-initialized serialization object.
|
static |
Updates work item outputs and attributes from the patch stored in the json map
|
static |
Creates a JSON patch from changed attributes and outputs on the work item
|
static |
Loads a serialization object array from a dictionary.
|
static |
Loads a work item array from a stream containing JSON data.
|
static |
Loads a serialization object array from a buffer containing JSON data.
|
static |
Loads a serialization object array from a file containing JSON data.
|
static |
Loads a work item from a dict.
|
static |
Loads a work item from a buffer containing JSON string data.
|
static |
Loads a work item from a stream containing JSON data.
|
static |
Loads a work item from a file path.
bool PDG_WorkItemSerialization::initializeDict | ( | const UT_OptionsHolder & | dict, |
UT_WorkBuffer & | errors | ||
) |
Initializes this instance from a dictionary.
bool PDG_WorkItemSerialization::initializeFile | ( | const UT_StringHolder & | file_path, |
UT_WorkBuffer & | errors | ||
) |
Initializes this instance from a JSON file.
bool PDG_WorkItemSerialization::initializeStream | ( | UT_IStream & | istream, |
UT_WorkBuffer & | errors | ||
) |
Initializes this instance from a stream of JSON data.
bool PDG_WorkItemSerialization::initializeString | ( | const UT_StringHolder & | data, |
UT_WorkBuffer & | errors | ||
) |
Initializes this instance from JSON string data.
bool PDG_WorkItemSerialization::loadAttributes | ( | const UT_JSONValue & | value, |
PDG_AttributeSaveType | save_type, | ||
bool | reset | ||
) |
Loads work item attributes from a JSON value.
bool PDG_WorkItemSerialization::loadAttributes | ( | const UT_WorkBuffer & | buffer, |
PDG_AttributeSaveType | save_type, | ||
bool | reset | ||
) |
Loads work item attributres from a buffer.
|
static |
Loads a checkpoint .json file.
|
static |
Saves the specified work item array to UT_Options.
|
static |
Saves the specified work item array to the buffer, as JSON.
|
static |
Saves the specified work item array to the stream, as JSON.
|
static |
Saves the specified work item array to the file, as JSON.
|
static |
Saves the specified work item dependency pair to the buffer, as JSON.
|
static |
Saves the specified work item dependency pair to the stream, as JSON.
|
static |
Saves the specified work item dependency pair to the file, as JSON.
|
static |
Saves the specified work item to the UT_Options as a dictionary.
|
static |
Saves the specified work item to the buffer, as JSON.
|
static |
Saves the specified work item to the stream, as JSON.
|
static |
Saves the specified work item to the file, as JSON.
|
static |
Saves the specified work item to the buffer, as a Python script.
|
static |
Saves a map with the data version to the buffer, as JSON.
|
static |
Saves a map with the data version to the stream, as JSON.
|
static |
Saves a map with the data version to the file, as JSON.
|
static |
Stats the dictionary data.
|
static |
Stats the JSON data in the specified string.
|
static |
Stats the JSON data in the specified file.
|
static |
Stats the JSON data in the stream.
PDG_WorkItem* PDG_WorkItemSerialization::toWorkItem | ( | PDG_GraphContext * | context, |
PDG_WorkItemID | base_id, | ||
bool | strict, | ||
Map & | compat_map, | ||
UT_WorkBuffer & | errors | ||
) | const |
Converts the serialization object to a PDG_WorkItem, in the given graph context
UT_StringHolder PDG_WorkItemSerialization::workItemName | ( | ) | const |
Returns the work item name. If the serialization object was created from the old, name-based format this returns the work item's name as listed in the json/python data. Otherwise, this method computes the name from the work item's node name and unique ID.
PDG_BatchActivation PDG_WorkItemSerialization::myActivationMode |
Definition at line 679 of file PDG_WorkItemSerialization.h.
|
mutable |
Definition at line 643 of file PDG_WorkItemSerialization.h.
UT_StringHolder PDG_WorkItemSerialization::myBaseName |
Definition at line 633 of file PDG_WorkItemSerialization.h.
int PDG_WorkItemSerialization::myBatchActivationCount |
Definition at line 659 of file PDG_WorkItemSerialization.h.
int PDG_WorkItemSerialization::myBatchCount |
Definition at line 656 of file PDG_WorkItemSerialization.h.
int PDG_WorkItemSerialization::myBatchIndex |
Definition at line 653 of file PDG_WorkItemSerialization.h.
UT_StringHolder PDG_WorkItemSerialization::myBatchName |
Definition at line 634 of file PDG_WorkItemSerialization.h.
int PDG_WorkItemSerialization::myBatchOffset |
Definition at line 657 of file PDG_WorkItemSerialization.h.
PDG_WorkItemID PDG_WorkItemSerialization::myBatchParentId |
Definition at line 647 of file PDG_WorkItemSerialization.h.
UT_StringHolder PDG_WorkItemSerialization::myBatchParentName |
Definition at line 637 of file PDG_WorkItemSerialization.h.
int PDG_WorkItemSerialization::myBatchStart |
Definition at line 658 of file PDG_WorkItemSerialization.h.
PDG_WorkItemID PDG_WorkItemSerialization::myCloneTargetId |
Definition at line 648 of file PDG_WorkItemSerialization.h.
UT_StringHolder PDG_WorkItemSerialization::myCloneTargetName |
Definition at line 638 of file PDG_WorkItemSerialization.h.
UT_StringHolder PDG_WorkItemSerialization::myCommand |
Definition at line 635 of file PDG_WorkItemSerialization.h.
PDG_WorkItemCookType PDG_WorkItemSerialization::myCookType |
Definition at line 678 of file PDG_WorkItemSerialization.h.
UT_StringHolder PDG_WorkItemSerialization::myCustomData |
Definition at line 641 of file PDG_WorkItemSerialization.h.
UT_StringHolder PDG_WorkItemSerialization::myCustomDataType |
Definition at line 640 of file PDG_WorkItemSerialization.h.
PDGT_Value::Map PDG_WorkItemSerialization::myEnvironment |
Definition at line 644 of file PDG_WorkItemSerialization.h.
PDG_WorkItemExecutionType PDG_WorkItemSerialization::myExecutionType |
Definition at line 677 of file PDG_WorkItemSerialization.h.
fpreal PDG_WorkItemSerialization::myFrame |
Definition at line 661 of file PDG_WorkItemSerialization.h.
fpreal PDG_WorkItemSerialization::myFrameStep |
Definition at line 662 of file PDG_WorkItemSerialization.h.
bool PDG_WorkItemSerialization::myHasFrame |
Definition at line 663 of file PDG_WorkItemSerialization.h.
PDG_WorkItemID PDG_WorkItemSerialization::myId |
Definition at line 649 of file PDG_WorkItemSerialization.h.
int PDG_WorkItemSerialization::myIndex |
Definition at line 652 of file PDG_WorkItemSerialization.h.
int PDG_WorkItemSerialization::myInputExpansion |
Definition at line 655 of file PDG_WorkItemSerialization.h.
PDG_File::Array PDG_WorkItemSerialization::myInputs |
Definition at line 628 of file PDG_WorkItemSerialization.h.
bool PDG_WorkItemSerialization::myIsClearEnvironment |
Definition at line 669 of file PDG_WorkItemSerialization.h.
bool PDG_WorkItemSerialization::myIsCloneOutputFiles |
Definition at line 670 of file PDG_WorkItemSerialization.h.
bool PDG_WorkItemSerialization::myIsControl |
Definition at line 667 of file PDG_WorkItemSerialization.h.
bool PDG_WorkItemSerialization::myIsDynamicBatch |
Definition at line 673 of file PDG_WorkItemSerialization.h.
bool PDG_WorkItemSerialization::myIsFrozen |
Definition at line 671 of file PDG_WorkItemSerialization.h.
bool PDG_WorkItemSerialization::myIsNoGenerate |
Definition at line 668 of file PDG_WorkItemSerialization.h.
bool PDG_WorkItemSerialization::myIsPartialCook |
Definition at line 672 of file PDG_WorkItemSerialization.h.
bool PDG_WorkItemSerialization::myIsPostCook |
Definition at line 665 of file PDG_WorkItemSerialization.h.
bool PDG_WorkItemSerialization::myIsStatic |
Definition at line 666 of file PDG_WorkItemSerialization.h.
Definition at line 620 of file PDG_WorkItemSerialization.h.
Definition at line 622 of file PDG_WorkItemSerialization.h.
Definition at line 624 of file PDG_WorkItemSerialization.h.
UT_StringArray PDG_WorkItemSerialization::myLoopBeginStackNames |
Definition at line 617 of file PDG_WorkItemSerialization.h.
Definition at line 621 of file PDG_WorkItemSerialization.h.
Definition at line 623 of file PDG_WorkItemSerialization.h.
UT_StringHolder PDG_WorkItemSerialization::myName |
Definition at line 632 of file PDG_WorkItemSerialization.h.
UT_StringHolder PDG_WorkItemSerialization::myNodeName |
Definition at line 630 of file PDG_WorkItemSerialization.h.
PDG_WorkItemID PDG_WorkItemSerialization::myParentId |
Definition at line 646 of file PDG_WorkItemSerialization.h.
UT_StringHolder PDG_WorkItemSerialization::myParentName |
Definition at line 636 of file PDG_WorkItemSerialization.h.
int PDG_WorkItemSerialization::myPriority |
Definition at line 654 of file PDG_WorkItemSerialization.h.
UT_StringHolder PDG_WorkItemSerialization::mySchedulerName |
Definition at line 631 of file PDG_WorkItemSerialization.h.
PDG_WorkItemState PDG_WorkItemSerialization::myState |
Definition at line 675 of file PDG_WorkItemSerialization.h.
UT_StringArray PDG_WorkItemSerialization::myStaticAncestorNames |
Definition at line 618 of file PDG_WorkItemSerialization.h.
Array PDG_WorkItemSerialization::mySubItems |
Definition at line 626 of file PDG_WorkItemSerialization.h.
PDG_WorkItemType PDG_WorkItemSerialization::myType |
Definition at line 676 of file PDG_WorkItemSerialization.h.
int PDG_WorkItemSerialization::myVersion |
Definition at line 651 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 545 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 544 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 573 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 522 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 588 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 591 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 599 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 609 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 595 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 604 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 614 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 585 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 568 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 539 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 524 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 538 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 540 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 513 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 571 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 541 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 514 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 572 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 579 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 537 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 521 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 520 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 554 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 556 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 563 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 555 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 576 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 536 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 578 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 526 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 527 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 562 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 528 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 512 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 523 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 575 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 532 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 577 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 543 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 533 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 580 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 531 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 542 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 529 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 530 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 515 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 517 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 574 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 519 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 516 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 518 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 567 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 510 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 570 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 569 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 550 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 551 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 549 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 525 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 511 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 534 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 546 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 535 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 559 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 560 of file PDG_WorkItemSerialization.h.
|
static |
Definition at line 561 of file PDG_WorkItemSerialization.h.