Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
1//
2// Copyright 2025 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_EXEC_VDF_TYPES_H
8#define PXR_EXEC_VDF_TYPES_H
9
11
12#include "pxr/pxr.h"
13
14#include "pxr/exec/vdf/api.h"
15#include "pxr/exec/vdf/defaultInitAllocator.h"
16#include "pxr/exec/vdf/mask.h"
17
18#include "pxr/base/tf/hash.h"
19#include "pxr/base/tf/hashmap.h"
20#include "pxr/base/tf/hashset.h"
22
23#include <functional>
24#include <string>
25#include <unordered_map>
26#include <vector>
27
28PXR_NAMESPACE_OPEN_SCOPE
29
30class VdfConnection;
31class VdfInput;
32class VdfNode;
33class VdfOutput;
34
37VDF_API
39
42
45
47typedef TfHashSet<VdfConnection *, TfHash> VdfConnectionSet;
48
50typedef TfHashSet<const VdfConnection *, TfHash> VdfConnectionConstSet;
51
53typedef TfHashSet<const VdfNode *, TfHash> VdfNodePtrSet;
54
56typedef TfHashSet<const VdfOutput *, TfHash> VdfOutputPtrSet;
57
59typedef TfHashSet<const VdfInput *, TfHash> VdfInputPtrSet;
60
62typedef std::vector<const VdfInput *> VdfInputPtrVector;
63
65typedef std::vector<const VdfOutput *> VdfOutputPtrVector;
66
68typedef std::function<void (const VdfNode &)> VdfNodeCallback;
69
71typedef std::function<std::string()> VdfNodeDebugNameCallback;
72
74typedef unsigned int VdfInvalidationTimestamp;
75
77typedef std::pair<VdfConnection *, VdfMask> VdfConnectionAndMask;
78
80typedef std::vector<VdfConnectionAndMask> VdfConnectionAndMaskVector;
81
84typedef
85 std::function<void (const VdfOutput *, const VdfMask &)>
87
89typedef
90 TfHashMap<const VdfNode *, VdfOutputPtrSet, TfHash>
92
94typedef TfHashMap<const VdfNode *, VdfInputPtrVector, TfHash>
96
98typedef TfHashMap<const VdfNode *, VdfOutputPtrVector, TfHash>
100
102typedef
103 std::unordered_map<const VdfOutput *, VdfMask, TfHash>
105
107typedef uint64_t VdfId;
108
110typedef uint32_t VdfIndex;
111
113typedef uint32_t VdfVersion;
114
116typedef std::vector<VdfId> VdfIdVector;
117
121template <typename T>
122using Vdf_DefaultInitVector = std::vector<T, Vdf_DefaultInitAllocator<T>>;
123
124PXR_NAMESPACE_CLOSE_SCOPE
125
126#endif
This is a small-vector class with local storage optimization, the local storage can be specified via ...
Definition: smallVector.h:157
A class that fully represents a connection between two VdfNodes.
Definition: connection.h:30
A VdfInput is used to connect a VdfNode to one or more VdfNodes' outputs.
Definition: input.h:36
A VdfMask is placed on connections to specify the data flowing through them.
Definition: mask.h:37
This is the base class for all nodes in a VdfNetwork.
Definition: node.h:53
A VdfOutput represents an output on a node.
Definition: output.h:32
std::function< std::string()> VdfNodeDebugNameCallback
Type of callback for building a node debug name.
Definition: types.h:71
std::function< void(const VdfOutput *, const VdfMask &)> VdfScheduledOutputCallback
Function type to be used with ForEachScheduledOutput().
Definition: types.h:86
std::vector< VdfId > VdfIdVector
A vector of ids.
Definition: types.h:116
TfHashSet< const VdfNode *, TfHash > VdfNodePtrSet
Type for an unordered set of nodes pointers.
Definition: types.h:53
std::vector< VdfConnectionAndMask > VdfConnectionAndMaskVector
A vector of VdfConnectionAndMasks.
Definition: types.h:80
TfSmallVector< VdfConnection *, 1 > VdfConnectionVector
Type for an ordered collection of connections.
Definition: types.h:41
TfSmallVector< const VdfConnection *, 1 > VdfConnectionConstVector
Type for an ordered collection of connections.
Definition: types.h:44
TfHashSet< const VdfConnection *, TfHash > VdfConnectionConstSet
Type for an unordered set of connections.
Definition: types.h:50
uint64_t VdfId
The unique identifier type for Vdf objects.
Definition: types.h:107
TfHashSet< const VdfInput *, TfHash > VdfInputPtrSet
Type for an unordered set of input pointers.
Definition: types.h:59
TfHashSet< const VdfOutput *, TfHash > VdfOutputPtrSet
Type for an unordered set of output pointers.
Definition: types.h:56
TfHashMap< const VdfNode *, VdfOutputPtrSet, TfHash > VdfNodeToOutputPtrSetMap
A map from node pointer to VdfOutputPtrSet.
Definition: types.h:91
TfHashMap< const VdfNode *, VdfOutputPtrVector, TfHash > VdfNodeToOutputPtrVectorMap
A map from node pointer to VdfInputPtrVector.
Definition: types.h:99
unsigned int VdfInvalidationTimestamp
Type of the timestamp that identifies the most recent round of invalidation.
Definition: types.h:74
std::function< void(const VdfNode &)> VdfNodeCallback
Type of callback used when processing nodes.
Definition: types.h:68
uint32_t VdfIndex
The index type for Vdf objects.
Definition: types.h:110
std::unordered_map< const VdfOutput *, VdfMask, TfHash > VdfOutputToMaskMap
A map from output pointer to mask.
Definition: types.h:104
std::vector< const VdfOutput * > VdfOutputPtrVector
Type for an ordered collection of outputs.
Definition: types.h:65
std::vector< T, Vdf_DefaultInitAllocator< T > > Vdf_DefaultInitVector
A std::vector which on resize performs default initialization instead of value initialization.
Definition: types.h:122
std::vector< const VdfInput * > VdfInputPtrVector
Type for an ordered collection of inputs.
Definition: types.h:62
uint32_t VdfVersion
The version type for Vdf objects.
Definition: types.h:113
TfHashSet< VdfConnection *, TfHash > VdfConnectionSet
Type for an unordered set of connections.
Definition: types.h:47
VDF_API bool VdfIsParallelEvaluationEnabled()
Returns true if single-frame parallel evaluation is enabled.
std::pair< VdfConnection *, VdfMask > VdfConnectionAndMask
A pair of connection pointer and mask for sparse input dependency computation.
Definition: types.h:77
TfHashMap< const VdfNode *, VdfInputPtrVector, TfHash > VdfNodeToInputPtrVectorMap
A map from node pointer to VdfInputPtrVector.
Definition: types.h:95